2
Vote

Error parsing ESPG:3785 WKT

description

When parsing the WKT for ESP:3785 the following exception is thrown:
 
System.ArgumentException: "Expecting ('PROJECTION') but got a 'UNIT' at line 1 column 380."
 
The text that im trying to parse:
 
Wkt = "PROJCS[\"Popular Visualisation CRS / Mercator\"," +
                    "GEOGCS[\"Popular Visualisation CRS\"," +
                        "DATUM[\"Popular_Visualisation_Datum\"," +
                            "SPHEROID[\"Popular Visualisation Sphere\",6378137,0," +
                                "AUTHORITY[\"EPSG\",\"7059\"]]," +
                            "TOWGS84[0,0,0,0,0,0,0]," +
                            "AUTHORITY[\"EPSG\",\"6055\"]]," +
                        "PRIMEM[\"Greenwich\",0," +
                            "AUTHORITY[\"EPSG\",\"8901\"]]," +
                        "UNIT[\"degree\",0.01745329251994328," +
                            "AUTHORITY[\"EPSG\",\"9122\"]]," +
                        "AUTHORITY[\"EPSG\",\"4055\"]]," +
                    "UNIT[\"metre\",1," +
                        "AUTHORITY[\"EPSG\",\"9001\"]]," +
                    "PROJECTION[\"Mercator_1SP\"]," +
                    "PARAMETER[\"central_meridian\",0]," +
                    "PARAMETER[\"scale_factor\",1]," +
                    "PARAMETER[\"false_easting\",0]," +
                    "PARAMETER[\"false_northing\",0]," +
                    "AUTHORITY[\"EPSG\",\"3785\"]," +
                    "AXIS[\"X\",EAST]," +
                    "AXIS[\"Y\",NORTH]]";

comments

trieuvy wrote Sep 21, 2011 at 7:31 AM

wkt string miss unit param. Try:
string wkt = "PROJCS[\"Popular Visualisation CRS / Mercator\", " +
               "GEOGCS[\"Popular Visualisation CRS\", " +
                  "DATUM[\"Popular Visualisation Datum\", " +
                     "SPHEROID[\"Popular Visualisation Sphere\", 6378137, 0, AUTHORITY[\"EPSG\",\"7059\"]], " +
                     "TOWGS84[0, 0, 0, 0, 0, 0, 0], AUTHORITY[\"EPSG\",\"6055\"] " +
                  "]," +
                  "PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\", \"8901\"]], " +
                  "UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\", \"9102\"]], " +
                  "AXIS[\"E\", EAST], " +
                  "AXIS[\"N\", NORTH], " +
                  "AUTHORITY[\"EPSG\",\"4055\"]" +
               "], " +
               "PROJECTION[\"Mercator\"], " +
               "PARAMETER[\"False_Easting\", 0], " +
               "PARAMETER[\"False_Northing\", 0], " +
               "PARAMETER[\"Central_Meridian\", 0], " +
               "PARAMETER[\"Latitude_of_origin\", 0], " +
               "UNIT[\"metre\", 1, AUTHORITY[\"EPSG\", \"9001\"]], " +
               "AXIS[\"East\", EAST], " +
               "AXIS[\"North\", NORTH], " +
               "AUTHORITY[\"EPSG\",\"3785\"] " +
            "]  ";

wrote Apr 13, 2012 at 7:13 PM

wrote Feb 21, 2013 at 11:06 PM