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

Issues with 3857 to 25832 #37

Closed
mpallesen opened this issue Sep 22, 2018 · 1 comment
Closed

Issues with 3857 to 25832 #37

mpallesen opened this issue Sep 22, 2018 · 1 comment

Comments

@mpallesen
Copy link

mpallesen commented Sep 22, 2018

Hi

First off, good job with this port!

I'm having issues transforming my geometry from 25832 to 3857.

I have a point:
x = 702575 y = 6153153 in epsg:25832

When i try to convert to epsg:3857 with this wkt string:

PROJCS["WGS 84 / Pseudo-Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],
AUTHORITY["EPSG","3857"]]

I get x = 1358761 y = 7420836
which is about 36 km too much to the south..
I have tried different wkt strings found on the net, but i can't find one that works.

If i try epsg.io's transformer i get the expected results:
https://epsg.io/transform#s_srs=25832&t_srs=3857&x=702575.0000000&y=6153153.0000000

Also, my old native dll implementation of proj4.dll works as intenden.

Can you fix this issue or point me in the right direction to find a solution?

Thanks!
Michael Pallesen

@FObermaier
Copy link
Member

The issue is that the projection "Mercator_1SP" needs additional help to perform the correct conversion.
Out of the box, proj4 wouldn't compute the correct result either, that is why the Extension token is there.

Add [PARAMETER["semi_minor",6378137]] anywhere in the parameter block and you should be all set.
Or use ProjectedCoordinateSystem.WebMercator in the first place.

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

2 participants