Esempio n. 1
0
 public function testLatLng()
 {
     $ITMRef = new ITMRef(715830, 734697);
     $LatLng = $ITMRef->toLatLng();
     $expected = "(53.34979, -6.26025)";
     self::assertEquals($expected, $LatLng->__toString());
 }
Esempio n. 2
0
 /**
  * Convert this LatLng object into an ITM grid reference
  *
  * @return ITMRef
  */
 public function toITMRef()
 {
     $this->toWGS84();
     $ITM = new ITMRef(0, 0);
     //dummy to get reference data
     $scale = $ITM->getScaleFactor();
     $N0 = $ITM->getOriginNorthing();
     $E0 = $ITM->getOriginEasting();
     $phi0 = $ITM->getOriginLatitude();
     $lambda0 = $ITM->getOriginLongitude();
     $coords = $this->toTransverseMercatorEastingNorthing($scale, $E0, $N0, $phi0, $lambda0);
     return new ITMRef(round($coords['E']), round($coords['N']), $this->h);
 }