Skip to content

Commit

Permalink
Catch errors when reprojecting for GeoJSON export
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 9, 2016
1 parent 9ea56ac commit 718c5fd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/qgsjsonutils.cpp
Expand Up @@ -78,10 +78,18 @@ QString QgsJSONExporter::exportFeature( const QgsFeature& feature, const QVarian
if ( mCrs.isValid() )
{
QgsGeometry* clone = new QgsGeometry( *geom );
if ( clone->transform( mTransform ) == 0 )
exportGeom = clone;
else
try
{
if ( clone->transform( mTransform ) == 0 )
exportGeom = clone;
else
delete clone;
}
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
delete clone;
}
}
QgsRectangle box = exportGeom->boundingBox();

Expand Down

0 comments on commit 718c5fd

Please sign in to comment.