<div dir="ltr"><div>Thank you very much Even!</div><div><br></div><div>As usual, faster fix was completely impossible! :)</div><div><br></div><div>Best regards,</div><div>Pedro</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> escreveu no dia sexta, 28/02/2020 à(s) 15:51:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Pedro,<br>
<br>
> I'm trying to make transformations with ogr2ogr, using NTv2 grids, in<br>
> GDAL/OGR 3, and it does not work.<br>
> <br>
> The command I was using in GDAL/OGR 2 is<br>
> <br>
> ogr2ogr -s_srs "+proj=tmerc +lat_0=39.66666666666666 +lon_0=1 +k=1<br>
> +x_0=200000 +y_0=300000 +ellps=intl<br>
> +nadgrids=C:\Users\PedroVenancio\AppData\Roaming\QGIS\QGIS3\profiles\default<br>
> \python\plugins\ntv2_transformations\grids\DLx_ETRS89_geo.gsb +wktext<br>
> +pm=lisbon +units=m +no_defs" -t_srs EPSG:3763 -f "ESRI Shapefile" -lco<br>
> ENCODING=UTF-8<br>
> D:/Testes/postos_vigia/postos_vigia_rede_nacional_3763.shp<br>
> D:\Testes\postos_vigia\postos_vigia_rede_nacional_20790.shp<br>
> <br>
> and the result in GDAL/OGR 3.0.2 or 3.0.4 is<br>
> <br>
> ERROR 1: Failed to reproject feature 0 (geometry probably out of source or<br>
> destination SRS).<br>
> ERROR 1: Terminating translation prematurely after failed<br>
> translation of layer postos_vigia_rede_nacional_20790 (use -skipfailures to<br>
> skip errors)<br>
> <br>
> This command works well in GDAL/OGR 2.4.0 and 2.4.2.<br>
<br>
Arg, I found this was a bug of PROJ >= 6. I've just submitted a fix for it in <br>
<a href="https://github.com/OSGeo/PROJ/pull/1998" rel="noreferrer" target="_blank">https://github.com/OSGeo/PROJ/pull/1998</a><br>
The issue came from using both +nadgrids and +pm, which wasn't handled <br>
correctly, and resulted in grid transformation being done with longitudes <br>
expressed in Lisbon prime meridan instead of Greenwich<br>
<br>
> And where can I find documentation about the WKT2 string describing the<br>
> CoordinateOperation to use in -ct?<br>
<br>
Create coordinate operations in WKT2 can be really tedious. The best reference <br>
is probably the standard itself:<br>
<a href="http://docs.opengeospatial.org/is/18-010r7/18-010r7.html" rel="noreferrer" target="_blank">http://docs.opengeospatial.org/is/18-010r7/18-010r7.html</a><br>
<br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</blockquote></div>