Skip to content
Permalink
Browse files
catch transformation exceptions in QgsGrassRegionEdit::transform
  • Loading branch information
jef-n committed Mar 7, 2012
1 parent 3bb9496 commit 6e20c54077baa8b6e5d0bbcc998bbdf279016e3f
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/plugins/grass/qgsgrassregion.cpp
@@ -132,14 +132,23 @@ void QgsGrassRegionEdit::setTransform()
void QgsGrassRegionEdit::transform( QgsMapCanvas *canvas, QVector<QgsPoint> &points, QgsCoordinateTransform *coordinateTransform, QgsCoordinateTransform::TransformDirection direction )
{
QgsDebugMsg( "Entered" );

/** Coordinate transform */
if ( canvas->mapRenderer()->hasCrsTransformEnabled() )
{
//QgsDebugMsg ( "srcCrs = " + coordinateTransform->sourceCrs().toWkt() );
//QgsDebugMsg ( "destCrs = " + coordinateTransform->destCRS().toWkt() );
for ( int i = 0; i < points.size(); i++ )
try
{
for ( int i = 0; i < points.size(); i++ )
{
points[i] = coordinateTransform->transform( points[i], direction );
}
}
catch ( QgsCsException &cse )
{
points[i] = coordinateTransform->transform( points[i], direction );
Q_UNUSED( cse );
QgsDebugMsg( QString( "transformation failed: %1" ).arg( cse.what() ) );
}
}
}

0 comments on commit 6e20c54

Please sign in to comment.