/** * {@inheritdoc} */ public function coordinateSystem() { if ($this->proxyGeometry === null) { $this->load(); } return $this->proxyGeometry->coordinateSystem(); }
/** * {@inheritdoc} */ function load(ObjectManager $manager) { $point1 = Point::xy(0, 0); $point2 = Point::xy(1, 0); $point3 = Point::xy(1, 1); $point4 = Point::xy(0, 1); $point5 = Point::xy(0, 0); $ring1 = LineString::of($point1, $point2, $point3, $point4, $point5); $poly1 = Polygon::of($ring1); $point6 = Point::xy(2, 2); $point7 = Point::xy(3, 2); $point8 = Point::xy(3, 3); $point9 = Point::xy(2, 3); $point10 = Point::xy(2, 2); $ring2 = LineString::of($point6, $point7, $point8, $point9, $point10); $poly2 = Polygon::of($ring2); $multiPoly1 = new MultiPolygonEntity(); $multiPoly1->setMultiPolygon(MultiPolygon::of($poly1, $poly2)); $manager->persist($multiPoly1); $manager->flush(); }
/** * @param array $coords The expected coordinates of the MultiPolygon as returned by toArray(). * @param boolean $is3D Whether the MultiPolygon is expected to contain Z coordinates. * @param boolean $isMeasured Whether the MultiPolygon is expected to contain M coordinates. * @param MultiPolygon $multiPolygon The MultiPolygon to test. */ protected final function assertMultiPolygonEquals(array $coords, $is3D, $isMeasured, MultiPolygon $multiPolygon) { $this->castToFloat($coords); $this->assertSame($coords, $multiPolygon->toArray()); $this->assertSame($is3D, $multiPolygon->is3D()); $this->assertSame($isMeasured, $multiPolygon->isMeasured()); }