Skip to content

Commit

Permalink
Avoid CRS detection via .qpj when using GDAL3/PROJ6 (fixes #34211)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Feb 4, 2020
1 parent 77f07e2 commit 5e3ba6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -3670,6 +3670,7 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
if ( !mValid || ( mOGRGeomType == wkbNone ) )
return srs;

#if PROJ_VERSION_MAJOR<6
if ( mGDALDriverName == QLatin1String( "ESRI Shapefile" ) )
{
int index = mFilePath.indexOf( QLatin1String( ".shp" ), Qt::CaseInsensitive );
Expand All @@ -3691,7 +3692,6 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
}

// add towgs84 parameter
#if PROJ_VERSION_MAJOR<6
Q_NOWARN_DEPRECATED_PUSH
QgsCoordinateReferenceSystem::setupESRIWktFix();
Q_NOWARN_DEPRECATED_POP
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -503,6 +503,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
CPLSetConfigOption( "SHAPE_ENCODING", nullptr );
}

#if PROJ_VERSION_MAJOR<6
if ( srs.isValid() )
{
if ( mOgrDriverName == QLatin1String( "ESRI Shapefile" ) )
Expand All @@ -521,6 +522,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
}
}
}
#endif

if ( !mLayer )
{
Expand Down

0 comments on commit 5e3ba6c

Please sign in to comment.