Skip to content
Permalink
Browse files
apply #2692. Thanks again Jeremy.
git-svn-id: http://svn.osgeo.org/qgis/trunk@13471 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 12, 2010
1 parent 64d2fc8 commit a78b51e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
@@ -295,7 +295,8 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
convertMeasurement( calc, dist, myDisplayUnits, false );
QString str = calc.textUnit( dist, 3, myDisplayUnits, false ); // dist and myDisplayUnits are out params
derivedAttributes.insert( tr( "Length" ), str );
if ( f_it->geometry()->wkbType() == QGis::WKBLineString )
if ( f_it->geometry()->wkbType() == QGis::WKBLineString ||
f_it->geometry()->wkbType() == QGis::WKBLineString25D )
{
// Add the start and end points in as derived attributes
str = QLocale::system().toString( f_it->geometry()->asPolyline().first().x(), 'g', 10 );
@@ -316,7 +317,9 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
QString str = calc.textUnit( area, 3, myDisplayUnits, true );
derivedAttributes.insert( tr( "Area" ), str );
}
else if ( layer->geometryType() == QGis::Point )
else if ( layer->geometryType() == QGis::Point &&
( f_it->geometry()->wkbType() == QGis::WKBPoint ||
f_it->geometry()->wkbType() == QGis::WKBPoint25D ) )
{
// Include the x and y coordinates of the point as a derived attribute
QString str;
@@ -202,19 +202,20 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
for ( int i = 0; i < mpt.size(); ++i )
{
QgsPoint pt = mpt[i];
mPoints.push_back( QList<QgsPoint>() );
if ( layer )
{
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false, i );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false, i );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false, i );
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false, i );
}
else
{
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false, i );
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false, i );
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false, i );
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false, i );
}
}
}
@@ -248,8 +249,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
QgsMultiPolyline mline = geom->asMultiPolyline();
for ( int i = 0; i < mline.size(); ++i )
{
QList<QgsPoint> newList;
mPoints.push_back( newList );
mPoints.push_back( QList<QgsPoint>() );
QgsPolyline line = mline[i];
for ( int j = 0; j < line.size(); ++j )
{
@@ -295,8 +295,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
QgsMultiPolygon multipoly = geom->asMultiPolygon();
for ( int i = 0; i < multipoly.size(); ++i )
{
QList<QgsPoint> newList;
mPoints.push_back( newList );
mPoints.push_back( QList<QgsPoint>() );
QgsPolygon poly = multipoly[i];
QgsPolyline line = poly[0];
for ( int j = 0; j < line.count(); ++j )

0 comments on commit a78b51e

Please sign in to comment.