geodesy icon indicating copy to clipboard operation
geodesy copied to clipboard

Swift conversion - os_tm_eas_nor_to_lat_lon giving the deprecated OSGB36 lat/lon

Open magnas35 opened this issue 4 years ago • 0 comments

Hi

I've managed to port some of your scripts to Swift and using the default values from your page: https://www.movable-type.co.uk/scripts/latlong-os-gridref.html#datum-conversions

I'm able to go from 52.657977° N, 001.716038° E to TG 51409 13177 and 651409, 313177

But when I try to go back from 651409, 313177 to (WGS84) lat/lon using os_tm_eas_nor_to_lat_lon(point: os_eas_nor, projection: OS_TM_NATIONAL_GRID) it returns the OSGB36 (deprecated) lat/lon 52.657568° N, 001.717908° E Returning the wrong version of the answer makes me believe that it's not a typo on my part, rather that I'm trying to implement something incorrectly.

My guess is that using projection: OS_TM_NATIONAL_GRID is returning, naturally enough, OSGB36, but I can't find an equivalent WGS84 projection. Am I missing something or trying to do the wrong thing with the wrong tools? I'm pulling my hair out trying to return to the original lat/lon.

The reason for conversion in the first place is wanting to perform trigonometry with multiple coordinates. Anyway, hope you can help.

magnas35 avatar Aug 24 '21 15:08 magnas35