[needs-docs] Rename "Define layer projection" to "Define Shapefile projection"

This algorithm ONLY works on shapefile inputs, so make that clear in the algorithm's
display name and helper strings
This commit is contained in:
Nyall Dawson 2020-02-04 14:22:00 +10:00
parent dae36b343e
commit 692a14090b
2 changed files with 12 additions and 6 deletions

View File

@ -66,9 +66,9 @@ qgis:createpointslayerfromtable: >
This algorithm creates points layer from a table with columns that contain coordinates fields. Besides X and Y coordinates you can also specify Z and M fields.
qgis:definecurrentprojection: >
This algorithm sets an existing layer's projection to the provided CRS. Contrary to the "Assign projection" algorithm, it will not output a new layer.
This algorithm sets an existing Shapefile's projection to the provided CRS. Contrary to the "Assign projection" algorithm, it will not output a new layer.
For shapefile datasets, the .prj and .qpj files will be overwritten - or created if missing - to match the provided CRS.
The .prj and .qpj files associated with the Shapefile will be overwritten - or created if missing - to match the provided CRS.
qgis:delaunaytriangulation: >
This algorithm creates a polygon layer with the delaunay triangulation corresponding to a points layer.

View File

@ -2,7 +2,7 @@
"""
***************************************************************************
SpatialIndex.py
DefineProjection.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Alexander Bruy
@ -53,7 +53,7 @@ class DefineProjection(QgisAlgorithm):
def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterVectorLayer(self.INPUT,
self.tr('Input Layer'), types=[QgsProcessing.TypeVectorAnyGeometry]))
self.tr('Input Shapefile'), types=[QgsProcessing.TypeVectorAnyGeometry]))
self.addParameter(QgsProcessingParameterCrs(self.CRS, 'CRS'))
self.addOutput(QgsProcessingOutputVectorLayer(self.INPUT,
self.tr('Layer with projection')))
@ -62,7 +62,13 @@ class DefineProjection(QgisAlgorithm):
return 'definecurrentprojection'
def displayName(self):
return self.tr('Define layer projection')
return self.tr('Define Shapefile projection')
def tags(self):
return self.tr('layer,shp,prj,qpj,change,alter').split(',')
def shortDescription(self):
return self.tr('Changes a Shapefile\'s projection to a new CRS without reprojecting features')
def flags(self):
return super().flags() | QgsProcessingAlgorithm.FlagNoThreading
@ -91,7 +97,7 @@ class DefineProjection(QgisAlgorithm):
else:
os.remove(qpjFile)
else:
feedback.pushConsoleInfo(self.tr("Data source isn't a shapefile, skipping .prj/.qpj creation"))
feedback.pushConsoleInfo(self.tr("Data source isn't a Shapefile, skipping .prj/.qpj creation"))
layer.setCrs(crs)
layer.triggerRepaint()