Skip to content
Permalink
Browse files

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

  • Loading branch information
github-actions authored and nyalldawson committed Feb 4, 2020
1 parent 77f07e2 commit 5e3ba6ca139dbeab4b7b68b01c881efc3896037d
Showing with 3 additions and 1 deletion.
  1. +1 −1 src/core/providers/ogr/qgsogrprovider.cpp
  2. +2 −0 src/core/qgsvectorfilewriter.cpp
@@ -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 );
@@ -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
@@ -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 5e3ba6c

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