Skip to content

Commit

Permalink
fix build error in tests
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11981 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 7, 2009
1 parent 19bc6ff commit 3e9d102
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/analysis/vector/qgsgeometryanalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@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
Expand All @@ -58,7 +58,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@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
Expand All @@ -80,7 +80,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
@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
Expand All @@ -92,7 +92,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
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
Expand All @@ -104,7 +104,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
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:
Expand All @@ -116,7 +116,7 @@ class ANALYSIS_EXPORT QgsGeometryAnalyzer
/**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 );
Expand Down
3 changes: 1 addition & 2 deletions src/analysis/vector/qgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ QgsZonalStatistics::~QgsZonalStatistics()

int QgsZonalStatistics::calculateStatistics(QProgressDialog* p)
{
if(!mPolygonLayer || !mPolygonLayer->geometryType() == QGis::Polygon)
if(!mPolygonLayer || mPolygonLayer->geometryType() != QGis::Polygon)
{
return 1;
}
Expand Down Expand Up @@ -170,7 +170,6 @@ int QgsZonalStatistics::calculateStatistics(QProgressDialog* p)
cellCenterY = rasterBBox.yMaximum() - offsetY * cellsizeY - cellsizeY / 2;
count = 0;
sum = 0;
float currentValue;

for(int i = 0; i < nCellsY; ++i)
{
Expand Down
7 changes: 3 additions & 4 deletions tests/src/analysis/testqgsvectoranalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,24 +114,23 @@ void TestQgsVectorAnalyzer::simplifyGeometry( )
{
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 ) );
}

void TestQgsVectorAnalyzer::polygonCentroids( )
{
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 )
Expand Down

0 comments on commit 3e9d102

Please sign in to comment.