Skip to content
Permalink
Browse files

Remove qpj files when defining shp projection from processing and Pro…

…j >= build

is present

These files aren't/shouldn't be used under proj 6 builds

(cherry picked from commit dae36b3)
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent 4e3be1b commit e9008e8bc2779035a1c05f871b0d19e8c565df1c
Showing with 7 additions and 3 deletions.
  1. +7 −3 python/plugins/processing/algs/qgis/DefineProjection.py
@@ -29,7 +29,8 @@
QgsProcessingParameterVectorLayer,
QgsProcessingParameterCrs,
QgsProcessingOutputVectorLayer,
QgsCoordinateReferenceSystem)
QgsCoordinateReferenceSystem,
QgsProjUtils)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm

@@ -84,8 +85,11 @@ def processAlgorithm(self, parameters, context, feedback):

qpjFile = dsPath + '.qpj'
if os.path.exists(qpjFile):
with open(qpjFile, 'w') as f:
f.write(wkt)
if QgsProjUtils.projVersionMajor() < 6:
with open(qpjFile, 'w') as f:
f.write(wkt)
else:
os.remove(qpjFile)
else:
feedback.pushConsoleInfo(self.tr("Data source isn't a shapefile, skipping .prj/.qpj creation"))

0 comments on commit e9008e8

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