WKT for SRID:900913 from SpatialRefSys.xml is obsolete

Developer
May 8, 2014 at 9:49 AM
This is the WKT for SRID:900913 as found in SpatialRefSys.xml:
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]]
this leads to exceptions tryng to create transformations:
        [Test]
        public void WebMercatorCanBeTranformed()
        {
            var wkt = SharpMap.Converters.WellKnownText.SpatialReference.SridToWkt(900913);

            var csf = new CoordinateSystemFactory();
            var cs = csf.CreateFromWkt(wkt);
            
            var ctf = new CoordinateTransformationFactory();
            Assert.DoesNotThrow(() => ctf.CreateFromCoordinateSystems(cs, GeographicCoordinateSystem.WGS84));
        }
it says the parameters latitude_of_origin and latitude_of_center are missing... anyway EPSG:3785 is obsolete, the id for the WebMercator is EPSG:3857 as correctly done on ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator.WKT, I have also found this WKT for that ID:
PROJCS["Google Mercator",
    GEOGCS["WGS 84",
        DATUM["World Geodetic System 1984",
            SPHEROID["WGS 84",6378137.0,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0.0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.017453292519943295],
        AXIS["Geodetic latitude",NORTH],
        AXIS["Geodetic longitude",EAST],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["mercator_1sp",
        AUTHORITY["EPSG","9804"]],
    PARAMETER["semi_major",6378137.0],
    PARAMETER["semi_minor",6378137.0],
    PARAMETER["latitude_of_origin",0.0],
    PARAMETER["central_meridian",0.0],
    PARAMETER["scale_factor",1.0],
    PARAMETER["false_easting",0.0],
    PARAMETER["false_northing",0.0],
    UNIT["m",1.0],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","900913"]]
Probably the SpatialRefSys file should be manually updated to include this last form.
Developer
May 8, 2014 at 10:00 AM
I just found out that EPSG:900913 is not listed into the official db (http://www.epsg-registry.org/), so maybe is more correct to refer the WKT of 3857 into the file
Coordinator
May 8, 2014 at 4:26 PM
I'd leave EPSG:3875, EPSG:3857 and EPSG:90013 in the xml file, but all should have the same (correct) definition.
In order to get the projection results correct, I think you need to change
PROJECTION["mercator_1sp",
    AUTHORITY["EPSG","9804"]]
to
PROJECTION["Pseudo-Mercator",
    AUTHORITY["EPSG","3856"]]
Developer
May 9, 2014 at 8:47 AM
Changing the projection doesn't help, the CTS still throws exception for the need of those two parameters mentioned earlier.
Developer
May 12, 2014 at 12:57 PM
The problem is solved by adding the latitude_of_origin parameter to both 900913 and 3857.