Bump minimum proj version to 7.2

This commit is contained in:
Nyall Dawson 2022-08-30 13:05:55 +10:00
parent c517d802ed
commit b8523282dc
13 changed files with 10 additions and 26 deletions

View File

@ -100,7 +100,7 @@ Required build tools:
Required build dependencies:
* Qt >= 5.14.0
* Proj >= 6.3.1
* Proj >= 7.2.0
* GEOS >= 3.9
* Sqlite3 >= 3.0.0
* SpatiaLite >= 4.2.0

View File

@ -63,9 +63,9 @@ IF (PROJ_FOUND)
STRING(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${proj_version}")
STRING(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${proj_version}")
STRING(CONCAT PROJ_VERSION_STR "(" ${PROJ_VERSION_MAJOR} "." ${PROJ_VERSION_MINOR} "." ${PROJ_VERSION_PATCH} ")")
IF ((PROJ_VERSION_MAJOR EQUAL 6) AND ((PROJ_VERSION_MINOR LESS 3) OR (PROJ_VERSION_MINOR EQUAL 3 AND PROJ_VERSION_PATCH LESS 1)))
MESSAGE (FATAL_ERROR "Cannot build QGIS using Proj ${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}.${PROJ_VERSION_PATCH} Use 6.3.1 or higher.")
ENDIF ((PROJ_VERSION_MAJOR EQUAL 6) AND ((PROJ_VERSION_MINOR LESS 3) OR (PROJ_VERSION_MINOR EQUAL 3 AND PROJ_VERSION_PATCH LESS 1)))
IF ((PROJ_VERSION_MAJOR EQUAL 7) AND ((PROJ_VERSION_MINOR LESS 2) OR (PROJ_VERSION_MAJOR LESS 7)))
MESSAGE (FATAL_ERROR "Cannot build QGIS using Proj ${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}.${PROJ_VERSION_PATCH} Use 7.2.0 or higher.")
ENDIF ((PROJ_VERSION_MAJOR EQUAL 7) AND ((PROJ_VERSION_MINOR LESS 2) OR (PROJ_VERSION_MAJOR LESS 7)))
ELSE(EXISTS ${PROJ_INCLUDE_DIR}/proj.h AND EXISTS ${PROJ_INCLUDE_DIR}/proj_experimental.h)
FILE(READ ${PROJ_INCLUDE_DIR}/proj_api.h proj_version)
STRING(REGEX REPLACE "^.*PJ_VERSION ([0-9]+).*$" "\\1" PJ_VERSION "${proj_version}")

View File

@ -301,11 +301,9 @@ ProjData QgsCoordinateTransformPrivate::threadLocalProjData()
// When networking is not enabled, proj_create() will check that all grids are
// present, so proj_coordoperation_is_instantiable() is not necessary.
if ( !transform
#if PROJ_VERSION_MAJOR >= 7
|| (
proj_context_is_network_enabled( context ) &&
!proj_coordoperation_is_instantiable( context, transform.get() ) )
#endif
)
{
if ( sMissingGridUsedByContextHandler )

View File

@ -163,7 +163,6 @@ bool QgsProjUtils::isDynamic( const PJ *crs )
}
}
}
#if PROJ_VERSION_MAJOR > 7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR >= 2)
else
{
proj_pj_unique_ptr ensemble( horiz ? proj_crs_get_datum_ensemble( context, horiz.get() ) : nullptr );
@ -178,7 +177,6 @@ bool QgsProjUtils::isDynamic( const PJ *crs )
}
}
}
#endif
return isDynamic;
}

View File

@ -968,7 +968,7 @@ void TestQgsCircularString::crsTransform()
QGSCOMPARENEAR( cs.pointN( 1 ).z(), 3, 0.001 );
QCOMPARE( cs.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
#if 0 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
cs.transform( tr, Qgis::TransformDirection::Forward, true );

View File

@ -2713,7 +2713,7 @@ void TestQgsCompoundCurve::crs3dTransformAndReverse()
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
#if 0 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
cc.transform( tr, Qgis::TransformDirection::Forward, true );

View File

@ -667,7 +667,7 @@ void TestQgsGeometryCollection::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
#if 0 // 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, Qgis::TransformDirection::Forward, true );
extR = static_cast< const QgsLineString * >( pTransform.geometryN( 0 ) );

View File

@ -1411,7 +1411,7 @@ void TestQgsLineString::CRSTransform()
QGSCOMPARENEAR( ls.pointN( 1 ).z(), 3, 0.001 );
QCOMPARE( ls.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
#if 0 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
ls.transform( tr, Qgis::TransformDirection::Forward, true );

View File

@ -1010,7 +1010,7 @@ void TestQgsPoint::crsTransform()
QGSCOMPARENEAR( pt.z(), 1.0, 0.001 );
QCOMPARE( pt.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
#if 0 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//test with z transform
pt.transform( tr, Qgis::TransformDirection::Forward, true );
QGSCOMPARENEAR( pt.z(), -19.249, 0.001 );

View File

@ -2463,7 +2463,7 @@ void TestQgsPolygon::transformOldVersion()
pl.setExteriorRing( ls.clone() );
pl.addInteriorRing( ls.clone() );
#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
#if 0 // note - z value transform doesn't currently work with proj 6+, because we don't yet support compound CRS definitions
//z value transform
pl.transform( tr, Qgis::TransformDirection::Forward, true );
const QgsLineString *ext = static_cast< const QgsLineString * >( pl.exteriorRing() );

View File

@ -1425,7 +1425,6 @@ void TestQgsCoordinateReferenceSystem::mapUnits()
void TestQgsCoordinateReferenceSystem::isDynamic()
{
#if (PROJ_VERSION_MAJOR>7 || (PROJ_VERSION_MAJOR==7 && PROJ_VERSION_MINOR >= 2 ) )
QgsCoordinateReferenceSystem crs( QStringLiteral( "EPSG:7665" ) );
QVERIFY( crs.isDynamic() );
@ -1454,7 +1453,6 @@ void TestQgsCoordinateReferenceSystem::isDynamic()
AUTHORITY["EPSG","4326"]])""" ) ) );
QVERIFY( crs.isValid() );
QVERIFY( crs.isDynamic() );
#endif
}
void TestQgsCoordinateReferenceSystem::celestialBody()

View File

@ -42,11 +42,9 @@ class TestQgsCoordinateTransform: public QObject
void scaleFactor_data();
void transform_data();
void transform();
#if PROJ_VERSION_MAJOR>7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR >= 2)
void transformEpoch_data();
void transformEpoch();
void dynamicToDynamicErrorHandler();
#endif
void transformLKS();
void transformContextNormalize();
void transform2DPoint();
@ -400,7 +398,6 @@ void TestQgsCoordinateTransform::transform()
QGSCOMPARENEAR( y, outY, precision );
}
#if PROJ_VERSION_MAJOR>7 || (PROJ_VERSION_MAJOR == 7 && PROJ_VERSION_MINOR >= 2)
void TestQgsCoordinateTransform::transformEpoch_data()
{
QTest::addColumn<QgsCoordinateReferenceSystem>( "sourceCrs" );
@ -558,7 +555,6 @@ void TestQgsCoordinateTransform::dynamicToDynamicErrorHandler()
QgsCoordinateTransform::setDynamicCrsToDynamicCrsWarningHandler( nullptr );
}
#endif
void TestQgsCoordinateTransform::transformBoundingBox()
{

View File

@ -105,7 +105,6 @@ void TestQgsProjUtils::gridsUsed()
// ensure local user-writable path is present in Proj search paths
QList< QgsDatumTransform::GridDetails > grids = QgsProjUtils::gridsUsed( QStringLiteral( "+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=hgridshift +grids=GDA94_GDA2020_conformal_and_distortion.gsb +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1" ) );
QCOMPARE( grids.count(), 1 );
#if PROJ_VERSION_MAJOR>=7
QCOMPARE( grids.at( 0 ).shortName, QStringLiteral( "GDA94_GDA2020_conformal_and_distortion.gsb" ) );
QVERIFY( grids.at( 0 ).directDownload );
QVERIFY( !grids.at( 0 ).url.isEmpty() );
@ -115,11 +114,6 @@ void TestQgsProjUtils::gridsUsed()
QCOMPARE( grids.at( 0 ).shortName, QStringLiteral( "au_icsm_GDA94_GDA2020_conformal_and_distortion.tif" ) );
QVERIFY( grids.at( 0 ).directDownload );
QVERIFY( !grids.at( 0 ).url.isEmpty() );
#else
QCOMPARE( grids.at( 0 ).shortName, QStringLiteral( "GDA94_GDA2020_conformal_and_distortion.gsb" ) );
QCOMPARE( grids.at( 0 ).packageName, QStringLiteral( "proj-datumgrid-oceania" ) );
QVERIFY( grids.at( 0 ).directDownload );
#endif
}
QGSTEST_MAIN( TestQgsProjUtils )