Help Needed: Coordinate Transform from State Plane NAD 1927 to WGS 84

Topics: Algorithms, SharpMap Project, SharpMap v0.9 / v1.x
Mar 26, 2010 at 10:57 PM


I recently suffered a prblem in transforming a data source with US State Plane NAD 1927 projected coordinate system (Michigan South in Feet, FIPS 2113) to WGS-84

I am using the funection within SharpMap v 0.9 to do the "transform-on-fly", the problem is the converting result was always wrong, in comparison with the correct one obtained from ArcView tools

The following is my code in c#, a very simple function

public SharpMap.Geometries.Point NAD27toWGS84e(double x, double y)
            string strNAD27 = "PROJCS[\"NAD_1927_StatePlane_Michigan_South_FIPS_2113\",GEOGCS[\"GCS_North_American_1927\",DATUM[\"D_North_American_1927\",SPHEROID[\"Clarke_1866\",6378206.4,294.9786982]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Lambert_Conformal_Conic\"],PARAMETER[\"False_Easting\",2000000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-84.33333333333333],PARAMETER[\"Standard_Parallel_1\",42.1],PARAMETER[\"Standard_Parallel_2\",43.66666666666666],PARAMETER[\"Latitude_Of_Origin\",41.5],UNIT[\"Foot_US\",0.3048006096012192]]";

            string strWGS84 = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]";

            IProjectedCoordinateSystem sCin = CoordinateSystemWktReader.Parse(strNAD27) as IProjectedCoordinateSystem;
            IGeographicCoordinateSystem sCout = CoordinateSystemWktReader.Parse(strWGS84) as IGeographicCoordinateSystem;

            CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory();

            ICoordinateTransformation cTran = ctFac.CreateFromCoordinateSystems(sCin, sCout);

            SharpMap.Geometries.Point fromPoint = new SharpMap.Geometries.Point ( x, y );

            SharpMap.Geometries.Point toPoint = cTran.MathTransform.Transform(fromPoint);

            return toPoint;

For example:

Input (X/Y in Feet): 2252168/268916

Output (Longitude/latitude): -81.1953994071208 / 43.8784454668397 ------------NOT CORRECT

Comparison from ArcView (Longitude/latitude): -83.66/42.23

Doe anyone can help find out what I was wrong at?

Thanks and appreciate youe helps






Mar 29, 2010 at 7:57 AM

Hello kycoder,

reprojection in SharpMap v0.9 is done with the help of Proj.Net. There is a newer version of Proj.Net available on its webpage, have you tried that? (Involves namespace changes on SharpMap side).

Hth FObermaier

Apr 1, 2010 at 5:24 PM

i have make a try with that convert fonction and i alway have this exeption


L'exception System.Exception n'a pas été gérée
  Message="Only 2 dimensions are supported for points"
       à SharpMap.Geometries.Point..ctor(Double[] point) dans C:\Documents and Settings\Pier\Bureau\shapefile\SharpMap_Source\Trunk\SharpMap\Geometries\Point.cs:ligne 61
       à testCarto.Form1.NAD83toWGS84(Double x, Double y) dans C:\Cauca_Dev\testCarto\testCarto\Form1.cs:ligne 921