Lines Matching refs:geometry
47 * Read GPX string into geometry object
107 * Parses the GPX XML and returns a geometry
109 * @return GeometryCollection|Geometry Returns the geometry representation of the GPX (@see geoPHP::buildGeometry)
127 $geometry = geoPHP::buildGeometry($geometries);
133 if ($geometry->getData() !== null && $metadata !== null) {
134 $geometry = new GeometryCollection([$geometry]);
136 $geometry->setData($metadata);
139 return $geometry;
309 * @param Geometry|GeometryCollection $geometry
317 public function write(Geometry $geometry, $namespace = null, $allowedElements = null)
331 ' . $this->geometryToGPX($geometry) .
337 * @param Geometry|Collection $geometry
340 protected function geometryToGPX($geometry)
342 switch ($geometry->geometryType()) {
344 /** @var Point $geometry */
345 return $this->pointToGPX($geometry);
348 /** @var LineString $geometry */
349 return $this->linestringToGPX($geometry);
354 return $this->collectionToGPX($geometry);
431 * @param Collection $geometry
434 public function collectionToGPX($geometry)
436 $metadata = self::processGeometryData($geometry, $this->gpxTypes->get('metadataType'));
442 foreach ($geometry->getComponents() as $component) {
461 * @param Geometry $geometry
466 protected static function processGeometryData($geometry, $tagList, $indent = "\t")
469 if ($geometry->getData() !== null) {
471 if ($geometry->hasDataProperty($tagName)) {
472 $tags .= self::createNodes($tagName, $geometry->getData($tagName), $indent) . "\n";