Пример #1
0
 public static function fromXmlObj(SimpleXMLElement $xmlObj)
 {
     $way = new OSM_Objects_Way();
     $processedElements = $way->_fromXmlObj($xmlObj);
     foreach ($xmlObj->children() as $child) {
         if (in_array($child->getName(), $processedElements)) {
             continue;
         }
         //OSM_ZLog::debug(__METHOD__, 'Found child: ', $child->getName());
         switch ($child->getName()) {
             case self::OBJTYPE_ND:
                 $way->addNodeRef((string) $child['ref']);
                 break;
             default:
                 throw new OSM_Exception('Object "' . $xmlObj->getName() . '" is not supported in relation');
         }
     }
     $way->setDirty(false);
     return $way;
 }