/**
  * Handle the converter that does the actual work.
  *
  * @param $northing
  * @param $easting
  *
  * @return array
  */
 public static function lat_lon($northing, $easting)
 {
     // todo: evaluate accuracy of the results returned.
     // We might later drop in another class do the actual translation.
     $lat_lon_converter = new OSRef($easting, $northing);
     $latlng = $lat_lon_converter->toLatLng();
     $result = array('latitude' => $latlng->lat, 'longitude' => $latlng->lng);
     return $result;
 }
Example #2
0
 private function stopPointFromTimetable($timetableStopPoint)
 {
     $atcoCode = (string) $timetableStopPoint->AtcoCode;
     $commonName = (string) $timetableStopPoint->Descriptor->CommonName;
     $osRef = new OSRef((int) $timetableStopPoint->Place->Location->Easting, (int) $timetableStopPoint->Place->Location->Northing);
     $latLng = $osRef->toLatLng();
     $latLng->OSGB36ToWGS84();
     $stopPoint = new \stdClass();
     $stopPoint->name = $commonName;
     $stopPoint->atcoCode = $atcoCode;
     $stopPoint->longitude = $latLng->lng;
     $stopPoint->latitude = $latLng->lat;
     return $stopPoint;
 }