Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_10] Avoid CRS detection via .qpj when using GDAL3/PROJ6 (fixes #34211) #34242

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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