예제 #1
0
 function testWriteToDatabase()
 {
     $obj = new GeoPolygonTest_Obj();
     $obj->Polygon = GeoPolygon::from_rings(array($this->outerRingArr, $this->innerRingArr));
     $obj->write();
     // Test that the geo-data was saved properly
     $this->assertEquals($this->testWKTString, DB::query("SELECT AsText(Polygon) FROM GeoPolygonTest_Obj WHERE ID = {$obj->ID}")->value());
 }
예제 #2
0
 /**
  * @param array $rings see {@link setAsRings()}
  */
 public static function from_rings($rings)
 {
     $obj = new GeoPolygon(null);
     $obj->setAsRings($rings);
     return $obj;
 }