Hello all
Below is an explanation of the recent work on the JDK8 branch.
Since the beginning of this week, the commits in sis-referencing are
around Geographic/Geocentric conversions and Molodensky transformations.
When we need to transform a geographic coordinate on a datum A to a
geographic coordinate in another datum B, the transformation is usually
very irregular (USA have the NADCON grids for that; Canada, France and
other countries have their own grids). But this operation can also be
approximated as below:
1. Convert the geographic coordinates to geocentric coordinates.
2. Perform a translation, rotation and scale in those geocentric
coordinates.
3. Convert back the geocentric coordinates to geographic coordinates.
To avoid the cost of Geographic/Geocentric conversions, mapping agencies
used another approximation named "Molodensky transformation" which
operates directly on geographic coordinates (without passing through
geocentric ones), but at the cost of some imprecision. Actually they
even used a slightly simplified form known as "Abridged Molodensky".
Here, there is a difference in Apache SIS philosophy (and Geotk before
it) compared to GDAL or Proj.4. In modern computing age, the cost of the
full Geographic/Geocentric approach is usually not considered an issue
anymore. So we could just ignore the Molodensky methods and always use
the mathematically more accurate alternative. In my understanding, this
is what Proj.4 seems to do (unconditionally use the mathematically most
accurate method). But this is not what the EPSG guidance notes
recommends. For many particular pairs of source and target Coordinate
Reference Systems (CRS), the EPSG database said "use the Abridged
Molodensky method in that particular case even if it is not the most
accurate method". The reason is that Abridged Molodensky was used by
many national mapping agencies for decades, and if we want the data to
be positioned with a centimetric precision on their official maps we
need to use the same method. This is a case where "most mathematically
accurate method" is not synonymous to "most geographically accurate
method" because we need to reproduce the same mathematical errors. Since
different mapping agencies choose different methods, the transformation
method to apply (Geographic/Geocentric conversion, Molodensky, Abridged
Molodensky or other) is really a case-by-case decision. The EPSG
database have this information, but not every libraries use it. Apache
SIS is characterized by a strong attempt to do "as the authority said".
The Geographic/Geocentric conversions and Molodensky transformations
have been ported to SIS recently, but I'm still trying to simplify them.
In particular I'm considering to remove some non-standard extensions for
closer matching with OGC and EPSG definitions. The non-standard
extensions were an attempt to make easier to use the above-cited methods
with two-dimensional coordinates (because those methods are designed for
three-dimensional space). But now I believe that those "conveniences"
have too tricky implications (e.g. transformation from A to B and back
to A does not give back the original coordinate if the third ordinate
'h' was lost in the middle), so I'm tempted to take the EPSG approach
which defines those operations as strictly three-dimensional and defines
a "geographic 3D to 2D" operation as a separated step.
Martin