Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm developing a web application that uses ESRI 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

GIS isn't really my area, I've spent a few days on this and it's really wearing me down. Any help would be very much appreciated.

share|improve this question
    
You might be better off re-projecting your source data to WGS84 (in a another database instance) - have done this in the past - which OS datasets are you using? –  Mapperz Feb 17 '12 at 15:08
    
@Mapperz I'm happy to re-project in the database - is this possible using the built in SQL Server 2008 spatial tools? –  Peter Bridger Feb 22 '12 at 12:09

2 Answers 2

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.

share|improve this answer

First, be aware that ESRI offer support for two web mercator projections:

  1. 'WGS 1984 Web Mercator' (102113), which is equivalent to 3785.
  2. 'WGS 1984 Web Mercator Auxiliary Sphere' (102100), which is equivalent to 3857.

(EPSG:3857 is the up-to-date code for Google's EPSG:900913.)

Since you have ESRI ArcGIS the process should be a single transformation (not two) and you don't need an additional library.

ArcToolBox -> Data Management Tools -> Projections and Transformations -> Feature -> Project

... then select you data (input coordinate system should be detected as OSGB) and set your output coordinate system to Projected Coordinate Systems -> World -> WGS 1984 Web Mercator (Auxiliary Sphere)

...and the job is done (there is also a bulk re-projection tool too). Alternatively if you want a handy toolkit and if you don't want to use ESRI try OGR2OGR.

share|improve this answer
    
Thanks @sylvester-sneekly - however I don't have access to the ERSI desktop tools, I'm doing all my work using their simple JavaScript mapping tool which is mostly used for the presentation of the data –  Peter Bridger Feb 22 '12 at 12:10
    
You could try GDAL/OGR - it's free –  MappaGnosis Feb 22 '12 at 17:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.