Example #1
0
 /**
  * {@inheritdoc}
  */
 public function coordinateSystem()
 {
     if ($this->proxyGeometry === null) {
         $this->load();
     }
     return $this->proxyGeometry->coordinateSystem();
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 function load(ObjectManager $manager)
 {
     $point1 = Point::xy(0, 0);
     $point2 = Point::xy(1, 0);
     $point3 = Point::xy(1, 1);
     $lineString1 = LineString::of($point1, $point2, $point3);
     $point4 = Point::xy(2, 2);
     $point5 = Point::xy(3, 2);
     $point6 = Point::xy(3, 3);
     $lineString2 = LineString::of($point4, $point5, $point6);
     $multilineString1 = new MultiLineStringEntity();
     $multilineString1->setMultiLineString(MultiLineString::of($lineString1, $lineString2));
     $manager->persist($multilineString1);
     $manager->flush();
 }
Example #3
0
 /**
  * @dataProvider providerPrettyPrint
  *
  * @param boolean $is3D        Whether to use Z coordinates.
  * @param boolean $prettyPrint Whether to set the prettyPrint parameter.
  * @param string  $wkt         The expected result WKT.
  */
 public function testPrettyPrint($is3D, $prettyPrint, $wkt)
 {
     $writer = new WKTWriter();
     $writer->setPrettyPrint($prettyPrint);
     $cs = new CoordinateSystem($is3D, false);
     $one = $is3D ? [1, 2, 3] : [1, 2];
     $two = $is3D ? [2, 3, 4] : [2, 3];
     $four = $is3D ? [4, 5, 6] : [4, 5];
     $five = $is3D ? [5, 6, 7] : [5, 6];
     $point = $this->createPoint($one, $cs);
     $lineString1 = $this->createLineString([$one, $four], $cs);
     $lineString2 = $this->createLineString([$two, $five], $cs);
     $multiLineString = MultiLineString::of($lineString1, $lineString2);
     $geometryCollection = GeometryCollection::of($point, $multiLineString);
     $this->assertSame($wkt, $writer->write($geometryCollection));
 }
Example #4
0
 /**
  * @param array           $coords          The expected coordinates of the MultiLineString as returned by toArray().
  * @param boolean         $is3D            Whether the MultiLineString is expected to contain Z coordinates.
  * @param boolean         $isMeasured      Whether the MultiLineString is expected to contain M coordinates.
  * @param MultiLineString $multiLineString The MultiLineString to test.
  */
 protected final function assertMultiLineStringEquals(array $coords, $is3D, $isMeasured, MultiLineString $multiLineString)
 {
     $this->castToFloat($coords);
     $this->assertSame($coords, $multiLineString->toArray());
     $this->assertSame($is3D, $multiLineString->is3D());
     $this->assertSame($isMeasured, $multiLineString->isMeasured());
 }