[GIS] DotSpatial problems with reprojecting shapefiles

cdotspatialwgs84

I have a shapefile with this projection:

PROJCS["RD_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199432955]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",155000],PARAMETER["False_Northing",463000],PARAMETER["Central_Meridian",5.38763888888889],PARAMETER["Scale_Factor",0.9999079],PARAMETER["Latitude_Of_Origin",52.15616055555555],UNIT["Meter",1]]

Now I want to reproject the shapefile to lat/lng coordinates.

I tried:

Shapefile tmpShape = Shapefile.OpenFile(file);    
tmpShape.Reproject(KnownCoordinateSystems.Geographic.World.WGS1984);

The lat/lng area of the shapefile should be something like 52,…/4,… .
But after reprojecting the file with DotSpatial, I got something like -37,…/23,…

What did I do wrong?

Best Answer

Given an Esri coordinate reference system prj file (well-known text aka WKT), for RD New, DotSpatial is able to map it to a PROJ.4 string. RD New has an EPSG well-known ID of 28992.

DotSpatial includes a +towgs84 parameter which is not part of the original wkt:

+towgs84=565.2369,50.0087,465.658,-83920.3484091603,72343.8075715773,-385786.840‌​69442,3081200

The values are supposed to be for a Position Vector-based 7 parameter datum transformation where the seven values are:

x axis translation (meters) 
y axis translation (meters) 
z axis translation (meters) 
x axis rotation (arc-seconds) 
y axis rotation (arc-seconds) 
z axis rotation (arc-seconds) 
scale difference (parts per million)

The original definition in the EPSG dataset gives the rotations in micro-radians. I wondered how on earth they managed to get such large rotation values. If I convert the original micro-radian value of the x axis rotation, 1.9725, to arc-seconds, I get:

0.40685733

If I then treat this value as radians, I get:

83920.34841 = 0.40685733 * (180.0 / PI) * 3600

I can sort of see what they did to the scale difference value, but haven't worked out the math. The original value is 4.0812 ppm. Multiply that by 1000000 and you get 4081200, then they subtracted a million.

Related Question