views:

943

answers:

4

I want to convert British OSGB 36 co-ordinates to WGS 84 (i.e. "standard" latitude and longitude), in order to plot them into a KML file for Google Earth.

What would be the best way to go about this? I'm implementing in VB .NET.

I should probably add that my question is not "How do I write a KML file?". My question is "How do I convert between these 2 co-ordinate systems?"!!

I was hoping there would be a library that I could use, rather than rolling my own function - it seems like the sort of thing some-one else would have implemented.

+1  A: 

You need to implement a Helmert transformation. I wrote a conversion in Javascript which you may be able to adapt. The algorithm used by the script for WGS84-OSGB36 conversions is derived from an OSGB spreadsheet with permission. Conversion accuracy is in the order of 7m for 90% of Great Britain, and should be be similar to the conversion made by a typical GPS reciever.

See the documentation and source for more details.

Edit: you might like to check out this OCX which includes source.

Paul Dixon
Thanks for your input. I was hoping to find a library, but looks like I'll have to roll my own :-( Just looking for a javascript converter now!!
RB
+1  A: 

First, according to this page linked from OSGB 36:

Myth 4: ‘There are exact mathematical formulae to change between coordinate systems’

Second, following from the same link: "From one coordinate system to another : geodetic transformations" includes a section "Approximate WGS84 to OSGB36/ODN transformation"

EDIT: Note, when OS says "approximate", they mean with errors >5m.

Richard
A: 

We use proj.4 library for WGS84 <-> OSGB36 <-> OSGBGRID coordinate transformations and it works very well. But we use C++ so I don't know if you can get it to work under VB.NET. There may be wrappers or something? (On the link above it mentions PROJ.4 VB Wrappers).

luapyad
A: 

The company I work for have just open sourced a library to do exactly this: http://code.google.com/p/geocoordconversion/

Andrew Hancox