Skip to content
Permalink
Browse files

Merge pull request #37 from NathanW2/identify-patch

Move setting of projection to after we have features for identify feature tool.
  • Loading branch information
wonder-sk committed Aug 18, 2011
2 parents 0ba0f93 + 0373a26 commit b0b28f5df7d9b8a5c87a922ffcad6f7e62372bd4
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 b0b28f5

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