Skip to content
Permalink
Browse files
Merge pull request #44145 from rouault/gdal_3_cleanup
Remove code paths that are GDAL < 3 specific, now that GDAL >= 3 is required
  • Loading branch information
rouault committed Jul 13, 2021
2 parents 25d4060 + 9d4049f commit 1dfe7186eced4a7e3b1689f25564d7d899844829
Showing with 0 additions and 26 deletions.
  1. +0 −24 src/core/providers/gdal/qgsgdalprovider.cpp
  2. +0 −2 src/core/qgsvectorfilewriter.cpp
@@ -186,16 +186,6 @@ QgsGdalProvider::QgsGdalProvider( const QString &uri, const ProviderOptions &opt
CPLSetConfigOption( "AAIGRID_DATATYPE", "Float64" );
}

#if !(GDAL_VERSION_MAJOR > 2 || (GDAL_VERSION_MAJOR == 2 && GDAL_VERSION_MINOR >= 3))
if ( !CPLGetConfigOption( "VRT_SHARED_SOURCE", nullptr ) )
{
// GDAL < 2.3 has issues with use of VRT in multi-threaded
// scenarios. See https://github.com/qgis/QGIS/issues/24413 /
// https://trac.osgeo.org/gdal/ticket/6939
CPLSetConfigOption( "VRT_SHARED_SOURCE", "NO" );
}
#endif

// To get buildSupportedRasterFileFilter the provider is called with empty uri
if ( uri.isEmpty() )
{
@@ -2532,20 +2522,6 @@ void buildSupportedRasterFileFilterAndExtensions( QString &fileFiltersString, QS
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "hdr.adf" ) );
wildcards << QStringLiteral( "hdr.adf" );
}
#if !(GDAL_VERSION_MAJOR > 2 || (GDAL_VERSION_MAJOR == 2 && GDAL_VERSION_MINOR >= 3))
else if ( myGdalDriverDescription.startsWith( QLatin1String( "EHdr" ) ) )
{
// Fixed in GDAL 2.3
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "*.bil" ) );
extensions << QStringLiteral( "bil" );
}
else if ( myGdalDriverDescription == QLatin1String( "ERS" ) )
{
// Fixed in GDAL 2.3
fileFiltersString += createFileFilter_( myGdalDriverLongName, QStringLiteral( "*.ers" ) );
extensions << QStringLiteral( "ers" );
}
#endif
else
{
catchallFilter << QString( GDALGetDescription( myGdalDriver ) );
@@ -435,12 +435,10 @@ void QgsVectorFileWriter::init( QString vectorFileName,
QString srsWkt = srs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL );
QgsDebugMsgLevel( "WKT to save as is " + srsWkt, 2 );
mOgrRef = OSRNewSpatialReference( srsWkt.toLocal8Bit().constData() );
#if GDAL_VERSION_MAJOR >= 3
if ( mOgrRef )
{
OSRSetAxisMappingStrategy( mOgrRef, OAMS_TRADITIONAL_GIS_ORDER );
}
#endif
}

// datasource created, now create the output layer

0 comments on commit 1dfe718

Please sign in to comment.