Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection Mercator_Auxiliary_Sphere is not supported. #125

Open
KubaSzostak opened this issue Sep 25, 2024 · 0 comments
Open

Projection Mercator_Auxiliary_Sphere is not supported. #125

KubaSzostak opened this issue Sep 25, 2024 · 0 comments

Comments

@KubaSzostak
Copy link
Member

It looks like the Web Mercator projection is not available in the ProjectionsRegistry.TypeRegistry dictionary. For example, following code throws "Projection Mercator_Auxiliary_Sphere is not supported." exception.

public static void CheckProjection_Mercator_Auxiliary_Sphere ()
{
    // Shapefile projection created in ArcGISPro
    var projection = "PROJCS[\"WGS_1984_Web_Mercator_Auxiliary_Sphere\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Mercator_Auxiliary_Sphere\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Standard_Parallel_1\",0.0],PARAMETER[\"Auxiliary_Sphere_Type\",0.0],UNIT[\"Meter\",1.0]]";
    var csFactory = new CoordinateSystemFactory();
    var sourceCs = csFactory.CreateFromWkt(projection);
    var targetCs = GeographicCoordinateSystem.WGS84;
    var targetCsEnvelope = GetWgs84Envelope();

    var transformationFactory = new CoordinateTransformationFactory();
    var transformation = transformationFactory.CreateFromCoordinateSystems(sourceCs, targetCs); // System.NotSupportedException : Projection Mercator_Auxiliary_Sphere is not supported.

    var sourceCoords = new double[] { 2063341, 7268244 };
    var tergetCoords = transformation.MathTransform.Transform(sourceCoords);
}

Is there a way to support the use of Mercator_Auxiliary_Sphere projection within ProjNet4GeoAPI library? If so, any guidance on implementation would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant