Skip to content
Permalink
Browse files

Fix #11589 - diagrams with OTF reprojection

  • Loading branch information
wonder-sk committed Feb 20, 2015
1 parent c3d9f10 commit c69f1533274fd395ddb7b446cfbef53dcb16249a
Showing with 17 additions and 2 deletions.
  1. +17 −2 src/core/qgspallabeling.cpp
@@ -3421,9 +3421,24 @@ void QgsPalLabeling::registerDiagramFeature( const QString& layerID, QgsFeature&
//convert geom to geos
QgsGeometry* geom = feat.geometry();

if ( layerIt.value().ct && staticWillUseLayer( layerID ) ) // reproject the geometry if feature not already transformed for labeling
// reproject the geometry if necessary (but don't modify the features
// geometry so that geometry based expression keep working)
QScopedPointer<QgsGeometry> clonedGeometry;
if ( layerIt.value().ct )
{
geom->transform( *( layerIt.value().ct ) );
geom = new QgsGeometry( *geom );
clonedGeometry.reset( geom );

try
{
geom->transform( *( layerIt.value().ct ) );
}
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsgLevel( QString( "Ignoring feature %1 due transformation exception" ).arg( feat.id() ), 4 );
return;
}
}

const GEOSGeometry* geos_geom = geom->asGeos();

0 comments on commit c69f153

Please sign in to comment.
You can’t perform that action at this time.