Skip to content
Permalink
Browse files
Catch transform exceptions
  • Loading branch information
m-kuhn committed Sep 30, 2018
1 parent 9a19ba3 commit bdbd294e666228b2323206b07cfb0cf74f9e6f1d
@@ -65,8 +65,15 @@ QgsGeometryCheckError::QgsGeometryCheckError( const QgsGeometryCheck *check,
if ( vl )
{
QgsCoordinateTransform ct( vl->crs(), check->context()->mapCrs, check->context()->transformContext );
mGeometry.transform( ct );
mErrorLocation = ct.transform( mErrorLocation );
try
{
mGeometry.transform( ct );
mErrorLocation = ct.transform( mErrorLocation );
}
catch ( const QgsCsException &e )
{
QgsDebugMsg( "Can not show error in current map coordinate reference system" );
}
}
}
}
@@ -41,7 +41,14 @@ QgsGeometryCheckerUtils::LayerFeature::LayerFeature( const QgsFeaturePool *pool,
const QgsCoordinateTransform transform( pool->crs(), context->mapCrs, context->transformContext );
if ( useMapCrs && context->mapCrs.isValid() && !transform.isShortCircuited() )
{
mGeometry.transform( transform );
try
{
mGeometry.transform( transform );
}
catch ( const QgsCsException &e )
{
QgsDebugMsg( "Shrug. What shall we do with a geometry that cannot be converted?" );
}
}
}

0 comments on commit bdbd294

Please sign in to comment.