Skip to content
Permalink
Browse files

Disable geometry z value transform tests on proj 6+, because QGIS

currently doesn't support compound CRS definitions and these are
required for vertical transforms on proj 6+
  • Loading branch information
nyalldawson committed Feb 5, 2021
1 parent 1814f0a commit e47fbd7215af549920a39fdf4df96763bedb52ef
Showing with 12 additions and 1 deletion.
  1. +12 −1 tests/src/core/testqgsgeometry.cpp
@@ -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 );
@@ -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 );
@@ -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 );
@@ -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() );
@@ -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 );
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 );
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 );
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 ) );
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 );

0 comments on commit e47fbd7

Please sign in to comment.