[QGIS Commit] r11342 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Aug 11 03:32:39 EDT 2009


Author: homann
Date: 2009-08-11 03:32:37 -0400 (Tue, 11 Aug 2009)
New Revision: 11342

Modified:
   trunk/qgis/src/app/qgsmeasuredialog.cpp
Log:
Fixed conversion of areas

Modified: trunk/qgis/src/app/qgsmeasuredialog.cpp
===================================================================
--- trunk/qgis/src/app/qgsmeasuredialog.cpp	2009-08-10 22:36:47 UTC (rev 11341)
+++ trunk/qgis/src/app/qgsmeasuredialog.cpp	2009-08-11 07:32:37 UTC (rev 11342)
@@ -90,9 +90,6 @@
     QList<QgsPoint> tmpPoints = mTool->points();
     tmpPoints.append( point );
     double area = mTool->canvas()->mapRenderer()->distanceArea()->measurePolygon( tmpPoints );
-    QGis::UnitType myDisplayUnits;
-    // Ignore units
-    convertMeasurement( area, myDisplayUnits, true );
     editTotal->setText( formatArea( area ) );
   }
   else if ( !mMeasureArea && mTool->points().size() > 0 )
@@ -115,9 +112,6 @@
   if ( mMeasureArea && numPoints > 2 )
   {
     double area = mTool->canvas()->mapRenderer()->distanceArea()->measurePolygon( mTool->points() );
-    QGis::UnitType myDisplayUnits;
-    // Ignore units
-    convertMeasurement( area, myDisplayUnits, true );
     editTotal->setText( formatArea( area ) );
   }
   else if ( !mMeasureArea && numPoints > 1 )
@@ -246,6 +240,7 @@
   {
     // Measuring on an ellipsoid returns meters
     myUnits = QGis::Meters;
+    QgsDebugMsg( "We're measuring on an ellipsoid, returning meters" );
   }
 
   // Get the units for display
@@ -255,20 +250,24 @@
   // Only convert between meters and feet
   if ( myUnits == QGis::Meters && myDisplayUnitsTxt == "feet" )
   {
+    QgsDebugMsg( QString( "Converting %1 meters" ).arg( QString::number( measure ) ) );
     measure /= 0.3048;
     if ( isArea )
     {
       measure /= 0.3048;
     }
+    QgsDebugMsg( QString( "to %1 feet" ).arg( QString::number( measure ) ) );
     myUnits = QGis::Feet;
   }
   if ( myUnits == QGis::Feet && myDisplayUnitsTxt == "meters" )
   {
-    measure *= 0.3048 * 0.3048;
+    QgsDebugMsg( QString( "Converting %1 feet" ).arg( QString::number( measure ) ) );
+    measure *= 0.3048;
     if ( isArea )
     {
       measure *= 0.3048;
     }
+    QgsDebugMsg( QString( "to %1 meters" ).arg( QString::number( measure ) ) );
     myUnits = QGis::Meters;
   }
   



More information about the QGIS-commit mailing list