Skip to content
Permalink
Browse files

Move setting projection to after we have features

  • Loading branch information
NathanW2 authored and timlinux committed Sep 7, 2011
1 parent ad817fc commit 5b63060d5c9efb5ed8b2fd4376c45946319ba73e
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/app/qgsmaptoolidentify.cpp
@@ -210,12 +210,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.
@@ -246,6 +240,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 5b63060

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