<div dir="ltr"><div>Hi again,</div><div><br></div><div>a brief update on my issue.</div><div>I discovered that the operation works if I explicitly transform the coordinates in two steps.</div><div>The first step I transform the coordinates from the projected CRS to the Geodetic CRS, then I can apply the selected Operation.</div><div>Is this the correct approach?</div><div><br></div><div>Thank you</div><div><br></div><div>Stefano<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 5 mar 2021 alle ore 09:42 Stefano Iacovella <<a href="mailto:stefano.iacovella@gmail.com">stefano.iacovella@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>I am trying to use GDAL, via Python bindings, to convert coordinates.</div><div>I would like to select a specific transformation when converting among CRS with different Datums. Reading the documentation my understanding is that I need to create a 


osr.CoordinateTransformation with options parameter valorized properly.</div><div>I am using binaries from OSGEO4WIN, the release are 3.1.4 for GDAL and 6.3.2 for PROJ</div><div>This is a code snippet I am using to debug:</div><div><br></div><div><span style="font-family:monospace">from osgeo import ogr<br>from osgeo import osr<br><br>source = osr.SpatialReference()<br>source.ImportFromEPSG(3003)<br><br>target = osr.SpatialReference()<br>target.ImportFromEPSG(4326)<br><br>options = osr.CoordinateTransformationOptions()<br>options.SetOperation("urn:ogc:def:coordinateOperation:EPSG::1169")<br>transform = osr.CoordinateTransformation(source, target, options)<br><br>point = ogr.CreateGeometryFromWkt("POINT (1622987 4756952)")<br>point.Transform(transform)<br><br>print point.ExportToWkt()</span></div><div><br></div><div>I have no errors running it but the coordinates of the point, after the transformation, are infinite. If I create the CoordinateTransformation without options like this:</div><div><br></div><div>
<span style="font-family:monospace">transform = osr.CoordinateTransformation(source, target)</span><br>

</div><div><br></div><div>The point coordinates after transformation are ok but of course the conversion is performed using the Coordinate Operation automatically selected by the system.</div><div>Am I doing something wrong?</div><div><br></div><div>Thank you in advance for your help.</div><div><br></div><div>All the best,</div><div><br></div><div>Stefano<br></div><div><br></div></div>
</blockquote></div>