CoordinateSystemFactory.CreateFromWk throws Expecting ('PROJECTION') but got a 'UNIT'... exception

Topics: SharpMap v0.9 / v1.x
Jan 20, 2012 at 11:19 AM

I try to create a projected coordinate system from wit:

string wkt = "PROJCS[\"HD72 / EOV\",GEOGCS[\"HD72\",DATUM[\"Hungarian_Datum_1972\",SPHEROID[\"GRS 1967\",6378160,298.247167427,AUTHORITY[\"EPSG\",\"7036\"]],AUTHORITY[\"EPSG\",\"6237\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4237\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Hotine_Oblique_Mercator\"],PARAMETER[\"latitude_of_center\",47.14439372222222],PARAMETER[\"longitude_of_center\",19.04857177777778],PARAMETER[\"azimuth\",90],PARAMETER[\"rectified_grid_angle\",90],PARAMETER[\"scale_factor\",0.99993],PARAMETER[\"false_easting\",650000],PARAMETER[\"false_northing\",200000],AUTHORITY[\"EPSG\",\"23700\"],AXIS[\"Y\",EAST],AXIS[\"X\",NORTH]]";CoordinateSystemFactory pCoordinateSystemFactory = new CoordinateSystemFactory();

 ICoordinateSystem iCoordSys = pCoordinateSystemFactory.CreateFromWkt(wkt);

ProjectedCoordinateSystem eov = (ProjectedCoordinateSystem)iCoordSys;

WKT  is copied from here: http://spatialreference.org/ref/epsg/23700/ from OGC WKT section.

When running I get the following exception: + $exception {"Expecting ('PROJECTION') but got a 'UNIT' at line 1 column 295."} System.Exception {System.ArgumentException}

What is the problem with this wit?

Thanks in advance!


Jan 20, 2012 at 3:14 PM

I could solve this. Now I use WKT coming from an ESRI pro file instead of the one found on spatialreference.org.

Thanks!