/** * {@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(); }
/** * @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)); }