cts icon indicating copy to clipboard operation
cts copied to clipboard

Add OSGB36 NTv2 grid

Open ebocher opened this issue 5 years ago • 4 comments

See this discussion : https://github.com/orbisgis/cts/pull/125

Thanks a lot to @mukoki

ebocher avatar Jan 14 '20 10:01 ebocher

Related to https://github.com/dbeaver/dbeaver/issues/8553

Unit test

@Test
    void testEPSGCodeFrom4326To2232() throws Exception {
        String csNameSrc = "EPSG:4326"; //Input EPSG
        double[] pointSource = new double[]{-105,40};
        String csNameDest = "EPSG:2232";  //Target EPSG 
        double[] pointDest = new double[]{3140089.069 , 1789525.0783};
        double tolerance = 0.001;
        CoordinateReferenceSystem inputCRS = cRSFactory.getCRS(csNameSrc);
        CoordinateReferenceSystem outputCRS = cRSFactory.getCRS(csNameDest);
        verbose = true;
        double[] result = transform((GeodeticCRS) inputCRS, (GeodeticCRS) outputCRS, pointSource);
        assertTrue(checkEquals2D("EPSG:4326 to EPSG:2232", result, pointDest, tolerance));
    }

ebocher avatar Jan 07 '21 07:01 ebocher

As @mukoki already suggest we can reuse the files provided by proj lib So we must read this file and populate the CTS grid transform

NADCON transformations use two grid files, one for a latitude shift and one for a longitude shift, that end in .las and .los extensions. NADCON 5 transformations use at least two files, for GridLat and GridLon, and also may optionally use a third file, for GridHeight.

ebocher avatar Jan 07 '21 08:01 ebocher

This should not be very different from the NTv2 case. There is still some work to do : get the format specification, write the parser, implement a new GridBasedTransformation, tests... Not easy to find the time, but not too much challenging from a technical point of view. I know that if we dig into this stuff, we'll discover many versions and possible confusions between grids, realization dates... Hopefully, we can take inspiration in proj4 or other more matures libraries

mukoki avatar Jan 07 '21 19:01 mukoki

Thanks a lot. I'll add it to the 1.7 road map And sure we can inspiration in proj4.

ebocher avatar Jan 08 '21 06:01 ebocher