-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversion from 4326 to 3857: Y coordinate wrong #40
Comments
Instead of instantiating 3857 from WKT, try using ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WebMercator; |
Perfect, thank you! I am now getting the correct Y values. |
Actually, despite getting the correct Y values, I still get an incorrect distance when I use Point.Distance. It's coming out to 421.76km now. Did I miss something else? |
Nevermind, this all moot. I can just use the GeoCoordinate and GetDistanceTo functions. |
I understand you've made a distinction that WKT is not intended for 3857 because it assume a spherical earth. And yet epsg.io/3857.wkt does exist as does ProjectedCoordinateSystem.WebMercator.WKT. Why is it that ProjNet cannot read this epsg.io version?
From https://alastaira.wordpress.com/2011/01/23/the-google-maps-bing-maps-spherical-mercator-projection/ it seems proj.4 solved it by introducing "nadgrids". Maybe you can read the EXTENSION data from the epsg version since it has the "nadgrids"? |
I think the nadgrids hack forced the semi-minor axis to be read from EXTENSION data. Also seems that only 3857 and deprecated 3785 use extension data, so little benefit implementing EXTENSION data for single coordinate reference system.
With:
|
Duplicate of #37 |
I'm trying convert GPS coordinates to the Pseudo-Mercator system (because it works worldwide) and the Y coordinate is always off; the X coordinate matches all of the calculators I've tried.
If I use the calculator on https://epsg.io, the X value is correct but the Y value is off:
https://epsg.io/transform#s_srs=4326&t_srs=3857&x=-86.0708850&y=39.5215190
https://epsg.io/transform#s_srs=4326&t_srs=3857&x=-88.0258210&y=41.9796280
This changes the distance between these two points from the correct value of 318.99km to 420.57km, a pretty substantial difference. Any ideas about why the calculation is off by so much?
The text was updated successfully, but these errors were encountered: