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

pj_phi2(): speed-up computation (and thus inverse ellipsoidal Mercator and LCC) #2052

Merged
merged 1 commit into from Mar 30, 2020

Conversation

rouault
Copy link
Member

@rouault rouault commented Mar 11, 2020

This does not change the numeric values returned by the method,
as far as I could see on a few samplings.

The tricks used save a call to sin() and atan() at each iteration.

This directly affects speed of inverse Mercator and LCC (among others),
in their ellipsoidal formulation.

Timings on inverse Mercator show a 31% speed-up at mid-latitudes
where pj_phi2() needs 5 iterations, and 24% at latitudes close to 0 or
90deg where it needs one iteration.

src/phi2.cpp Outdated Show resolved Hide resolved
…r and LCC)

This does not change the numeric values returned by the method,
as far as I could see on a few samplings.

The tricks used save a call to sin() and atan() at each iteration.

This directly affects speed of inverse Mercator and LCC (among others),
in their ellipsoidal formulation.

Timings on inverse Mercator show a 31% speed-up at mid-latitudes
where pj_phi2() needs 5 iterations, and 24% at latitudes close to 0 or
90deg where it needs one iteration.
rouault added a commit to rouault/PROJ that referenced this pull request Mar 11, 2020
…ordinates with same northing

Same rationale as in OSGeo#2043
When converting by batch of coordinates of 2000 consecutive same northings,
the speed-up over master is 7 times for ellipsoidal formulation, and
about 40% for the spherical formulation (and thus webmerc)
On top of OSGeo#2052, the speed-up for ellipsoidal would also be about 40%
rouault added a commit to rouault/PROJ that referenced this pull request Mar 11, 2020
…ordinates with same northing

Same rationale as in OSGeo#2043
When converting by batch of coordinates of 2000 consecutive same northings,
the speed-up over master is 7 times for ellipsoidal formulation, and
about 40% for the spherical formulation (and thus webmerc)
On top of OSGeo#2052, the speed-up for ellipsoidal would also be about 40%
@rouault rouault merged commit a837eaf into OSGeo:master Mar 30, 2020
@kbevers kbevers added this to the 7.1.0 milestone Mar 30, 2020
@rouault rouault mentioned this pull request Oct 26, 2020
3 tasks
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

Successfully merging this pull request may close these issues.

None yet

3 participants