[Proj] UNPP optimizations - was Re: Natural Earth projection

OvV_HN ovv at hetnet.nl
Fri Mar 9 06:57:31 PST 2012


[Proj] UNPP optimizations - was Re: Natural Earth projection
support.mn at elisanet.fi support.mn at elisanet.fi
Fri Mar 9 09:13:06 EST 2012

Re:
I started to be interested about the number of iteration steps
in the inverse (iterative) conversion.. we all need maximum
speed.. so:
you could call it (Usually Near the Previous Point)
UNPP optimization ................

Reply (for what it's worth, probably 2 cents):

In the case of the Natural Earth projection the number of iteration steps 
seems to be low.
Some examples:
R = 6371008.7714 m
lat, lon = 70.0,120.0; inverse needs 4 iterations
lat, lon = 80.0,120.0; inverse needs 4 iterations
lat, lon = 85.0,120.0; inverse needs 5 iterations
lat, lon = 89.0,120.0; inverse needs 7 iterations
lat, lon = 90.0,120.0; inverse needs 7 iterations

Note that the iteration loop only has a couple of multiplications and one 
division.
The polynomial is efficiently calculated with a Horner scheme.
A UNPP optimized code could be quite involved. Calculating from the previous 
point will certainly involve some math, but probably no time consuming 
divisions or transcendentals. But after a series of points an original 
calculation has to be done in order to retain accuracy. Decision tests have 
to be made and these could cost some time.

I wonder if such an optimization will lead to a significant reduction in 
time for very simple iterative procedures which are looped less than say 10 
times.
But for relatively time consuming loops that have to be done 40 times or so 
until convergence, times 10 million pixels........ optimization should be 
investigated!


Oscar van Vlijmen






More information about the Proj mailing list