Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSGB36 NTv2 grid #127

Open
ebocher opened this issue Jan 14, 2020 · 4 comments
Open

Add OSGB36 NTv2 grid #127

ebocher opened this issue Jan 14, 2020 · 4 comments
Milestone

Comments

@ebocher
Copy link
Member

ebocher commented Jan 14, 2020

See this discussion : #125

Thanks a lot to @mukoki

@ebocher ebocher added this to the CTS 1.6.0 milestone Jan 14, 2020
@ebocher
Copy link
Member Author

ebocher commented Jan 7, 2021

Related to dbeaver/dbeaver#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
Copy link
Member Author

ebocher commented Jan 7, 2021

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.

@mukoki
Copy link
Contributor

mukoki commented Jan 7, 2021

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

@ebocher
Copy link
Member Author

ebocher commented Jan 8, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants