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

Fixes for webmerc projection (fixes #1078) #1095

Merged
merged 1 commit into from Aug 21, 2018
Merged

Conversation

@rouault
Copy link
Member

@rouault rouault commented Aug 20, 2018

This is intended to supersed #1080
with a number of differences.

What is kept from #1080 is not forcing the ellipsoid_params to be the one
of a sphere. This is not required for correct coordinate computation and
avoid lying on the various distorsion parameters.

For better interoperability with EPSG, we also no longer force the
lam0 parameter to 0, because
https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1024
has a provision for it, even if in practice they will always be zero
phi0 should always be zero and is not used by the formulas.

Another difference with the #1080 approach is that we do not force the
WGS84 ellipsoid. Perhaps someone will use webmerc for another planet,
even if that is a crazy idea...

This is intended to supersed #1080
with a number of differences.

What is kept from #1080 is not forcing the ellipsoid_params to be the one
of a sphere. This is not required for correct coordinate computation and
avoid lying on the various distorsion parameters.

For better interoperability with EPSG, we also no longer force the
lam0 parameter to 0, because
https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::1024
has a provision for it, even if in practice they will always be zero
phi0 should always be zero and is not used by the formulas.

Another difference with the #1080 approach is that we do not force the
WGS84 ellipsoid. Perhaps someone will use webmerc for another planet,
even if that is a crazy idea...
@rouault rouault force-pushed the rouault:webmerc_fixes branch from 3210dcf to 589a540 Aug 20, 2018
@kbevers
Copy link
Member

@kbevers kbevers commented Aug 20, 2018

Disclaimer: I haven't looked too closely at the code.

Does this solve the original issue with errornoues projection factors as reported in #1078?

@rouault
Copy link
Member Author

@rouault rouault commented Aug 20, 2018

Does this solve the original issue with errornoues projection factors as reported in #1078?

yes. I've checked that the values proj -v now outputs for the Meridian scale, Parallel Scale and Angular Distorsion are the ones given by EPSG Guidance 7.2 page 44 for the test point they give

$ ./src/proj +proj=webmerc +ellps=WGS84 -V
#Web Mercator / Pseudo Mercator
#	Cyl, Ell
#	
# +proj=webmerc +ellps=WGS84
#Final Earth figure: ellipsoid
#  Major axis (a): 6378137.000
#  1/flattening: 298.257224
#  squared eccentricity: 0.006694379990
-100.33333332372804 24.381786961614658
Longitude: 100d20'W [ -100.33333332 ]
Latitude:  24d22'54.433"N [ 24.381786962 ]
Easting (x):   -11169055.58
Northing (y):  2800000.01
Meridian scale (h) : 1.10342637  ( 10.34 % error )
Parallel scale (k) : 1.09729143  ( 9.729 % error )
Areal scale (s):     1.21078030  ( 21.08 % error )
Angular distortion (w): 0.319
Meridian/Parallel angle: 90.00000
Convergence : 0d [ -0.00000000 ]
Max-min (Tissot axis a-b) scale error: 1.10343 1.09729
@kbevers
Copy link
Member

@kbevers kbevers commented Aug 20, 2018

Awesome! I am happy with this PR.

@kbevers kbevers added this to the 5.2.0 milestone Aug 20, 2018
@rouault rouault merged commit 6680dff into OSGeo:master Aug 21, 2018
4 checks passed
4 checks passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.007%) to 77.78%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants