NaturalGIS / naturalgis_ntv2_transformations

A plugin for the QGIS Processing toolbox to allow users do Datum transformations with NTv2 grids
Other
14 stars 8 forks source link

Add NTv2 Globogis vector transformation for Italy #43

Open agiudiceandrea opened 4 years ago

agiudiceandrea commented 4 years ago

I've slightly modified VectorIT_RER_ETRS89DirInv.py to create a vector transformation for Italy VectorIT_ITALY_ETRS89DirInv.py using the Globogis NTv2 grids.

It seems working, but I don't know if there are other changes to make in other parts of the code...

I'm unsure about these lines https://github.com/agiudiceandrea/naturalgis_ntv2_transformations/blob/b94b7b4da906bdefdecb6f98154fef29405a6b30/VectorIT_ITALY_ETRS89DirInv.py#L4-L22

and particularly this https://github.com/agiudiceandrea/naturalgis_ntv2_transformations/blob/b94b7b4da906bdefdecb6f98154fef29405a6b30/VectorIT_ITALY_ETRS89DirInv.py#L59

If all is ok with this code, I'll also try to create a RasterIT_ITALY_ETRS89DirInv.py.

By the way, I've found there's something not working properly in the ogr2ogr command for all the vector inverse transformations. The log reports "Warning 6: dataset /vsistdout/ does not support layer creation option ENCODING" every time an inverse transformation is performed. I wonder why /vsistdout/ and /vsistdin/ are needed in order to perform the vector inverse transformations and if we could avoid to use them.

I would also point out that two other NTv2 gridfiles are available for Italy at http://www.provincia.agrigento.it/flex/cm/pages/ServeBLOB.php/L/IT/IDPagina/309: these grids are created using the Geoportale Nazionale coordinate transform service http://www.pcn.minambiente.it/mattm/conversione-coordinate/ for ROMA40<->WGS84/ETRS89-ETRF89 and ED50<->WGS84/ETRS89-ETRF89 Could them be added to the gridfiles repository?

Partially fixes #29

gioman commented 4 years ago

I've slightly modified VectorIT_RER_ETRS89DirInv.py to create a vector transformation for Italy VectorIT_ITALY_ETRS89DirInv.py using the Globogis NTv2 grids.

It seems working, but I don't know if there are other changes to make in other parts of the code...

@agiudiceandrea it seems good to me, especially if you say it works :)

I'm unsure about these lines https://github.com/agiudiceandrea/naturalgis_ntv2_transformations/blob/b94b7b4da906bdefdecb6f98154fef29405a6b30/VectorIT_ITALY_ETRS89DirInv.py#L4-L22

I guess is to leave as it is, I'll add your name (and contact of you want) in the contributor list in the readme that will show also in the QGIS plugin manager.

and particularly this https://github.com/agiudiceandrea/naturalgis_ntv2_transformations/blob/b94b7b4da906bdefdecb6f98154fef29405a6b30/VectorIT_ITALY_ETRS89DirInv.py#L59

I guess it could become "itrervectortransform" for the case of the Emilia-Romagna grids and "itvectortransform" for the grids that work for the whole national territory.

If all is ok with this code, I'll also try to create a RasterIT_ITALY_ETRS89DirInv.py.

ok

By the way, I've found there's something not working properly in the ogr2ogr command for all the vector inverse transformations. The log reports "Warning 6: dataset /vsistdout/ does not support layer creation option ENCODING" every time an inverse transformation is performed. I wonder why /vsistdout/ and /vsistdin/ are needed in order to perform the vector inverse transformations and if we could avoid to use them.

The warning is harmless.

The reason why I added the /vsistdout/ and /vsistdin/ mechanism is the following: if you do a transformation with ogr2ogr and a custom projection (that in this cases uses ntv2 grids) you never ends with a layer that has a precise EPSG code. So the trick was to output the transformed layer to vsistdout and then make a copy of it giving it a proper EPSG code. But this was done years ago, based on a now obsolete version of gdal/ogr, so maybe now things could work in a different way.

would also point out that two other NTv2 gridfiles are available for Italy at http://www.provincia.agrigento.it/flex/cm/pages/ServeBLOB.php/L/IT/IDPagina/309: these grids are created using the Geoportale Nazionale coordinate transform service http://www.pcn.minambiente.it/mattm/conversione-coordinate/ for ROMA40<->WGS84/ETRS89-ETRF89 and ED50<->WGS84/ETRS89-ETRF89 Could them be added to the gridfiles repository?

We can, but only if these grids are available with a license that clearly allow re-distribution.

agiudiceandrea commented 4 years ago

See also https://github.com/OSGeo/proj-datumgrid/issues/83#issuecomment-562901375