orbisgis / cts

Projection library in Java
GNU Lesser General Public License v3.0
49 stars 15 forks source link

Fix ticket #124 (add 7-param transformation for 27700 OSGB36 srs) #125

Closed mukoki closed 4 years ago

mukoki commented 4 years ago

I added the 7 parameters transformation in the epsg config file. OSGB36 supports a more precise grid-based transformation. I did not add it because the NTv2 grid (downloadable from https://www.ordnancesurvey.co.uk/business-government/tools-support/os-net/format) is quite heavy. A good tuto about different transformations from/to 27700 is https://digimap.edina.ac.uk/webhelp/digimapgis/projections_and_transformations/transformations_in_gdalogr.htm. I think it can be used for CTS (did not check though).

ebocher commented 4 years ago

Thanks a lot. What do you think if we add the OSTN02_NTv2 in the grid folder here https://github.com/orbisgis/cts/tree/master/grids. When the grid is needed it will be downloaded and installed in .cts folder that contains all the other grids. Perhaps we can also download the grid from the official URL https://www.ordnancesurvey.co.uk/documents/resources/ostn02-ntv2-data.zip

mukoki commented 4 years ago

We can add the grid to the repository, but I'm reluctant to add it in the jar bundle because of its size. Have we a way to include/exclude resources in the jar bundle ?

In your proposition, who do you think is responsable for the download of the NTv2 grid ? Is this CTS (not that I know), the software using it (like H2GIS) ? or the end user ?

From now on, the epsg registry refers to the 7-parameters transfo. I don't think it can refer to both 7-param transfo and NTv2. Not sure if the code can try the NTv2 transform and fall back to 7-param in the case where the grid is not found.

I compared the 7-param transfo to what I get with postgis and it seems to match (I use it for the unit test). If we decide to include the NTv2 grid, we will have to do more tests and to find a good reference for the tests.

ebocher commented 4 years ago

We can add the grid to the repository, but I'm reluctant to add it in the jar bundle because of its size. Have we a way to include/exclude resources in the jar bundle ?

The grid folder is not packaged with jar. So we can add it if you are ok in it.

In your proposition, who do you think is responsable for the download of the NTv2 grid ? Is this CTS (not that I know), the software using it (like H2GIS) ? or the end user ?

CTS is currently able to look for a grid in the ./cts folder. If the grid doesn't exist it checks it on the cts github repository using the following method https://github.com/orbisgis/cts/blob/master/src/main/java/org/cts/op/transformation/grids/GridUtils.java#L55

What do you think if the we used the same approach ?

From now on, the epsg registry refers to the 7-parameters transfo. I don't think it can refer to both 7-param transfo and NTv2. Not sure if the code can try the NTv2 transform and fall back to 7-param in the case where the grid is not found.

I compared the 7-param transfo to what I get with postgis and it seems to match (I use it for the unit test). If we decide to include the NTv2 grid, we will have to do more tests and to find a good reference for the tests.

You are rigth. Is postgis able to use the NTv2 grid ?

ebocher commented 4 years ago

If It is ok we can merge this PR and open a new issue about the ntv2 grid?