Simon Turner a écrit :
Does anyone know what the accuracy of the transformations in GeoTools are,
compared with those of other software, such as PROJ.4? I ask because I am
getting different results for the same transformations, with variation up
to 90 metres. I had assumed that there was a single widely-used algorithm
for any given transformation, so the results would be consistent across
applications.
There is not always a single algorithm. For example there is 2 or 3
algorithms for UTM projections. Rueben is the specialist on this topic.
Most Geotools algorithms are derived from Proj.4, which means that the
results should be close to identical to Proj.4. The accuracy should be
around 1 centimeter. See "test tolerance" in the test suite below (which
is tested during every Geotools builds; the expected "target pt" values
were computed by Rueben using ArcGIS 8.3):
http://gtsvn.refractions.net/geotools/trunk/gt/module/referencing/test/org/geotools/referencing/test-data/scripts/TransverseMercator.txt
Just as a for instance:
Transformation in PostGIS (which uses PROJ.4):
select AsText(Transform(GeomFromText('POINT(-3.75772145997185
51.5742232897346)', 4326), 27700)) as metres;
------------------------------------------
POINT(278204.250150917 187591.006280736)
Same transformation in GeoTools with the epsg HSQL jar on the classpath:
[...snip...]
GeneralDirectPosition[278291.1032887026, 187619.97719849477]
In order to know exactly which transformation chains were setup by
Geotools, invoke the following on the command line:
java org.geotools.referencing.factory.epsg.DefaultFactory -transform
4326 27700
You should get the WKT of the transformation chain. This WKT shown that
this coordinate transformation implies a datum shift (as you can see
from the "Ellipsoid_To_Geocentric" and "Geocentric_To_Ellipsoid" steps).
I suspect that the "Transverse_Mercator" step is close to identical in
PostGIS and in Geotools, and that the difference lies in the datum shift
step. More than one datum shifts may exists for a given source and
target CRS. For example there is 40 different transformations from 4230
to 4326 declared in the EPSG database! Geotools try to pickup the most
accurate one.
My understanding is that the epsg-wkt factory is derived from the
PostGIS database, and we known that epsg-wkt factory doesn't handle
datum shift. Maybe PostGIS doesn't handle datum shift neither? You may
test this hypothesis by trying to run yours program again with the
epsg-wkt factory instead of epsg-hsql (don't forget to swap longitude
and latitude order!). If you get the same result with epsg-wkt than with
PostGIS, then it would means that PostGIS doesn't handle datum shift,
and Geotools computation with epsg-hsql would be more accurate.
If epsg-wkt produces yet an other result, then my hypothesis is wrong. I
would be interrested to know yours result.
Martin.
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users