Hi all<br><br>I&#39;m doing the following to transform coordinates:<br><br><div style="margin-left: 40px;"><i>ct = QgsCoordinateTransform()</i><br><i>ct.setSourceCrs(sourceCRS)</i><br><i>ct.setDestCRS(destinationCRS)</i><br>
<i>point1 = ct.transform(aPoint)</i><br></div><br>Everything works fine, until the users enters coordinates that are invalid for the source CRS. Qgis crashes with the following errors:<br><br><div style="margin-left: 40px;">
<i>qgscoordinatetransform.cpp: 485: (transformCoords) Projection failed emitting invalid transform signal: forward transform of (44038.4, -33923.3)</i><br><i>failed with error: latitude or longitude exceeded limits</i><br>
<br><i>qgscoordinatetransform.cpp: 489: (transformCoords) throwing exception</i><br><i>qgscoordinatetransform.cpp: 226: (transform) rethrowing exception</i><br><i>terminate called after throwing an instance of &#39;QgsCsException&#39;</i><br>
<i>Aborted</i><br></div><br>I&#39;ve tried to catch <i>QgsCsException, </i>but <i>qgscoordinatetransform </i>still terminates Qgis before the exception can be caught.<br>I&#39;ve also tried connecting the <a class="el" href="http://doc.qgis.org/stable/classQgsCoordinateTransform.html#3aef3d008b1f5fad21aeb0f8930fdd38">invalidTransformInput</a>() signal, which successfully executes (but Qgis is still terminated afterwards). <br>
<br>Is there a way to test the coordinates before trying to transform them, since I will be out of my control what the user enters? I can&#39;t find anything in  QgsCoordinateTransform.<br><br>Thank you<br><br>Chris<br>