Skip to content

Commit

Permalink
Update some test results to pass with GDAL 3/proj 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 11, 2019
1 parent 7c8d87c commit 6b5f1da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions tests/src/core/testqgscoordinatereferencesystem.cpp
Expand Up @@ -680,11 +680,20 @@ void TestQgsCoordinateReferenceSystem::toWkt()
QString myWkt = myCrs.toWkt();
debugPrint( myCrs );
//Note: this is not the same as GEOWKT as OGR strips off the TOWGS clause...
#if PJ_VERSION < 600
QString myStrippedWkt( "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID"
"[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"
"AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"
"[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY"
"[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]" );
#else
QString myStrippedWkt( "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID"
"[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],"
"AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY"
"[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY"
"[\"EPSG\",\"9122\"]],AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST]"
",AUTHORITY[\"EPSG\",\"4326\"]]" );
#endif
qDebug() << "wkt: " << myWkt;
qDebug() << "stripped: " << myStrippedWkt;
QVERIFY( myWkt == myStrippedWkt );
Expand Down Expand Up @@ -915,12 +924,12 @@ void TestQgsCoordinateReferenceSystem::geoCcsDescription()
crs.createFromString( QStringLiteral( "EPSG:4340" ) );
QVERIFY( crs.isValid() );
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4340" ) );
QCOMPARE( crs.description(), QStringLiteral( "Australian Antarctic (geocentric)" ) );
QVERIFY( crs.description().startsWith( QStringLiteral( "Australian Antarctic" ) ) );

crs.createFromString( QStringLiteral( "EPSG:4348" ) );
QVERIFY( crs.isValid() );
QCOMPARE( crs.authid(), QStringLiteral( "EPSG:4348" ) );
QCOMPARE( crs.description(), QStringLiteral( "GDA94 (geocentric)" ) );
QVERIFY( crs.description().startsWith( QStringLiteral( "GDA94" ) ) );
}
QGSTEST_MAIN( TestQgsCoordinateReferenceSystem )
#include "testqgscoordinatereferencesystem.moc"
10 changes: 5 additions & 5 deletions tests/src/core/testqgscoordinatetransform.cpp
Expand Up @@ -225,7 +225,7 @@ void TestQgsCoordinateTransform::scaleFactor()
QgsCoordinateTransform ct( sourceCrs, destCrs, QgsProject::instance() );

// qDebug() << QString::number(ct.scaleFactor( rect ), 'g', 17) ;
QVERIFY( qgsDoubleNear( ct.scaleFactor( rect ), factor ) );
QGSCOMPARENEAR( ct.scaleFactor( rect ), factor, 0.000001 );
}

void TestQgsCoordinateTransform::scaleFactor_data()
Expand All @@ -241,10 +241,10 @@ void TestQgsCoordinateTransform::scaleFactor_data()
<< QgsRectangle( 2550000, 1200000, 2550100, 1200100 )
<< 1.1223316038381985e-5;
QTest::newRow( "Same map units" )
<< QgsCoordinateReferenceSystem::fromEpsgId( 2056 )
<< QgsCoordinateReferenceSystem::fromEpsgId( 21781 )
<< QgsRectangle( 2550000, 1200000, 2550100, 1200100 )
<< 1.0000000000248837;
<< QgsCoordinateReferenceSystem::fromEpsgId( 3111 )
<< QgsCoordinateReferenceSystem::fromEpsgId( 28355 )
<< QgsRectangle( 2560536.7, 2331787.5, 2653161.1, 2427370.4 )
<< 0.999632;
QTest::newRow( "Same CRS" )
<< QgsCoordinateReferenceSystem::fromEpsgId( 2056 )
<< QgsCoordinateReferenceSystem::fromEpsgId( 2056 )
Expand Down

0 comments on commit 6b5f1da

Please sign in to comment.