Hello,

I have started testing Apache SIS using GIGS tests (
https://www.iogp.org/geomatics/#gigs). I wrote the following code for the
test #5207:

public class Test5207Ntv2 {
    @Test
    public void part1_Australia() throws FactoryException, Exception {


        CoordinateReferenceSystem eps4202 = CRS.forCode("EPSG:4202");
        CoordinateReferenceSystem eps4283 = CRS.forCode("EPSG:4283");


        double inputLat = -12;
        double inputLong = -115;
        double resultLat = -11.9986441666667;   // From GIGS Test5207
        double resultLong =-115.001261388889;   // from GIGS Test5207

        CoordinateOperation operation =
TransformUtil.getCoordinateTransformForPoint(eps4202, eps4283, inputLong,
inputLat);
        System.out.println(operation.toString());

        DirectPosition position = new DirectPosition2D(inputLat, inputLong);
        double[] coordinate =
operation.getMathTransform().transform(position, position).getCoordinate();
        Assert.assertEquals(resultLat, coordinate[0], 0.001);
        Assert.assertEquals(resultLong, coordinate[1], 0.001);
    }

The test fails:
[image: image.png]

I did check that NTV2 grids were used. This is the description of the
operation, confirming that the A66 National (13.09.01).gsb NTV2 file is
used.

CoordinateOperation["AGD66 to GDA94 (11)",
  SourceCRS[GeodeticCRS["AGD66",
    Datum["Australian Geodetic Datum 1966",
      Ellipsoid["Australian National Spheroid", 6378160.0, 298.25]],
    CS[ellipsoidal, 2],
      Axis["Geodetic longitude (Lon)", east],
      Axis["Geodetic latitude (Lat)", north],
      Unit["degree", 0.017453292519943295]]],
  TargetCRS[GeodeticCRS["GDA94",
    Datum["Geocentric Datum of Australia 1994",
      Ellipsoid["GRS 1980", 6378137.0, 298.257222101]],
    CS[ellipsoidal, 2],
      Axis["Geodetic longitude (Lon)", east],
      Axis["Geodetic latitude (Lat)", north],
      Unit["degree", 0.017453292519943295]]],
  Method["NTv2"],
    Parameter["Latitude and longitude difference file", "A66 National
(13.09.01).gsb"],
  OperationAccuracy[0.1],
  Scope["0.1m accuracy."],
  Area["Australia - Australian Capital Territory; New South Wales; Northern
Territory; Queensland; South Australia; Tasmania; Western Australia;
Victoria."],
  BBox[-43.70, 112.85, -9.86, 153.69],
  Remark["Replaces AGD66 to GDA94 variants 6, 7 and 10 (codes 1506 1507
1596). Input expects longitudes to be positive west; EPSG GeogCRS AGD66
(code 4202) and GDA94 (code 4283) both have longitudes positive east. May
be used as tfm to WGS 84 - see code 15786."]]


Why is there a discrepency in the conversion results compared to the GIGS
test? Is it something I am doing wrong?

-Thierry

Reply via email to