views:

611

answers:

4

I need a .NET tool, preferably a library, that I can use in SSIS to convert Northing/Easting information from Collins Bartholomew (bartholomewmaps.com) into WGS84 with a ssrid of 4326 - to be used in SQL Server (Geography).

Edit: In response to an answer given, the script looks interesting; do you think it would be easy to create a c# class, methods that mimic this? We would need the Irish Grid Ellipse/Helmert parameters but this looks like a good starting point.

Has anyone converted this already?

+2  A: 

The OS have a free dll which you can wrap into a web service and call through clr routines.

u07ch
We cant use that, its 16bit DLL.
Coolcoder
There may be a web service for this on bing; but the maths isn't that complex; if this example works you could transcode it frmo javascript to sql fairly easilyhttp://www.movable-type.co.uk/scripts/latlong-convert-coords.html
u07ch
That script looks interesting; do you think it would be easy to create a c# class, methods that mimic this? We would need the Irish Grid Ellipse/Helmert parameters but this looks like a good starting point. Has anyone converted this already?
Coolcoder
It is a 32-bit ActiveX DLL, it is **not a 16-bit DLL**. It's accurate to 0.1 metres straight out of the box. Just use it!
MarkJ
Irish grid details are here http://www.osni.gov.uk/2.1_the_irish_grid.pdf
MarkJ
MarkJ; I contacted the suppliers of Grid InQuest and they no longer support this and are working on more commercial products. Their official reply was "We only offer a 16 bit version, we are unlikely to do any development on this in the near future as we are currently working on income generating projects."
Coolcoder
u07ch + MarkJ; I think I will need to convert the javascript routines to c# and then include the Irish grid info (looks like the details I need are in that link you sent - from page 20 onwards).
Coolcoder
I am accepting the answer from u07ch as it provided the link that eventually gives me the answer. Thank all for your help.
Coolcoder
A: 

Someone has written a c# class to convert WGS84 to OSGB36 and lat lon to NE, you can download it here I've checked it and it seems to work just fine.

--Whoops, you want to go the other way don't you?

Andrew Hancox
+1  A: 

You may try to use PROJ.4 library which implements in C language large number of projections and transformations. The library is accessible through GDAL/OGR API, namely OGRSpatialReference, and OGRCoordinateTransformation classes, for C++. I understand you are looking for .NET/C# API, so then you can use GDAL/OGR bindings for .NET. The C++ classes are provided as SpatialReference and CoordinateTransformation equivalents there. Here you can find example OSRTransform.cs written in C#.

See related question PROJ.4 library and OSGB36

mloskot
+1  A: 

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

Andrew Hancox
Thanks for sharing this, it looks good. I imagine you will be uploading the sourcecode in the near future so we can see the unit tests referred to on the front page? :)
Zeus
The code is there as part of the project, you can see the instructions for accessing it at:http://code.google.com/p/geocoordconversion/source/checkout
Andrew Hancox
Note for anyone passing: Whilst this library is excellent, it can't deal with WGS84 spheres, as used by, say, Google Maps. Only ellipsoids.
Rushyo
It's open source and I'm more than happy for others to contribute to the code. If you can get the relevant transforms out of wikipedia it should be easy to add new options.
Andrew Hancox