コード例 #1
0
ファイル: Geometry.php プロジェクト: brick/geo
 /**
  * Returns the WKT representation of this geometry.
  *
  * @noproxy
  *
  * @return string
  */
 public function asText()
 {
     static $wktWriter;
     if ($wktWriter === null) {
         $wktWriter = new WKTWriter();
     }
     return $wktWriter->write($this);
 }
コード例 #2
0
ファイル: WKTWriterTest.php プロジェクト: brick/geo
 /**
  * @dataProvider providerWriteEmptyGeometryCollection
  *
  * @param string $wkt The WKT to test.
  */
 public function testWriteEmptyGeometryCollection($wkt)
 {
     $writer = new WKTWriter();
     $geometry = GeometryCollection::fromText($wkt);
     $this->assertSame($wkt, $writer->write($geometry));
 }