<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 13.2pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">I simply try to convert a point from local Cartesian ENU centered on a point with lat,lon coordinates to geocentric ECEF coordinates.</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 13.2pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">With proj from command line all works well. I use strings from proj to create QGIS CRS, and it seems all works well, i receive true in return code.</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 13.2pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">But when i try to convert i receive I receive:</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">Error transforming "forward transform of\n (inf,inf)\n Error: Fallback transformation failed"</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">Is there any issues in qgis 3.22 LTS ?</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">This is C++ code.</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; background: #f9f8f6; vertical-align: baseline;"><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;">void geoutils::TopoToECEF(const QgsPointXY &origin, const QgsPointXY &point, QgsPointXY &point_wgs)</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;">{</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> try {</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> QgsCoordinateReferenceSystem geocentricCRS;</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> QString projStringGeocentric = "+proj=cart +ellps=GRS80"; //ECEF CRS</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> bool res= geocentricCRS.<wbr>createFromProj(<wbr>projStringGeocentric)<wbr>;<wbr></span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> qDebug() << "result 1 is " << res << geocentricCRS.toProj(); // this return true !!!</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> QgsCoordinateReferenceSystem topocentricCRS;</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> QString projStringTopocentric = "+proj=topocentric +ellps=WGS84";</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> projStringTopocentric += " +lon_0=9"; // origin lon</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> projStringTopocentric += " +lat_0=44"; // origin lat</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> projStringTopocentric += " +h_0=0 +units=m"; //</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> res = topocentricCRS.<wbr>createFromProj(<wbr>projStringTopocentric)<wbr>;<wbr></span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> qDebug() << "result 2 is " << res << topocentricCRS.toProj(); //this return true !!!</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> QgsProject:<wbr>:<wbr>instance(<wbr>)<wbr>->setCrs(<wbr>geocentricCRS)<wbr>;<wbr></span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> QgsCoordinateTransform *xformerFromTopocentricToGeoce<wbr>ntric = new QgsCoordinateTransform(<wbr>topocentricCRS,<wbr> geocentricCRS, QgsProject::instance()); <wbr> // src, dest, proj</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> qDebug() << "TopoToECEF Input point x: " << point.x() << " y: "<< point.y();</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> point_wgs = xformerFromToTopocentricToWgs8<wbr>4->transform(point)<wbr>;<wbr> <wbr> <wbr>// this BOOOMMMSS : </span><span style="font-size: 11.5pt; font-family: 'inherit', serif; color: #232629;">forward transform of\n (inf,inf)\n Error: Fallback transformation failed</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> qDebug() << "TopoToECEF - Output x: " << point_wgs.x() << " y: "<< point_wgs.y();</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> } catch (const QgsException& e) {</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> qDebug() << "error transforming " << e.what();</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> </span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;"> }</span></p>
<p class="MsoNormal" style="font-family: Calibri, sans-serif; margin: 0cm 0cm 0.0001pt; font-size: 11pt; vertical-align: baseline;"><span style="font-size: 10pt; font-family: 'var(--ff-mono)', serif; border: 1pt none windowtext; padding: 0cm;">}</span></p>
</body>
</html>