Skip to content
Permalink
Browse files
fix #1252
git-svn-id: http://svn.osgeo.org/qgis/trunk@9211 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 29, 2008
1 parent 88db1f6 commit dec5ffc8671b2e2805615883c2e2f947cb3851ea
Showing with 13 additions and 10 deletions.
  1. +13 −10 src/app/qgsmaptoolidentify.cpp
@@ -266,7 +266,7 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )
layer->select( layer->pendingAllAttributesList(), r, true, true );
QgsFeature f;
while ( layer->getNextFeature( f ) )
mFeatureList << QgsFeature(f);
mFeatureList << QgsFeature( f );

QApplication::restoreOverrideCursor();

@@ -334,15 +334,18 @@ void QgsMapToolIdentify::identifyVectorLayer( const QgsPoint& point )
double dist = calc.measure( f_it->geometry() );
QString str = calc.textUnit( dist, 3, mCanvas->mapUnits(), false );
mResults->addDerivedAttribute( featureNode, QObject::tr( "Length" ), str );
// Add the start and end points in as derived attributes
str.setNum( f_it->geometry()->asPolyline().first().x(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "startX", str );
str.setNum( f_it->geometry()->asPolyline().first().y(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "startY", str );
str.setNum( f_it->geometry()->asPolyline().last().x(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "endX", str );
str.setNum( f_it->geometry()->asPolyline().last().y(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "endY", str );
if ( f_it->geometry()->wkbType() == QGis::WKBLineString )
{
// Add the start and end points in as derived attributes
str.setNum( f_it->geometry()->asPolyline().first().x(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "startX", str );
str.setNum( f_it->geometry()->asPolyline().first().y(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "startY", str );
str.setNum( f_it->geometry()->asPolyline().last().x(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "endX", str );
str.setNum( f_it->geometry()->asPolyline().last().y(), 'g', 10 );
mResults->addDerivedAttribute( featureNode, "endY", str );
}
}
else if ( layer->vectorType() == QGis::Polygon )
{

0 comments on commit dec5ffc

Please sign in to comment.