Hello Jan

I updated the recently added Krovak projection as below:

* Extracted as much constants as possible out of the loops. They were a fair
   amount of trigonometric functions (which are known to be costly) that could
   be calculated once for ever, sometime at construction time. The result should
   be faster projections.

* Leveraged existing fields like 'scaleFactor' and 'centralMeridian'.
   Concequently removed some redundant fields from Krovak. The substitution
   was direct for 'scaleFactor', and indirect for 'centralMeridian' (visible
   only after some algebraic operations). The result is a projection more
   integrated to the existing framework.

* Removed the multiplication or division by 'semiMajor', which were redundant
   with the work performed by the MapProjection super-class. It was not obvious
   the way the formulas was initially written, but more visible after a little
   bit of algebraic rearangement. The same happen to 'centralMeridian': the
   relationship with the former 'lon_0' and 'vk' fields became more visible
   after some algebraic work.

* Edited the parameter descriptors according the descriptions found on
   www.remotesensing.org.

* Added 'equals' and 'hashCode' methods.

Some of the new formulas may seem quite different than the previous ones, but 
actually they are really the same; I applied only algebraic operations (mostly 
substitutions) that are mathematical identities. I hope that you don't mind 
that 
the formulas changed like that...

In practice algrabraic rearangement in a program may lead to rounding errors, 
but in my tests I found (sometime) a difference only in the two last digits. Of 
course the full test suite still pass (including "scripts/Krovak.txt").


Note: I have some hesitation about what the default values should be. A few 
years ago we had default value like "scaleFactor=0.9999" for transverse 
mercator 
projection, on the basis that it was a commonly used value. But feedback from 
users told us that such default values were misleading, that it was better to 
keep default value to "natural" (or "neutral") numbers like 0 or 1. What do you 
think?

     Martin

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to