Exemple #1
0
 /**
  * @param int|null $srid
  */
 public function __construct($srid = null)
 {
     if (null === $srid) {
         $srid = Configuration::getDefaultSrid();
     }
     $this->setSrid($srid);
 }
Exemple #2
0
 /**
  * @return int|float
  */
 public function getLongitude()
 {
     if (Configuration::getOrder() === Configuration::ORDER_LON_FIRST) {
         return $this->getX();
     }
     return $this->getY();
 }
Exemple #3
0
 /**
  * testLatitudeFirstSet
  *
  * Test order when set via setLongitude/Latitude
  *
  * @param string $value
  * @param array  $expected
  *
  * @dataProvider pointDataSource
  */
 public function testLatitudeFirstSet($value, array $expected)
 {
     Configuration::setOrder(Configuration::ORDER_LAT_FIRST);
     $point = new Point();
     $point->setLongitude($value)->setLatitude($value);
     $this->assertEquals($expected, $point->toArray());
     $this->assertEquals($expected[0], $point->getX());
     $this->assertEquals($expected[1], $point->getLongitude());
     $this->assertEquals($expected[1], $point->getY());
     $this->assertEquals($expected[0], $point->getLatitude());
 }