Skip to content

Commit

Permalink
Update PointsToPaths.py
Browse files Browse the repository at this point in the history
"line" is replaced by "path"
  • Loading branch information
MrChebur committed Aug 15, 2020
1 parent a30635d commit be61340
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/qgis/PointsToPaths.py
Expand Up @@ -48,7 +48,7 @@

class PointsToPaths(QgisAlgorithm):
INPUT = 'INPUT'
CLOSE_LINE = 'CLOSE_LINE'
CLOSE_PATH = 'CLOSE_PATH'
GROUP_FIELD = 'GROUP_FIELD'
ORDER_FIELD = 'ORDER_FIELD'
DATE_FORMAT = 'DATE_FORMAT'
Expand All @@ -70,8 +70,8 @@ def tags(self):
def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input point layer'), [QgsProcessing.TypeVectorPoint]))
self.addParameter(QgsProcessingParameterBoolean(self.CLOSE_LINE,
self.tr('Close line'), defaultValue=False))
self.addParameter(QgsProcessingParameterBoolean(self.CLOSE_PATH,
self.tr('Close path'), defaultValue=False))
self.addParameter(QgsProcessingParameterField(self.ORDER_FIELD,
self.tr('Order field'), parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterField(self.GROUP_FIELD,
Expand All @@ -95,7 +95,7 @@ def processAlgorithm(self, parameters, context, feedback):
if source is None:
raise QgsProcessingException(self.invalidSourceError(parameters, self.INPUT))

close_line = self.parameterAsBool(parameters, self.CLOSE_LINE, context)
close_path = self.parameterAsBool(parameters, self.CLOSE_PATH, context)
group_field_name = self.parameterAsString(parameters, self.GROUP_FIELD, context)
order_field_name = self.parameterAsString(parameters, self.ORDER_FIELD, context)
date_format = self.parameterAsString(parameters, self.DATE_FORMAT, context)
Expand Down Expand Up @@ -177,7 +177,7 @@ def processAlgorithm(self, parameters, context, feedback):
f.setAttributes(attributes)
line = [node[1] for node in vertices]

if close_line is True:
if close_path is True:
if line[0] != line[-1]:
line.append(line[0])

Expand Down

0 comments on commit be61340

Please sign in to comment.