[GIS] Converting from British National Grid (27700) to WGS84 (4326) to Web Mercator (102100)

arcgis-javascript-apicoordinate systemdatumwgs84

I'm developing a web application that uses ArcGIS to display a map using JavaScript.

We are holding all our data in MS SQL Server 2008 as Easting/Northing against the British National Grid. Unfortunately ESRI needs the data plotted to Web Mercator.

So I've ended up using Proj.Net for the British National Grid (27700) to WGS84 (4326) conversion

Then for the WGS84 (4326) to Web Mercator (102100) conversion I used the code in this article.

This gives me usable data within ESRI, however plotted points aren't quite in the right place. It seem that I'm suffering from the shift because the datum hasn't been changed. This post suggests that Proj.Net can correct the datum shift by specifying the TOWGS84 parameter, but I don't understand what this means.

I'd prefer a C# library or code that got from British National Grid to Web Mercator in one quick, simple conversion. However if I need to jump through hoops, I'll do that, but could do with some extra guidance

Best Answer

If your starting datum is OSGB 1936 (EPSG:27700) I don't think you'll be able to use Proj.Net for your conversion. Looking at other people's code on the Discussions page, it looks like Proj.Net is just applying a simple datum shift based on the "TOWGS84" parameter. This parameter is set in the Well Known Text (WKT) of your starting datum. A "TOWGS84" parameter will exist in the WKT only if you can do a simple transformation from your starting datum to WGS84.

Getting from OSGB1936 -> WGS84 is a two-step process where you have to convert OSGB1936 to ETRS89, then from ETRS89 to WGS84. (see EPSG:1681)

You would think you should be able to take the British National Grid, manipulate the XYs by some value, and get the Web Mercator XYs, but the math just isn't that simple.

Related Question