Skip to content
Permalink
Browse files
add perimeter to derived attributes for polygonal geometries
  • Loading branch information
alexbruy committed Nov 27, 2012
1 parent a757935 commit 8a339a71e00814cf64e6b8da66f6951effdca7bc
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/app/qgsmaptoolidentify.cpp
@@ -308,10 +308,14 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
else if ( layer->geometryType() == QGis::Polygon )
{
double area = calc.measure( f_it->geometry() );
double perimeter = calc.measurePerimeter( f_it->geometry() );
QGis::UnitType myDisplayUnits;
convertMeasurement( calc, area, myDisplayUnits, true ); // area and myDisplayUnits are out params
QString str = calc.textUnit( area, 3, myDisplayUnits, true );
derivedAttributes.insert( tr( "Area" ), str );
convertMeasurement( calc, perimeter, myDisplayUnits, false ); // area and myDisplayUnits are out params
str = calc.textUnit( perimeter, 3, myDisplayUnits, false );
derivedAttributes.insert( tr( "Perimeter" ), str );
}
else if ( layer->geometryType() == QGis::Point &&
( f_it->geometry()->wkbType() == QGis::WKBPoint ||

0 comments on commit 8a339a7

Please sign in to comment.