Skip to content

Commit

Permalink
catch transformation exceptions in pal labeling (fixes #7730)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 19, 2013
1 parent 5ab0df5 commit 6831498
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/core/qgspallabeling.cpp
Expand Up @@ -1771,7 +1771,17 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
}

if ( ct ) // reproject the geometry if necessary
geom->transform( *ct );
{
try
{
geom->transform( *ct );
}
catch ( QgsCsException &cse )
{
QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception" ).arg( f.id() ), 4 );
return;
}
}

if ( !checkMinimumSizeMM( context, geom, minFeatureSize ) )
{
Expand Down Expand Up @@ -2069,7 +2079,15 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f
double z = 0;
if ( ct )
{
ct->transformInPlace( xPos, yPos, z );
try
{
ct->transformInPlace( xPos, yPos, z );
}
catch ( QgsCsException &e )
{
QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception on data-defined position" ).arg( f.id() ), 4 );
return;
}
}

xPos += xdiff;
Expand Down

0 comments on commit 6831498

Please sign in to comment.