<div dir="ltr"><div>If you don't want to measure an ogr geometry but produce for instance a geotiff in a LDP (low distortion projection), you can just convert to a transverse mercator (without "universal") centred in your area of interest. Makeing a wkt by hand is very easy.</div><div><br></div><div>In case you want to consider also the distortion due to height, I recommend either compute a scale factor for your projection (as explained somehow in <a href="https://geodesy.noaa.gov/web/science_edu/webinar_series/changes-afoot-after-2022.shtml" target="_blank">https://geodesy.noaa.gov/web/science_edu/webinar_series/changes-afoot-after-2022.shtml</a> ) or compute it yourself.</div><div><br></div><div>For the projection distortion factor (not including height) there is something in PROJ: <a href="https://proj.org/en/stable/apps/proj.html#cmdoption-proj-S" target="_blank">https://proj.org/en/stable/apps/proj.html#cmdoption-proj-S</a></div><div><br></div><div>As a curiosity or helper there is a plugin for QGIS to visualize the factors: <a href="https://plugins.qgis.org/plugins/proj_factors_redux/" target="_blank">https://plugins.qgis.org/plugins/proj_factors_redux/</a> (Thanks Johannes)<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Jan 2025 at 11:45, Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p><br>
</p>
<div>Le 21/01/2025 à 11:37, Thomas Knudsen
via gdal-dev a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">If you plan to transform to a different system
anyway, I would definitely prefer going to geographical
coordinates, and computing the length of the geodesic between
the two points.</div>
</blockquote>
<p>actually no need to do the explicit conversion to geographical
coordinates, if the appropriate SRS is attached to your geometry,
OGRGeometry::<span></span><span><span><span>get_GeodesicLength</span></span></span><span>() will do the right thing:</span>
<a href="https://gdal.org/en/stable/api/ogrgeometry_cpp.html#_CPPv4NK13OGRLineString18get_GeodesicLengthEPK19OGRSpatialReference" target="_blank">https://gdal.org/en/stable/api/ogrgeometry_cpp.html#_CPPv4NK13OGRLineString18get_GeodesicLengthEPK19OGRSpatialReference</a></p>
<p>Python API:
<a href="https://gdal.org/en/stable/api/python/vector_api.html#osgeo.ogr.Geometry.GeodesicLength" target="_blank">https://gdal.org/en/stable/api/python/vector_api.html#osgeo.ogr.Geometry.GeodesicLength</a></p>
<p>Python examples:
<a href="https://github.com/OSGeo/gdal/blob/master/autotest/ogr/ogr_geom.py#L4560" target="_blank">https://github.com/OSGeo/gdal/blob/master/autotest/ogr/ogr_geom.py#L4560</a></p>
<span style="white-space:pre-wrap">
</span>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>