[gdal-dev] C# Nad27 to WGS 84

Tomas R monshi at home.se
Sun Jul 12 04:11:01 EDT 2009


Hi again,

New problems arises as the world of Gdal is quite complex to grasp.

Have understood that the transformation of coordinates from Nad 27 datum 
to WGS 84 requires some look up tables to be done correctly, tables that 
differ with the are the Nad 27 is valid in.

Simple question is, how to set up a general solution in C# that uses 
these shift tables.
I have in code a simple test:
           SpatialReference spatNad27 = new SpatialReference("");
            spatNad27.SetWellKnownGeogCS("Nad27");
            SpatialReference spatNad83 = new SpatialReference("");
            spatNad83.SetWellKnownGeogCS("Nad83");
           
            CoordinateTransformation trans = new 
CoordinateTransformation(spatNad27, spatNad83);
            double[] p = new double[3];
            trans.TransformPoint(p, -117, 30, 0);

that gives back
-117, 30,0000000008175
which I believe is not correct ( see http://proj.maptools.org/faq.html )

I have Proj4.dll, I have set an environment path to PROJ_LIB where the 
nad shift tables should exist. Must I do something else in the setup or 
is the call to the transform different? or have I done correctly but 
misinterpreted the results?

What I in reality is interested is transforming whatever coordinate in 
whatever projection/datum to and from WGS84 without any extra hassle 
fast and easy via the C# interface. That should not be to hard? Or?

Yours
Tomas



More information about the gdal-dev mailing list