Skip to content
Permalink
Browse files

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

…ojection"

This algorithm ONLY works on shapefile inputs, so make that clear in the algorithm's
display name and helper strings
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent dae36b3 commit 692a14090bcebfd253fa3e58dccf2999ad509894
@@ -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.
@@ -2,7 +2,7 @@

"""
***************************************************************************
SpatialIndex.py
DefineProjection.py
---------------------
Date : January 2016
Copyright : (C) 2016 by Alexander Bruy
@@ -53,7 +53,7 @@ def __init__(self):

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 @@ def name(self):
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 @@ def processAlgorithm(self, parameters, context, feedback):
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()

0 comments on commit 692a140

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