コード例 #1
0
ファイル: PointProxy.php プロジェクト: brick/geo
 /**
  * {@inheritdoc}
  */
 public function isEmpty()
 {
     if ($this->proxyGeometry === null) {
         $this->load();
     }
     return $this->proxyGeometry->isEmpty();
 }
コード例 #2
0
ファイル: PointTest.php プロジェクト: brick/geo
 /**
  * @param Point   $point
  * @param boolean $is3D
  * @param boolean $isMeasured
  * @param integer $srid
  */
 private function assertPointEmptyFactoryMethod(Point $point, $is3D, $isMeasured, $srid)
 {
     $this->assertTrue($point->isEmpty());
     $this->assertNull($point->x());
     $this->assertNull($point->y());
     $this->assertNull($point->z());
     $this->assertNull($point->m());
     $this->assertSame($is3D, $point->is3D());
     $this->assertSame($isMeasured, $point->isMeasured());
     $this->assertSame($srid, $point->SRID());
 }
コード例 #3
0
ファイル: AbstractWKBWriter.php プロジェクト: brick/geo
 /**
  * @param Point $point
  *
  * @return string
  *
  * @throws GeometryIOException
  */
 private function packPoint(Point $point)
 {
     if ($point->isEmpty()) {
         throw new GeometryIOException('Empty points have no WKB representation.');
     }
     $binary = $this->packDouble($point->x()) . $this->packDouble($point->y());
     if (null !== ($z = $point->z())) {
         $binary .= $this->packDouble($z);
     }
     if (null !== ($m = $point->m())) {
         $binary .= $this->packDouble($m);
     }
     return $binary;
 }