[QGIS Commit] r11981 - in trunk/qgis: src/analysis/vector tests/src/analysis

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Nov 7 15:30:43 EST 2009


Author: jef
Date: 2009-11-07 15:30:42 -0500 (Sat, 07 Nov 2009)
New Revision: 11981

Modified:
   trunk/qgis/src/analysis/vector/qgsgeometryanalyzer.h
   trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp
   trunk/qgis/tests/src/analysis/testqgsvectoranalyzer.cpp
Log:
fix build error in tests

Modified: trunk/qgis/src/analysis/vector/qgsgeometryanalyzer.h
===================================================================
--- trunk/qgis/src/analysis/vector/qgsgeometryanalyzer.h	2009-11-07 20:11:29 UTC (rev 11980)
+++ trunk/qgis/src/analysis/vector/qgsgeometryanalyzer.h	2009-11-07 20:30:42 UTC (rev 11981)
@@ -47,7 +47,7 @@
       @param onlySelectedFeatures if true, only selected features are considered, else all the features
       @param p progress dialog (or 0 if no progress dialog is to be shown)
       @note: added in version 1.4*/
-    bool simplify( QgsVectorLayer* layer, const QString& shapefileName, double tolerance, \
+    bool simplify( QgsVectorLayer* layer, const QString& shapefileName, double tolerance,
                  bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
 
     /**Calculate the true centroids, or 'center of mass' for a vector layer and 
@@ -58,7 +58,7 @@
       @param onlySelectedFeatures if true, only selected features are considered, else all the features
       @param p progress dialog (or 0 if no progress dialog is to be shown)
       @note: added in version 1.4*/
-    bool centroids( QgsVectorLayer* layer, const QString& shapefileName, \
+    bool centroids( QgsVectorLayer* layer, const QString& shapefileName,
                  bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
 
     /**Create a polygon based on the extent of all (selected) features and write it to a new shape file
@@ -80,7 +80,7 @@
       @param bufferDistanceField index of the attribute field that contains the buffer distance (or -1 if all features have the same buffer distance)
       @param p progress dialog (or 0 if no progress dialog is to be shown)
       @note: added in version 1.3*/
-    bool buffer( QgsVectorLayer* layer, const QString& shapefileName, double bufferDistance, \
+    bool buffer( QgsVectorLayer* layer, const QString& shapefileName, double bufferDistance,
                  bool onlySelectedFeatures = false, bool dissolve = false, int bufferDistanceField = -1, QProgressDialog* p = 0 );
 
     /**Create convex hull(s) of a vector layer and write it to a new shape file
@@ -92,7 +92,7 @@
       all features have the same buffer distance)
       @param p progress dialog (or 0 if no progress dialog is to be shown)
       @note: added in version 1.4*/
-    bool convexHull( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, \
+    bool convexHull( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
                      int uniqueIdField = -1, QProgressDialog* p = 0 );
 
     /**Dissolve a vector layer and write it to a new shape file
@@ -104,7 +104,7 @@
       all features should be dissolved together)
       @param p progress dialog (or 0 if no progress dialog is to be shown)
       @note: added in version 1.4*/
-    bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, \
+    bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
                      int uniqueIdField = -1, QProgressDialog* p = 0 );
 
   private:
@@ -116,7 +116,7 @@
     /**Helper function to get the cetroid of an individual feature*/
     void centroidFeature( QgsFeature& f, QgsVectorFileWriter* vfw );
     /**Helper function to buffer an individual feature*/
-    void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFileWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry, \
+    void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFileWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry,
                         double bufferDistance, int bufferDistanceField );
     /**Helper function to get the convex hull of feature(s)*/
     void convexFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry** dissolveGeometry );

Modified: trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp
===================================================================
--- trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp	2009-11-07 20:11:29 UTC (rev 11980)
+++ trunk/qgis/src/analysis/vector/qgszonalstatistics.cpp	2009-11-07 20:30:42 UTC (rev 11981)
@@ -41,7 +41,7 @@
 
 int QgsZonalStatistics::calculateStatistics(QProgressDialog* p)
 {
-  if(!mPolygonLayer || !mPolygonLayer->geometryType() == QGis::Polygon)
+  if(!mPolygonLayer || mPolygonLayer->geometryType() != QGis::Polygon)
   {
     return 1;
   }
@@ -170,7 +170,6 @@
     cellCenterY = rasterBBox.yMaximum() - offsetY * cellsizeY - cellsizeY / 2;
     count = 0;
     sum = 0;
-    float currentValue;
 
     for(int i = 0; i < nCellsY; ++i)
     {

Modified: trunk/qgis/tests/src/analysis/testqgsvectoranalyzer.cpp
===================================================================
--- trunk/qgis/tests/src/analysis/testqgsvectoranalyzer.cpp	2009-11-07 20:11:29 UTC (rev 11980)
+++ trunk/qgis/tests/src/analysis/testqgsvectoranalyzer.cpp	2009-11-07 20:30:42 UTC (rev 11981)
@@ -114,9 +114,8 @@
 {
   QString myTmpDir = QDir::tempPath() + QDir::separator() ;
   QString myFileName = myTmpDir +  "simplify_layer.shp";
-  QVERIFY( mAnalyzer.simplifyGeometry( mpLineLayer,
+  QVERIFY( mAnalyzer.simplify( mpLineLayer,
                              myFileName,
-                             "UTF-8",
                              1.0 ) );
 }
 
@@ -124,14 +123,14 @@
 {
   QString myTmpDir = QDir::tempPath() + QDir::separator() ;
   QString myFileName = myTmpDir +  "centroid_layer.shp";
-  QVERIFY( mAnalyzer.polygonCentroids( mpPolyLayer, myFileName, "UTF-8" ) );
+  QVERIFY( mAnalyzer.centroids( mpPolyLayer, myFileName ) );
 }
 
 void TestQgsVectorAnalyzer::layerExtent(  )
 {
   QString myTmpDir = QDir::tempPath() + QDir::separator() ;
   QString myFileName = myTmpDir +  "extent_layer.shp";
-  QVERIFY( mAnalyzer.layerExtent( mpPointLayer, myFileName, "UTF-8" ) );
+  QVERIFY( mAnalyzer.extent( mpPointLayer, myFileName ) );
 }
 
 QTEST_MAIN( TestQgsVectorAnalyzer )



More information about the QGIS-commit mailing list