Skip to content
Permalink
Browse files

Move setting projection to after we have features

  • Loading branch information
NathanW2 committed Aug 13, 2011
1 parent 173c72d commit 0373a2623135804ff7008ba53350059fca555553
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/app/qgsmaptoolidentify.cpp
@@ -211,12 +211,6 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int

int featureCount = 0;

// init distance/area calculator
QgsDistanceArea calc;
calc.setProjectionsEnabled( mCanvas->hasCrsTransformEnabled() ); // project?
calc.setEllipsoid( ellipsoid );
calc.setSourceCrs( layer->crs().srsid() );

QgsFeatureList featureList;

// toLayerCoordinates will throw an exception for an 'invalid' point.
@@ -247,6 +241,14 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
QgsDebugMsg( QString( "Caught CRS exception %1" ).arg( cse.what() ) );
}

// init distance/area calculator
QgsDistanceArea calc;
if ( !featureList.count() == 0 )
{
calc.setProjectionsEnabled( mCanvas->hasCrsTransformEnabled() ); // project?
calc.setEllipsoid( ellipsoid );
calc.setSourceCrs( layer->crs().srsid() );
}
QgsFeatureList::iterator f_it = featureList.begin();

for ( ; f_it != featureList.end(); ++f_it )

0 comments on commit 0373a26

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