[geotk] Transformation Lambert 2 toward Lambert 93

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Sun Feb 26 14:16:01 EST 2012


To translate his question, Julien Seb where basically asking how to use a 
transformation grid (in his case the RGF93 grid, but the same apply to NADCON 
grid). Geotk support grids in NADCON or NTv2 formats, provided that they are 
installed in the proper directory. We do not (at this time) bundle the grids 
with the Geotk library because I'm unsure about the licensing. While I think 
that NADCON grids can be freely redistributed, I'm unsure about other countries.

The grids files in NTv2 format (".gsb") need to be copied in the following 
directory, relative to the user home directory:

  * Windows: "Application Data\Geotoolkit.org\NTv2"
  * MacOS: "Library/Geotoolkit.org/NTv2"
  * Linux: ".geotoolkit.org/NTv2"


Note that the downloading and installation of those grid data can be performed 
automatically by a Swing application.

  * Download "geotk-bundle-3.19.pack.gz" from
    http://download.geotoolkit.org/3.19/ (or any later Geotk version)
  * Uncompress and execute as below:

         unpack200 --remove-pack-file geotk-bundle-3.19.pack.gz geotk.jar
         java -jar geotk.jar

  * Select "/File/", "/Preference/" and click on the "/Data/" tab. Click on the
    "/Install/" button on the right side of "RGF93" or "NADCON".


To transform a coordinate using those grids, we recommend to use the EPSG 
database. This is because the EPSG database declares which grid files to use for 
some transformations, and Geotk rely on those declarations. Example for Lambert 
2 to RGF93:

         CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:27572");
         CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:2154");
         MathTransform tr = CRS.findMathTransform(sourceCRS, targetCRS);
         System.out.println(tr);
         DirectPosition sourcePt = new DirectPosition2D(sourceCRS, 565767.9060, 2669005.7300);
         DirectPosition targetPt = tr.transform(sourcePt, null);
         System.out.println(sourcePt);
         System.out.println(targetPt);


To make sure that the RGF93 grid has really been used for the above transform, 
look at the output of "System.out.println(tr)". This output should contains the 
following line somewhere in the middle of many other parameters:

     PARAM_MT["NTv2",
         PARAMETER["Latitude and longitude difference file", "ntf_r93.gsb"]],


If you don't see this line, then some kind of approximation (probably based on 
Bursa-Wolf Parameters) has been used instead of the grid file. The reason why 
the grid file has not been used can be:

  * The grid files were not found (maybe they were not copied in the expected
    directory).
  * There is no EPSG database (the WKT-based database is not sufficient - Geotk
    needs the "real" one).
  * The EPSG database does not specify grid files for the given source and
    target CRS.


     Martin



Le 25/02/12 13:58, Seb Julien a écrit :
> je suis actuellement en train de chercher un moyen pour passer du Lambert 2 étendu au Lambert 93 en utilisant la transformation NTv2 ainsi que le fichier *.gsb fournit par l'IGN. Il semble qu'il soit possible de le faire avec le Geotoolkit. Mais je ne comprend pas exactement comment créer ce type de transformation.



More information about the Geotoolkit mailing list