Skip to content

Commit

Permalink
Remove code paths that are GDAL < 3 specific, now that GDAL >= 3 is r…
Browse files Browse the repository at this point in the history
…equired
  • Loading branch information
rouault committed Jul 13, 2021
1 parent db74bf5 commit 9d4049f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
24 changes: 0 additions & 24 deletions src/core/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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 ) );
Expand Down
2 changes: 0 additions & 2 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 9d4049f

Please sign in to comment.