Skip to content
Permalink
Browse files

Avoid CRS detection via .qpj when using GDAL3/PROJ6 (fixes #34211)

  • Loading branch information
nirvn authored and nyalldawson committed Feb 3, 2020
1 parent 3f737d5 commit 012ee83e85ccf1bf0c71a6cd8cea7cc2556bd6a8
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/core/providers/ogr/qgsogrprovider.cpp
  2. +2 −0 src/core/qgsvectorfilewriter.cpp
@@ -3687,6 +3687,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 );
@@ -3708,7 +3709,6 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
}

// add towgs84 parameter
#if PROJ_VERSION_MAJOR<6
Q_NOWARN_DEPRECATED_PUSH
QgsCoordinateReferenceSystem::setupESRIWktFix();
Q_NOWARN_DEPRECATED_POP
@@ -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" ) )
@@ -521,6 +522,7 @@ void QgsVectorFileWriter::init( QString vectorFileName,
}
}
}
#endif

if ( !mLayer )
{

0 comments on commit 012ee83

Please sign in to comment.
You can’t perform that action at this time.