Lines Matching refs:geometry

74      * Read WKB into geometry objects
90 throw new \Exception('Cannot read empty WKB geometry. Found ' . gettype($wkb));
95 $geometry = $this->getGeometry();
99 return $geometry;
145 $geometry = null;
148 $geometry = $this->getPoint();
151 $geometry = $this->getLineString();
154 $geometry = $this->getPolygon();
157 $geometry = $this->getMulti('Point');
160 $geometry = $this->getMulti('LineString');
163 $geometry = $this->getMulti('Polygon');
166 $geometry = $this->getMulti('Geometry');
174 if ($geometry && $SRID) {
175 $geometry->setSRID($SRID);
177 return $geometry;
267 * @param Geometry $geometry The geometry
273 public function write(Geometry $geometry, $writeAsHex = false, $bigEndian = false)
278 $wkb = $this->writeGeometry($geometry);
284 * @param Geometry $geometry
287 protected function writeGeometry($geometry)
289 $this->hasZ = $geometry->hasZ();
290 $this->hasM = $geometry->isMeasured();
293 $wkb .= $this->writeType($geometry);
294 switch ($geometry->geometryType()) {
296 /** @var Point $geometry */
297 $wkb .= $this->writePoint($geometry);
300 /** @var LineString $geometry */
301 $wkb .= $this->writeLineString($geometry);
304 /** @var Polygon $geometry */
305 $wkb .= $this->writePolygon($geometry);
308 /** @var MultiPoint $geometry */
309 $wkb .= $this->writeMulti($geometry);
312 /** @var MultiLineString $geometry */
313 $wkb .= $this->writeMulti($geometry);
316 /** @var MultiPolygon $geometry */
317 $wkb .= $this->writeMulti($geometry);
320 /** @var GeometryCollection $geometry */
321 $wkb .= $this->writeMulti($geometry);
382 * @param MultiPoint|MultiPolygon|MultiLineString|GeometryCollection $geometry
385 protected function writeMulti($geometry)
388 $wkb = $this->writer->writeUInt32($geometry->numGeometries());
391 foreach ($geometry->getComponents() as $component) {
399 * @param Geometry $geometry
403 protected function writeType($geometry, $writeSRID = false)
405 $type = self::$typeMap[$geometry->geometryType()];
413 if ($geometry->SRID() && $writeSRID) {
417 ($geometry->SRID() && $writeSRID ? $this->writer->writeUInt32($this->SRID) : '');