Skip to content
Permalink
Browse files

Merge pull request #3330 from nyalldawson/gdal_tests

Backport GDAL test fixes to 2.14
  • Loading branch information
nyalldawson committed Jul 23, 2016
2 parents 2ebd0eb + 4f6422a commit c78683b043c546a59f9f5a0d8a128d705b15c899
@@ -169,7 +169,7 @@ class TestAlignRaster : public QObject
QgsAlignRaster align;
QgsAlignRaster::List rasters;
rasters << QgsAlignRaster::Item( SRC_FILE, tmpFile );
rasters[0].resampleMethod = QgsAlignRaster::RA_Bilinear;
rasters[0].resampleMethod = QgsAlignRaster::RA_Average;
align.setRasters( rasters );
align.setParametersFromRaster( SRC_FILE, QString(), QSizeF( 0.4, 0.4 ) );
bool res = align.run();
@@ -190,7 +190,7 @@ class TestAlignRaster : public QObject
QgsAlignRaster align;
QgsAlignRaster::List rasters;
rasters << QgsAlignRaster::Item( SRC_FILE, tmpFile );
rasters[0].resampleMethod = QgsAlignRaster::RA_Bilinear;
rasters[0].resampleMethod = QgsAlignRaster::RA_Average;
rasters[0].rescaleValues = true;
align.setRasters( rasters );
align.setParametersFromRaster( SRC_FILE, QString(), QSizeF( 0.4, 0.4 ) );
@@ -214,8 +214,14 @@ void TestQgsCoordinateReferenceSystem::createFromESRIWkt()
myWktStrings << "GEOGCS[\"GCS_South_American_1969\",DATUM[\"D_South_American_1969\",SPHEROID[\"GRS_1967_Truncated\",6378160.0,298.25]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]";
myFiles << "";
myGdalVersionOK << 1900;
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
//proj definition for EPSG:4618 was updated in GDAL 2.0 - see https://github.com/OSGeo/proj.4/issues/241
myProj4Strings << "+proj=longlat +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +no_defs";
myTOWGS84Strings << "+towgs84=-66.87,4.37,-38.52,0,0,0,0";
#else
myProj4Strings << "+proj=longlat +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +no_defs";
myTOWGS84Strings << "+towgs84=-57,1,-41,0,0,0,0";
#endif
myAuthIdStrings << "EPSG:4618";

// do test with WKT definitions
@@ -372,12 +372,11 @@ void TestQgsRasterLayer::checkStats()
//QVERIFY( myStatistics.elementCount == 100 );
QVERIFY( myStatistics.minimumValue == 0 );
QVERIFY( myStatistics.maximumValue == 9 );
QVERIFY( myStatistics.mean == 4.5 );
QVERIFY( qgsDoubleNear( myStatistics.mean, 4.5 ) );
double stdDev = 2.87228132326901431;
// TODO: verify why GDAL stdDev is so different from generic (2.88675)
mReport += QString( "stdDev = %1 expected = %2<br>\n" ).arg( myStatistics.stdDev ).arg( stdDev );
QVERIFY( fabs( myStatistics.stdDev - stdDev )
< 0.0000000000000001 );
QVERIFY( qgsDoubleNear( myStatistics.stdDev, stdDev, 0.00000000000001 ) );
mReport += "<p>Passed</p>";
}

0 comments on commit c78683b

Please sign in to comment.
You can’t perform that action at this time.