Esempio n. 1
0
 /**
  * @dataProvider providerGeometryCollectionWKT
  *
  * @param string  $wkt        The expected WKT.
  * @param array   $coords     The GeometryCollection coordinates.
  * @param boolean $is3D       Whether the GeometryCollection has Z coordinates.
  * @param boolean $isMeasured Whether the GeometryCollection has M coordinates.
  */
 public function testWriteGeometryCollection($wkt, array $coords, $is3D, $isMeasured)
 {
     $writer = new WKTWriter();
     $writer->setPrettyPrint(false);
     $cs = new CoordinateSystem($is3D, $isMeasured);
     if ($coords) {
         $point = $this->createPoint($coords[0], $cs);
         $lineString = $this->createLineString($coords[1], $cs);
         $geometries = [$point, $lineString];
     } else {
         $geometries = [];
     }
     $geometryCollection = new GeometryCollection($cs, ...$geometries);
     $this->assertSame($wkt, $writer->write($geometryCollection));
 }