Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Catch transform exceptions
- Loading branch information
|
@@ -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?" ); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|