Skip to content

Commit

Permalink
[processing] Define Layer Projection tool should write .prj files
Browse files Browse the repository at this point in the history
using WKT1 ESRI format, not GDAL

Fixes #34007
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent f1a886a commit f41dd11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/qgis/DefineProjection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
QgsProcessingAlgorithm,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterCrs,
QgsProcessingOutputVectorLayer)
QgsProcessingOutputVectorLayer,
QgsCoordinateReferenceSystem)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm

Expand Down Expand Up @@ -77,7 +78,7 @@ def processAlgorithm(self, parameters, context, feedback):
if dsPath.lower().endswith('.shp'):
dsPath = dsPath[:-4]

wkt = crs.toWkt()
wkt = crs.toWkt(QgsCoordinateReferenceSystem.WKT1_ESRI)
with open(dsPath + '.prj', 'w') as f:
f.write(wkt)

Expand Down

0 comments on commit f41dd11

Please sign in to comment.