Skip to content

Commit

Permalink
Disable geometry z value transform tests on proj 6+, because QGIS
Browse files Browse the repository at this point in the history
currently doesn't support compound CRS definitions and these are
required for vertical transforms on proj 6+
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 0feffd9 commit 5ba9950
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/src/core/testqgsgeometry.cpp
Expand Up @@ -952,12 +952,13 @@ void TestQgsGeometry::point()
QGSCOMPARENEAR( p16.y(), -3626584, 1 );
QGSCOMPARENEAR( p16.z(), 1.0, 0.001 );
QCOMPARE( p16.m(), 2.0 );
#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//test with z transform
p16.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
QGSCOMPARENEAR( p16.z(), -19.249, 0.001 );
p16.transform( tr, QgsCoordinateTransform::ReverseTransform, true );
QGSCOMPARENEAR( p16.z(), 1.0, 0.001 );

#endif
//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
QgsPoint p17( QgsWkbTypes::PointZM, 10, 20, 30, 40 );
Expand Down Expand Up @@ -2024,13 +2025,15 @@ void TestQgsGeometry::circularString()
QGSCOMPARENEAR( l22.pointN( 1 ).z(), 3, 0.001 );
QCOMPARE( l22.pointN( 1 ).m(), 4.0 );

#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
l22.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
QGSCOMPARENEAR( l22.pointN( 0 ).z(), -19.249066, 0.001 );
QGSCOMPARENEAR( l22.pointN( 1 ).z(), -21.092128, 0.001 );
l22.transform( tr, QgsCoordinateTransform::ReverseTransform, true );
QGSCOMPARENEAR( l22.pointN( 0 ).z(), 1.0, 0.001 );
QGSCOMPARENEAR( l22.pointN( 1 ).z(), 3.0, 0.001 );
#endif

//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
Expand Down Expand Up @@ -4021,13 +4024,15 @@ void TestQgsGeometry::lineString()
QGSCOMPARENEAR( l22.pointN( 1 ).z(), 3, 0.001 );
QCOMPARE( l22.pointN( 1 ).m(), 4.0 );

#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
l22.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
QGSCOMPARENEAR( l22.pointN( 0 ).z(), -19.249066, 0.001 );
QGSCOMPARENEAR( l22.pointN( 1 ).z(), -21.092128, 0.001 );
l22.transform( tr, QgsCoordinateTransform::ReverseTransform, true );
QGSCOMPARENEAR( l22.pointN( 0 ).z(), 1.0, 0.001 );
QGSCOMPARENEAR( l22.pointN( 1 ).z(), 3.0, 0.001 );
#endif

//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
Expand Down Expand Up @@ -6160,6 +6165,7 @@ void TestQgsGeometry::polygon()
QGSCOMPARENEAR( intR->boundingBox().xMaximum(), 6474984, 100 );
QGSCOMPARENEAR( intR->boundingBox().yMaximum(), -3526584, 100 );

#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
pTransform.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
extR = static_cast< const QgsLineString * >( pTransform.exteriorRing() );
Expand All @@ -6183,6 +6189,7 @@ void TestQgsGeometry::polygon()
QGSCOMPARENEAR( intR->pointN( 1 ).z(), 3, 0.001 );
QGSCOMPARENEAR( intR->pointN( 2 ).z(), 5, 0.001 );
QGSCOMPARENEAR( intR->pointN( 3 ).z(), 1, 0.001 );
#endif

//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
Expand Down Expand Up @@ -10748,6 +10755,7 @@ void TestQgsGeometry::compoundCurve()
QGSCOMPARENEAR( pt.z(), 5.0, 0.001 );
QCOMPARE( pt.m(), 6.0 );

#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
c22.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
c22.pointAt( 0, pt, v );
Expand All @@ -10764,6 +10772,7 @@ void TestQgsGeometry::compoundCurve()
QGSCOMPARENEAR( pt.z(), 3, 0.001 );
c22.pointAt( 2, pt, v );
QGSCOMPARENEAR( pt.z(), 5, 0.001 );
#endif

//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
Expand Down Expand Up @@ -15871,6 +15880,7 @@ void TestQgsGeometry::geometryCollection()
QGSCOMPARENEAR( intR->boundingBox().xMaximum(), 6474984, 100 );
QGSCOMPARENEAR( intR->boundingBox().yMaximum(), -3526584, 100 );

#if PROJ_VERSION_MAJOR<6 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
pTransform.transform( tr, QgsCoordinateTransform::ForwardTransform, true );
extR = static_cast< const QgsLineString * >( pTransform.geometryN( 0 ) );
Expand All @@ -15894,6 +15904,7 @@ void TestQgsGeometry::geometryCollection()
QGSCOMPARENEAR( intR->pointN( 1 ).z(), 3, 0.001 );
QGSCOMPARENEAR( intR->pointN( 2 ).z(), 5, 0.001 );
QGSCOMPARENEAR( intR->pointN( 3 ).z(), 1, 0.001 );
#endif

//QTransform transform
QTransform qtr = QTransform::fromScale( 2, 3 );
Expand Down

0 comments on commit 5ba9950

Please sign in to comment.