Skip to content

Commit bdbd294

Browse files
committed
Catch transform exceptions
1 parent 9a19ba3 commit bdbd294

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/analysis/vector/geometry_checker/qgsgeometrycheckerror.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,15 @@ QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check,
6565
if ( vl )
6666
{
6767
QgsCoordinateTransform ct( vl->crs(), check->context()->mapCrs, check->context()->transformContext );
68-
mGeometry.transform( ct );
69-
mErrorLocation = ct.transform( mErrorLocation );
68+
try
69+
{
70+
mGeometry.transform( ct );
71+
mErrorLocation = ct.transform( mErrorLocation );
72+
}
73+
catch ( const QgsCsException &e )
74+
{
75+
QgsDebugMsg( "Can not show error in current map coordinate reference system" );
76+
}
7077
}
7178
}
7279
}

src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ QgsGeometryCheckerUtils::LayerFeature::LayerFeature( const QgsFeaturePool *pool,
4141
const QgsCoordinateTransform transform( pool->crs(), context->mapCrs, context->transformContext );
4242
if ( useMapCrs && context->mapCrs.isValid() && !transform.isShortCircuited() )
4343
{
44-
mGeometry.transform( transform );
44+
try
45+
{
46+
mGeometry.transform( transform );
47+
}
48+
catch ( const QgsCsException &e )
49+
{
50+
QgsDebugMsg( "Shrug. What shall we do with a geometry that cannot be converted?" );
51+
}
4552
}
4653
}
4754

0 commit comments

Comments
 (0)