Lines Matching refs:geometry

18  * Note that it will always return a GeoJSON geometry. This
20 * geometry of that feature strip everything else.
57 // It's a geometry - process it
82 $geometry = $this->read($obj->geometry);
85 $geometry->setData($property, $value);
89 return $geometry;
105 /** @var GeometryCollection $geometry */
106 $geometry = $this->$method($obj->coordinates);
107 $geometry->setSRID($this->getSRID($obj));
108 return $geometry;
215 * @param Geometry $geometry The object to serialize
220 public function write(Geometry $geometry, $returnAsArray = false)
223 ? $this->getArray($geometry)
224 : json_encode($this->getArray($geometry));
232 * If the root geometry is a GeometryCollection, and any of its geometries has data,
234 * If the root geometry has data, it will be included in a Feature object that contains the data
236 * The geometry should have geographical coordinates since CRS support has been removed from from geoJSON specification (RFC 7946)
237 * The geometry should'nt be measured, since geoJSON specification (RFC 7946) only supports the dimensional positions
239 * @param Geometry|GeometryCollection $geometry
240 * @param bool|null $isRoot Is geometry the root geometry?
243 public function getArray($geometry, $isRoot = true)
245 if ($geometry->geometryType() === Geometry::GEOMETRY_COLLECTION) {
248 foreach ($geometry->getComponents() as $component) {
261 foreach ($geometry->getComponents() as $i => $component) {
265 'geometry' => $components[$i],
275 if ($isRoot && $geometry->getData() !== null) {
278 'properties' => $geometry->getData(),
279 'geometry' => [
280 'type' => $geometry->geometryType(),
281 'coordinates' => $geometry->isEmpty() ? [] : $geometry->asArray()
286 'type' => $geometry->geometryType(),
287 'coordinates' => $geometry->isEmpty() ? [] : $geometry->asArray()