Skip to content

Commit f794b2f

Browse files
author
jef
committed
fix build error in tests
git-svn-id: http://svn.osgeo.org/qgis/trunk@11981 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4573fd4 commit f794b2f

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

src/analysis/vector/qgsgeometryanalyzer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
4747
@param onlySelectedFeatures if true, only selected features are considered, else all the features
4848
@param p progress dialog (or 0 if no progress dialog is to be shown)
4949
@note: added in version 1.4*/
50-
bool simplify( QgsVectorLayer* layer, const QString& shapefileName, double tolerance, \
50+
bool simplify( QgsVectorLayer* layer, const QString& shapefileName, double tolerance,
5151
bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
5252

5353
/**Calculate the true centroids, or 'center of mass' for a vector layer and
@@ -58,7 +58,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
5858
@param onlySelectedFeatures if true, only selected features are considered, else all the features
5959
@param p progress dialog (or 0 if no progress dialog is to be shown)
6060
@note: added in version 1.4*/
61-
bool centroids( QgsVectorLayer* layer, const QString& shapefileName, \
61+
bool centroids( QgsVectorLayer* layer, const QString& shapefileName,
6262
bool onlySelectedFeatures = false, QProgressDialog* p = 0 );
6363

6464
/**Create a polygon based on the extent of all (selected) features and write it to a new shape file
@@ -80,7 +80,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
8080
@param bufferDistanceField index of the attribute field that contains the buffer distance (or -1 if all features have the same buffer distance)
8181
@param p progress dialog (or 0 if no progress dialog is to be shown)
8282
@note: added in version 1.3*/
83-
bool buffer( QgsVectorLayer* layer, const QString& shapefileName, double bufferDistance, \
83+
bool buffer( QgsVectorLayer* layer, const QString& shapefileName, double bufferDistance,
8484
bool onlySelectedFeatures = false, bool dissolve = false, int bufferDistanceField = -1, QProgressDialog* p = 0 );
8585

8686
/**Create convex hull(s) of a vector layer and write it to a new shape file
@@ -92,7 +92,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
9292
all features have the same buffer distance)
9393
@param p progress dialog (or 0 if no progress dialog is to be shown)
9494
@note: added in version 1.4*/
95-
bool convexHull( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, \
95+
bool convexHull( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
9696
int uniqueIdField = -1, QProgressDialog* p = 0 );
9797

9898
/**Dissolve a vector layer and write it to a new shape file
@@ -104,7 +104,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
104104
all features should be dissolved together)
105105
@param p progress dialog (or 0 if no progress dialog is to be shown)
106106
@note: added in version 1.4*/
107-
bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false, \
107+
bool dissolve( QgsVectorLayer* layer, const QString& shapefileName, bool onlySelectedFeatures = false,
108108
int uniqueIdField = -1, QProgressDialog* p = 0 );
109109

110110
private:
@@ -116,7 +116,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
116116
/**Helper function to get the cetroid of an individual feature*/
117117
void centroidFeature( QgsFeature& f, QgsVectorFileWriter* vfw );
118118
/**Helper function to buffer an individual feature*/
119-
void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFileWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry, \
119+
void bufferFeature( QgsFeature& f, int nProcessedFeatures, QgsVectorFileWriter* vfw, bool dissolve, QgsGeometry** dissolveGeometry,
120120
double bufferDistance, int bufferDistanceField );
121121
/**Helper function to get the convex hull of feature(s)*/
122122
void convexFeature( QgsFeature& f, int nProcessedFeatures, QgsGeometry** dissolveGeometry );

src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ QgsZonalStatistics::~QgsZonalStatistics()
4141

4242
int QgsZonalStatistics::calculateStatistics(QProgressDialog* p)
4343
{
44-
if(!mPolygonLayer || !mPolygonLayer->geometryType() == QGis::Polygon)
44+
if(!mPolygonLayer || mPolygonLayer->geometryType() != QGis::Polygon)
4545
{
4646
return 1;
4747
}
@@ -170,7 +170,6 @@ int QgsZonalStatistics::calculateStatistics(QProgressDialog* p)
170170
cellCenterY = rasterBBox.yMaximum() - offsetY * cellsizeY - cellsizeY / 2;
171171
count = 0;
172172
sum = 0;
173-
float currentValue;
174173

175174
for(int i = 0; i < nCellsY; ++i)
176175
{

tests/src/analysis/testqgsvectoranalyzer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,23 @@ void TestQgsVectorAnalyzer::simplifyGeometry( )
114114
{
115115
QString myTmpDir = QDir::tempPath() + QDir::separator() ;
116116
QString myFileName = myTmpDir + "simplify_layer.shp";
117-
QVERIFY( mAnalyzer.simplifyGeometry( mpLineLayer,
117+
QVERIFY( mAnalyzer.simplify( mpLineLayer,
118118
myFileName,
119-
"UTF-8",
120119
1.0 ) );
121120
}
122121

123122
void TestQgsVectorAnalyzer::polygonCentroids( )
124123
{
125124
QString myTmpDir = QDir::tempPath() + QDir::separator() ;
126125
QString myFileName = myTmpDir + "centroid_layer.shp";
127-
QVERIFY( mAnalyzer.polygonCentroids( mpPolyLayer, myFileName, "UTF-8" ) );
126+
QVERIFY( mAnalyzer.centroids( mpPolyLayer, myFileName ) );
128127
}
129128

130129
void TestQgsVectorAnalyzer::layerExtent( )
131130
{
132131
QString myTmpDir = QDir::tempPath() + QDir::separator() ;
133132
QString myFileName = myTmpDir + "extent_layer.shp";
134-
QVERIFY( mAnalyzer.layerExtent( mpPointLayer, myFileName, "UTF-8" ) );
133+
QVERIFY( mAnalyzer.extent( mpPointLayer, myFileName ) );
135134
}
136135

137136
QTEST_MAIN( TestQgsVectorAnalyzer )

0 commit comments

Comments
 (0)