[MetaCRS] Lambert zone II to WSG84 issue

Christian Gendreau christiangendreau at gmail.com
Wed Nov 20 05:10:31 PST 2013


Hi,

--This was originally posted on the GeoTools mailing list--

I'm trying to convert/transform some coordinates from one CRS to
another using JTS.transform(...)
There is a difference in what GeoTools 10 returns and what PostGIS and
QGIS return.
I'm aware that the parameters used by GeoTools are from the EPSG
database and are not managed by GeoTools but I'm having an issue when
I provide the exact WTK.

Input is in EPSG:27572 (Lambert zone II)
 -------
CoordinateReferenceSystem sourceCrs = CRS.decode("EPSG:27572");
CoordinateReferenceSystem targetCrs = DefaultGeographicCRS.WGS84;

Coordinate coord = new Coordinate(605937.033, 2426318.714);
Point sourcePoint = geometryFactory.createPoint(coord);
MathTransform transform = CRS.findMathTransform(sourceCrs, targetCrs);
Geometry targetGeometry = JTS.transform( sourcePoint, transform);
-------

This will not work except if I use the 'lenient' flag and then I will get:
POINT (2.4180555600606395 48.832161511178725)
This is 400 meters offset but there is no TOWGS84 parameters provided
so I'm don't know what accuracy to expect.

So I tried with PostGIS 2.0.1 and I got : POINT(2.41733554398175
48.8352090484985)
This is correct.

Then, I tried to use the PostGIS WTK definition in GeoTools.
crs = CRS.parseWKT("PROJCS[\"NTF (Paris) / Lambert zone
II\",GEOGCS[\"NTF
(Paris)\",DATUM[\"Nouvelle_Triangulation_Francaise_Paris\",SPHEROID[\"Clarke
1880 (IGN)\",6378249.2,293.4660212936265,AUTHORITY[\"EPSG\",\"7011\"]],TOWGS84[-168,-60,320,0,0,0,0],AUTHORITY[\"EPSG\",\"6807\"]],PRIMEM[\"Paris\",2.33722917,AUTHORITY[\"EPSG\",\"8903\"]],UNIT[\"grad\",0.01570796326794897,AUTHORITY[\"EPSG\",\"9105\"]],AUTHORITY[\"EPSG\",\"4807\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_1SP\"],PARAMETER[\"latitude_of_origin\",52],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",0.99987742],PARAMETER[\"false_easting\",600000],PARAMETER[\"false_northing\",2200000],AUTHORITY[\"EPSG\",\"27572\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]");

and I got: POINT (2.183603198566145 48.8352075151015)
which is 17 km offset.

The TOWSG84 parameters are matching the PROJ.4 definition:
+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000
+y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0
+pm=paris +units=m +no_defs

Does anyone know what I'm doing wrong?

Thanks,

Christian Gendreau


More information about the MetaCRS mailing list