Open consilience opened 10 years ago
Other JS libraries from the same author port easily into PHP, so this should not be too difficult. We have a lat/long polar object, a OSGB national grid square, and we will probably also need to create a lat/long cartesian object too.
The main one is OSGB to and from WGS84. However, between any two datums would be good.
A JS implementation can be found here:
http://www.movable-type.co.uk/scripts/latlong-convert-coords.html
The rule is generally:
So we are shifting to Cartesian space, transforming (which is easy) in that Cartesian space, then shifting back to polar space.
The example JS library will only convert between WGS84 and any of the other datums. That means WGS84 must always be either the source datum, the destination datum, or a mid-way hop between two other datums.