Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 dec5ffc
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/app/qgsmaptoolidentify.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit dec5ffc

Please sign in to comment.