I have a fairly accurate formula (implemented in C#), which allows me to convert UK Eastings/Northings to WGS84 Latitudes and Longitudes. Despite extensive Google searches, I could not find a formula to perform the reverse transformation. Could anyone point me in the right direction (a JavaScript/C# example would be ideal)?
[GIS] Lat/Long -> UK Easting/Northing
ccoordinate systemjavascript
Related Solutions
Edit - Update with OSGB36 specific information.
Well, the good news is that the target projection is OSGB36, which is a well known and standardized projection. The bad news is that GIS programming is still really difficult :)
There are a set of parameters that need to be defined, and mathematical operations applied to those parameters, to succesfully project lat/long to grids. Fortunately, there are databases of parameters for the former, and libraries for the latter. proj.4
, which I mentioned earlier, is one of the standard libraries. There are also ports of proj.4
to other languages, including JavaScript, which is hopefully close enough to jScript for your purposes. The port is proj4js.
The other thing you need to know is the EPSG
number for your coordinate systems. OSGB36 is EPSG:6277. The EPSG is an oil-industry (I think) created body that collected lots of locally defined projections and documented them. The database is now openly maintained, and GIS libraries can use their definitions.
Previous info
Your easting/northing numbers may be in the British national grid system.
I gave an answer to another GIS related question that includes links to proj.4
, which is one of the standard libraries for converting between lat/long and easting/northing (the forward calculation is called projection
in the GIS world). I've never used it for the conversion you're looking for, but the software is well-documented and comes with conversion definitions for lots of projections.
WGS 1984 has had several "releases". I'm not sure whether or not to call them re-adjustments. WGS 1984 is loosely tied to the International Terrestrial Reference Frame (ITRF), maintained by IERS.
The first transformation, WGS_1984_(ITRF00)_To_NAD_1983, assumes that WGS 1984 is the one tied to ITRF00 and the NAD 1983 realization is CORS96 or similar. That version is also known as WGS 1984 (G1150). The current realization is WGS 1984 (G1674) which is related to ITRF08 instead. This transformation uses the non-time-related parameters from the NGS CORS website. They've since published a new transformation relating ITRF08 and NAD 1983 (2011), which Esri has as WGS_1984_(ITRF08)_To_NAD_1983_2011.
NGS has released, as beta, grid file-based transformations between "HARN" and NSRS2007, GEOCON, and between NSRS2007 and NAD 1983 (2011), GEOCON11. They do include Alaska. Esri has not incorporated them yet into the software. The GEOCON/GEOCON11 file format and interpolation method differs from previous NGS file formats and interpolation methods. Their beta version only accepts Blue Book-formatted data as well.
The 2nd transformation you list assumes WGS 1984 is ITRF96, so it's quite old compared to the other two. EPSG has either deprecated it, or lists the extent as excluding Alaska, but Esri has customers there using it which is why Esri lists it as covering Alaska too.
So for now, I"m not sure what to tell you. I think I would recommend WGS_1984_(ITRF00)_To_NAD_1983 as closest to NSRS2007.
Disclosure: I work for Esri.
Best Answer
There is a JavaScript from Convert between Latitude/Longitude & OS National Grid References which converts between easting/northings to lon/lat, which could be helpful.
It is also available in GitHub