public function project(FOX_geometry $point, $normalized = null) { if ($this->geos()) { return $this->geos()->project($point->geos(), $normalized); } }
/** * Serialize geometries into a WKT string. * * @param Geometry $geometry * * @return string The WKT string representation of the input geometries */ public function write(FOX_geometry $geometry) { // If geos is installed, then we take a shortcut and let it write the WKT if (FOX_geo::geosInstalled()) { $writer = new GEOSWKTWriter(); $writer->setTrim(true); return $writer->write($geometry->geos()); } if ($geometry->isEmpty()) { return strtoupper($geometry->geometryType()) . ' EMPTY'; } else { $data = $this->extractData($geometry); if ($data) { return strtoupper($geometry->geometryType()) . ' (' . $data . ')'; } else { return null; } } }