Hi,
I'm playing with some raster data and I'm having issues
with datum comparison. Basically, the file is the world
image type, with a .prj file that contains the exact
dump of the EPSG:26713 CRS.
The main problem here is that the CRS resulting from decode
is not the same as the one got from parsing the WKT, the
difference being in the "ivfDefinitive" parameter, which
is used for comparison (even the lenient verision of it).
The following program demonstrates the behaviour:
import org.geotools.referencing.CRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
public class TestConversion {
public static void main(String[] args) throws Exception {
CoordinateReferenceSystem crs1 = CRS.decode("EPSG:26713");
CoordinateReferenceSystem crs2 = CRS.parseWKT(crs1.toWKT());
System.out.println("Equal: " + CRS.equalsIgnoreMetadata(crs1,
crs2));
System.out.println("Transform: " + CRS.findMathTransform(crs1,
crs2));
}
}
It's output being:
Equal: false
Transform: CONCAT_MT[INVERSE_MT[PARAM_MT["Transverse_Mercator",
PARAMETER["semi_major", 6378206.4],
PARAMETER["semi_minor", 6356583.8],
PARAMETER["central_meridian", -105.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0]]],
PARAM_MT["Molodenski",
PARAMETER["dim", 2],
PARAMETER["dx", 0.0],
PARAMETER["dy", 0.0],
PARAMETER["dz", 0.0],
PARAMETER["src_semi_major", 6378206.4],
PARAMETER["src_semi_minor", 6356583.8],
PARAMETER["tgt_semi_major", 6378206.4],
PARAMETER["tgt_semi_minor", 6356583.8]],
PARAM_MT["Molodenski",
PARAMETER["dim", 2],
PARAMETER["dx", 0.0],
PARAMETER["dy", 0.0],
PARAMETER["dz", 0.0],
PARAMETER["src_semi_major", 6378206.4],
PARAMETER["src_semi_minor", 6356583.8],
PARAMETER["tgt_semi_major", 6378206.4],
PARAMETER["tgt_semi_minor", 6356583.8]],
PARAM_MT["Molodenski",
PARAMETER["dim", 2],
PARAMETER["dx", 0.0],
PARAMETER["dy", 0.0],
PARAMETER["dz", 0.0],
PARAMETER["src_semi_major", 6378206.4],
PARAMETER["src_semi_minor", 6356583.8],
PARAMETER["tgt_semi_major", 6378206.4],
PARAMETER["tgt_semi_minor", 6356583.8]],
PARAM_MT["Transverse_Mercator",
PARAMETER["semi_major", 6378206.4],
PARAMETER["semi_minor", 6356583.8],
PARAMETER["central_meridian", -105.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0]]]
As you can see, that minor difference in the Ellipsoid definition
triggers the generation of a quite expensive transform (which would
probably end up being an identity, haven't checked thought).
Wondering, is there any reason ivfDefinitive is used to compare
Ellipsoids for equality? Any way we can make these comparisons
a bit more lenient?
Cheers
Andrea
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel