diff --git a/python/plugins/processing/algs/help/qgis.yaml b/python/plugins/processing/algs/help/qgis.yaml
index 1863dd80403..843c864cfce 100644
--- a/python/plugins/processing/algs/help/qgis.yaml
+++ b/python/plugins/processing/algs/help/qgis.yaml
@@ -176,17 +176,12 @@ qgis:extractbyexpression: >
For more information about expressions see the user manual
-qgis:extractnodes: >
- This algorithm takes a line or polygon layer and generates a point layer with points representing the nodes in the input lines or polygons. The attributes associated to each point are the same ones associated to the line or polygon that the point belongs to.
+qgis:extractspecificvertices: >
+ This algorithm takes a line or polygon layer and generates a point layer with points representing specific vertices in the input lines or polygons. For instance, this algorithm can be used to extract the first or last vertices in the geometry. The attributes associated to each point are the same ones associated to the line or polygon that the point belongs to.
- Additional fields are added to the nodes indicating the node index (beginning at 0), distance along original geometry and bisector angle of node for original geometry.
+ The vertex indices parameter accepts a comma separated string specifying the indices of the vertices to extract. The first vertex corresponds to an index of 0, the second vertex has an index of 1, etc. Negative indices can be used to find vertices at the end of the geometry, e.g., an index of -1 corresponds to the last vertex, -2 corresponds to the second last vertex, etc.
-qgis:extractspecificnodes: >
- This algorithm takes a line or polygon layer and generates a point layer with points representing specific nodes in the input lines or polygons. For instance, this algorithm can be used to extract the first or last nodes in the geometry. The attributes associated to each point are the same ones associated to the line or polygon that the point belongs to.
-
- The node indices parameter accepts a comma separated string specifying the indices of the nodes to extract. The first node corresponds to an index of 0, the second node has an index of 1, etc. Negative indices can be used to find nodes at the end of the geometry, e.g., an index of -1 corresponds to the last node, -2 corresponds to the second last node, etc.
-
- Additional fields are added to the nodes indicating the specific node position (e.g., 0, -1, etc), the original node index, the node’s part and its index within the part (as well as its ring for polygons), distance along the original geometry and bisector angle of node for the original geometry.
+ Additional fields are added to the points indicating the specific vertex position (e.g., 0, -1, etc), the original vertex index, the vertex’s part and its index within the part (as well as its ring for polygons), distance along the original geometry and bisector angle of vertex for the original geometry.
qgis:fieldcalculator: >
This algorithm computes a new vector layer with the same features of the input layer, but with an additional attribute. The values of this new attribute are computed from each feature using a mathematical formula, based on the properties and attributes of the feature.
diff --git a/python/plugins/processing/algs/qgis/DensifyGeometries.py b/python/plugins/processing/algs/qgis/DensifyGeometries.py
index ddd11483f35..dafb260e361 100755
--- a/python/plugins/processing/algs/qgis/DensifyGeometries.py
+++ b/python/plugins/processing/algs/qgis/DensifyGeometries.py
@@ -38,7 +38,7 @@ class DensifyGeometries(QgisFeatureBasedAlgorithm):
VERTICES = 'VERTICES'
def tags(self):
- return self.tr('add,vertices,points').split(',')
+ return self.tr('add,vertex,vertices,points,nodes').split(',')
def group(self):
return self.tr('Vector geometry')
diff --git a/python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py b/python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
index c981856dbcf..709eff200c7 100755
--- a/python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
+++ b/python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py
@@ -36,6 +36,9 @@ class DensifyGeometriesInterval(QgisFeatureBasedAlgorithm):
INTERVAL = 'INTERVAL'
+ def tags(self):
+ return self.tr('add,vertex,vertices,points,nodes').split(',')
+
def group(self):
return self.tr('Vector geometry')
diff --git a/python/plugins/processing/algs/qgis/ExtractSpecificNodes.py b/python/plugins/processing/algs/qgis/ExtractSpecificVertices.py
similarity index 73%
rename from python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
rename to python/plugins/processing/algs/qgis/ExtractSpecificVertices.py
index e1b0d26c9ae..1b9ad338ec7 100644
--- a/python/plugins/processing/algs/qgis/ExtractSpecificNodes.py
+++ b/python/plugins/processing/algs/qgis/ExtractSpecificVertices.py
@@ -2,7 +2,7 @@
"""
***************************************************************************
- ExtractSpecificNodes.py
+ ExtractSpecificVertices.py
--------------------
Date : October 2016
Copyright : (C) 2016 by Nyall Dawson
@@ -42,10 +42,10 @@ from qgis.core import (QgsWkbTypes,
from qgis.PyQt.QtCore import QVariant
-class ExtractSpecificNodes(QgisAlgorithm):
+class ExtractSpecificVertices(QgisAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
- NODES = 'NODES'
+ VERTICES = 'VERTICES'
def group(self):
return self.tr('Vector geometry')
@@ -59,29 +59,29 @@ class ExtractSpecificNodes(QgisAlgorithm):
def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input layer'), [QgsProcessing.TypeVectorAnyGeometry]))
- self.addParameter(QgsProcessingParameterString(self.NODES,
- self.tr('Node indices'), defaultValue='0'))
+ self.addParameter(QgsProcessingParameterString(self.VERTICES,
+ self.tr('Vertex indices'), defaultValue='0'))
- self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Nodes'), QgsProcessing.TypeVectorPoint))
+ self.addParameter(QgsProcessingParameterFeatureSink(self.OUTPUT, self.tr('Vertices'), QgsProcessing.TypeVectorPoint))
def name(self):
- return 'extractspecificnodes'
+ return 'extractspecificvertices'
def displayName(self):
- return self.tr('Extract specific nodes')
+ return self.tr('Extract specific vertices')
def tags(self):
- return self.tr('points,vertex,vertices').split(',')
+ return self.tr('points,vertex,nodes').split(',')
def processAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, self.INPUT, context)
fields = source.fields()
- fields.append(QgsField('node_pos', QVariant.Int))
- fields.append(QgsField('node_index', QVariant.Int))
- fields.append(QgsField('node_part', QVariant.Int))
+ fields.append(QgsField('vertex_pos', QVariant.Int))
+ fields.append(QgsField('vertex_index', QVariant.Int))
+ fields.append(QgsField('vertex_part', QVariant.Int))
if QgsWkbTypes.geometryType(source.wkbType()) == QgsWkbTypes.PolygonGeometry:
- fields.append(QgsField('node_part_ring', QVariant.Int))
- fields.append(QgsField('node_part_index', QVariant.Int))
+ fields.append(QgsField('vertex_part_ring', QVariant.Int))
+ fields.append(QgsField('vertex_part_index', QVariant.Int))
fields.append(QgsField('distance', QVariant.Double))
fields.append(QgsField('angle', QVariant.Double))
@@ -94,14 +94,14 @@ class ExtractSpecificNodes(QgisAlgorithm):
(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
fields, wkb_type, source.sourceCrs())
- node_indices_string = self.parameterAsString(parameters, self.NODES, context)
+ vertex_indices_string = self.parameterAsString(parameters, self.VERTICES, context)
indices = []
- for node in node_indices_string.split(','):
+ for vertex in vertex_indices_string.split(','):
try:
- indices.append(int(node))
+ indices.append(int(vertex))
except:
raise QgsProcessingException(
- self.tr('\'{}\' is not a valid node index').format(node))
+ self.tr('\'{}\' is not a valid vertex index').format(vertex))
features = source.getFeatures()
total = 100.0 / source.featureCount() if source.featureCount() else 0
@@ -114,26 +114,26 @@ class ExtractSpecificNodes(QgisAlgorithm):
if not input_geometry:
sink.addFeature(f, QgsFeatureSink.FastInsert)
else:
- total_nodes = input_geometry.constGet().nCoordinates()
+ total_vertices = input_geometry.constGet().nCoordinates()
- for node in indices:
- if node < 0:
- node_index = total_nodes + node
+ for vertex in indices:
+ if vertex < 0:
+ vertex_index = total_vertices + vertex
else:
- node_index = node
+ vertex_index = vertex
- if node_index < 0 or node_index >= total_nodes:
+ if vertex_index < 0 or vertex_index >= total_vertices:
continue
- (success, vertex_id) = input_geometry.vertexIdFromVertexNr(node_index)
+ (success, vertex_id) = input_geometry.vertexIdFromVertexNr(vertex_index)
- distance = input_geometry.distanceToVertex(node_index)
- angle = math.degrees(input_geometry.angleAtVertex(node_index))
+ distance = input_geometry.distanceToVertex(vertex_index)
+ angle = math.degrees(input_geometry.angleAtVertex(vertex_index))
output_feature = QgsFeature()
attrs = f.attributes()
- attrs.append(node)
- attrs.append(node_index)
+ attrs.append(vertex)
+ attrs.append(vertex_index)
attrs.append(vertex_id.part)
if QgsWkbTypes.geometryType(source.wkbType()) == QgsWkbTypes.PolygonGeometry:
attrs.append(vertex_id.ring)
@@ -142,7 +142,7 @@ class ExtractSpecificNodes(QgisAlgorithm):
attrs.append(angle)
output_feature.setAttributes(attrs)
- point = input_geometry.vertexAt(node_index)
+ point = input_geometry.vertexAt(vertex_index)
output_feature.setGeometry(QgsGeometry(point))
sink.addFeature(output_feature, QgsFeatureSink.FastInsert)
diff --git a/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py b/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
index f7568f433d6..9954af00e3e 100644
--- a/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
+++ b/python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
@@ -63,7 +63,7 @@ from .Explode import Explode
from .ExportGeometryInfo import ExportGeometryInfo
from .ExtendLines import ExtendLines
from .ExtentFromLayer import ExtentFromLayer
-from .ExtractSpecificNodes import ExtractSpecificNodes
+from .ExtractSpecificVertices import ExtractSpecificVertices
from .FieldPyculator import FieldsPyculator
from .FieldsCalculator import FieldsCalculator
from .FieldsMapper import FieldsMapper
@@ -183,7 +183,7 @@ class QgisAlgorithmProvider(QgsProcessingProvider):
ExportGeometryInfo(),
ExtendLines(),
ExtentFromLayer(),
- ExtractSpecificNodes(),
+ ExtractSpecificVertices(),
FieldsCalculator(),
FieldsMapper(),
FieldsPyculator(),
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gfs b/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gfs
index dc8189d4f3e..8d311b8fc4c 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gfs
@@ -12,18 +12,18 @@
5.00000
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gml b/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gml
index 91fff83c206..61bd34af45b 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_lines.gml
@@ -14,9 +14,9 @@
6,2
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -24,9 +24,9 @@
9,2
- 1
- 0
- 1
+ 1
+ 0
+ 1
3.00000000000000
45.00000000000000
@@ -34,9 +34,9 @@
9,3
- 2
- 0
- 2
+ 2
+ 0
+ 2
4.00000000000000
22.50000000000000
@@ -44,9 +44,9 @@
11,5
- 3
- 0
- 3
+ 3
+ 0
+ 3
6.82842712474619
45.00000000000000
@@ -54,9 +54,9 @@
-1,-1
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -64,9 +64,9 @@
1,-1
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
90.00000000000000
@@ -74,9 +74,9 @@
2,0
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
0.00000000000000
@@ -84,9 +84,9 @@
2,2
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
45.00000000000000
@@ -94,9 +94,9 @@
3,2
- 2
- 0
- 2
+ 2
+ 0
+ 2
3.00000000000000
45.00000000000000
@@ -104,9 +104,9 @@
3,3
- 3
- 0
- 3
+ 3
+ 0
+ 3
4.00000000000000
0.00000000000000
@@ -114,9 +114,9 @@
3,1
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -124,9 +124,9 @@
5,1
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
90.00000000000000
@@ -134,9 +134,9 @@
7,-3
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -144,9 +144,9 @@
10,-3
- 1
- 0
- 1
+ 1
+ 0
+ 1
3.00000000000000
90.00000000000000
@@ -154,9 +154,9 @@
6,-3
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
45.00000000000000
@@ -164,18 +164,18 @@
10,1
- 1
- 0
- 1
+ 1
+ 0
+ 1
5.65685424949238
45.00000000000000
-
-
-
+
+
+
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gfs b/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gfs
index b32942d13b5..0d477c4928a 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gfs
@@ -12,18 +12,18 @@
4.11977
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gml b/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gml
index 5d4d2912621..d93be80c2a7 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_multilines.gml
@@ -14,9 +14,9 @@
-1,-1
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -24,9 +24,9 @@
1,-1
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
90.00000000000000
@@ -34,9 +34,9 @@
3,1
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -44,9 +44,9 @@
5,1
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
90.00000000000000
@@ -54,9 +54,9 @@
5.02418426103647,2.4147792706334
- 2
- 1
- 0
+ 2
+ 1
+ 0
2.00000000000000
180.97931965433949
@@ -64,18 +64,18 @@
5,1
- 3
- 1
- 1
+ 3
+ 1
+ 1
3.41498595862145
180.97931965433949
-
-
-
+
+
+
@@ -83,9 +83,9 @@
2,0
- 0
- 0
- 0
+ 0
+ 0
+ 0
0.00000000000000
0.00000000000000
@@ -93,9 +93,9 @@
2,2
- 1
- 0
- 1
+ 1
+ 0
+ 1
2.00000000000000
45.00000000000000
@@ -103,9 +103,9 @@
3,2
- 2
- 0
- 2
+ 2
+ 0
+ 2
3.00000000000000
45.00000000000000
@@ -113,9 +113,9 @@
3,3
- 3
- 0
- 3
+ 3
+ 0
+ 3
4.00000000000000
0.00000000000000
@@ -123,9 +123,9 @@
2.94433781190019,4.04721689059501
- 4
- 1
- 0
+ 4
+ 1
+ 0
4.00000000000000
88.34769532234870
@@ -133,9 +133,9 @@
5.4595009596929,4.11976967370441
- 5
- 1
- 1
+ 5
+ 1
+ 1
6.51620936457033
88.34769532234870
@@ -143,9 +143,9 @@
3,3
- 6
- 2
- 0
+ 6
+ 2
+ 0
6.51620936457033
91.18035448020294
@@ -153,9 +153,9 @@
5.58042226487524,2.9468330134357
- 7
- 2
- 1
+ 7
+ 2
+ 1
9.09717929727474
91.18035448020294
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gfs b/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gfs
index de865a6bee3..45a0d65f320 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gfs
@@ -28,23 +28,23 @@
Real
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_ring
- node_part_ring
+ vertex_part_ring
+ vertex_part_ring
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gml b/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gml
index 0e0727206d3..97283946ec6 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_multipolys.gml
@@ -17,10 +17,10 @@
Test
1
0.123
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
315.00000000000000
@@ -31,10 +31,10 @@
Test
1
0.123
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
1.00000000000000
45.00000000000000
@@ -45,10 +45,10 @@
Test
1
0.123
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
2.00000000000000
45.00000000000000
@@ -59,10 +59,10 @@
Test
1
0.123
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
3.00000000000000
45.00000000000000
@@ -73,10 +73,10 @@
Test
1
0.123
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
4.00000000000000
135.00000000000000
@@ -87,10 +87,10 @@
Test
1
0.123
- 5
- 0
- 0
- 5
+ 5
+ 0
+ 0
+ 5
6.00000000000000
225.00000000000000
@@ -101,10 +101,10 @@
Test
1
0.123
- 6
- 0
- 0
- 6
+ 6
+ 0
+ 0
+ 6
8.00000000000000
315.00000000000000
@@ -115,10 +115,10 @@
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
135.00000000000000
@@ -129,10 +129,10 @@
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
1.00000000000000
45.00000000000000
@@ -143,10 +143,10 @@
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
5.00000000000000
315.00000000000000
@@ -157,10 +157,10 @@
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
6.00000000000000
225.00000000000000
@@ -171,10 +171,10 @@
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
10.00000000000000
135.00000000000000
@@ -185,10 +185,10 @@
- 5
- 1
- 0
- 0
+ 5
+ 1
+ 0
+ 0
10.00000000000000
225.00000000000000
@@ -199,10 +199,10 @@
- 6
- 1
- 0
- 1
+ 6
+ 1
+ 0
+ 1
11.00000000000000
180.00000000000000
@@ -213,10 +213,10 @@
- 7
- 1
- 0
- 2
+ 7
+ 1
+ 0
+ 2
12.00000000000000
135.00000000000000
@@ -227,10 +227,10 @@
- 8
- 1
- 0
- 3
+ 8
+ 1
+ 0
+ 3
13.00000000000000
67.50000000000000
@@ -241,10 +241,10 @@
- 9
- 1
- 0
- 4
+ 9
+ 1
+ 0
+ 4
14.41421356237310
22.50000000000000
@@ -255,10 +255,10 @@
- 10
- 1
- 0
- 5
+ 10
+ 1
+ 0
+ 5
15.41421356237310
315.00000000000000
@@ -269,10 +269,10 @@
- 11
- 1
- 0
- 6
+ 11
+ 1
+ 0
+ 6
17.41421356237310
225.00000000000000
@@ -283,10 +283,10 @@
Test
2
-0.123
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
315.00000000000000
@@ -297,10 +297,10 @@
Test
2
-0.123
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
1.00000000000000
45.00000000000000
@@ -311,10 +311,10 @@
Test
2
-0.123
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
2.00000000000000
135.00000000000000
@@ -325,10 +325,10 @@
Test
2
-0.123
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
3.00000000000000
225.00000000000000
@@ -339,10 +339,10 @@
Test
2
-0.123
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
4.00000000000000
315.00000000000000
@@ -352,10 +352,10 @@
Test
3
0
-
-
-
-
+
+
+
+
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gfs b/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gfs
index 2797d058900..52abb2f3206 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gfs
@@ -28,23 +28,23 @@
Real
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_ring
- node_part_ring
+ vertex_part_ring
+ vertex_part_ring
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gml b/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gml
index c010545bc35..8de797252f6 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_nodes_polys.gml
@@ -17,10 +17,10 @@
aaaaa
33
44.123456
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
315.00000000000000
@@ -31,10 +31,10 @@
aaaaa
33
44.123456
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
4.00000000000000
45.00000000000000
@@ -45,10 +45,10 @@
aaaaa
33
44.123456
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
8.00000000000000
135.00000000000000
@@ -59,10 +59,10 @@
aaaaa
33
44.123456
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
9.00000000000000
225.00000000000000
@@ -73,10 +73,10 @@
aaaaa
33
44.123456
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
10.00000000000000
225.00000000000000
@@ -87,10 +87,10 @@
aaaaa
33
44.123456
- 5
- 0
- 0
- 5
+ 5
+ 0
+ 0
+ 5
13.00000000000000
225.00000000000000
@@ -101,10 +101,10 @@
aaaaa
33
44.123456
- 6
- 0
- 0
- 6
+ 6
+ 0
+ 0
+ 6
16.00000000000000
315.00000000000000
@@ -115,10 +115,10 @@
Aaaaa
-33
0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
90.00000000000000
@@ -129,10 +129,10 @@
Aaaaa
-33
0
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
1.41421356237310
202.49999999999997
@@ -143,10 +143,10 @@
Aaaaa
-33
0
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
3.41421356237309
337.49999999999994
@@ -157,10 +157,10 @@
Aaaaa
-33
0
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
4.82842712474619
90.00000000000000
@@ -171,10 +171,10 @@
bbaaa
0.123
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
315.00000000000000
@@ -185,10 +185,10 @@
bbaaa
0.123
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
1.00000000000000
45.00000000000000
@@ -199,10 +199,10 @@
bbaaa
0.123
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
2.00000000000000
135.00000000000000
@@ -213,10 +213,10 @@
bbaaa
0.123
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
3.00000000000000
225.00000000000000
@@ -227,10 +227,10 @@
bbaaa
0.123
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
4.00000000000000
315.00000000000000
@@ -241,10 +241,10 @@
ASDF
0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
45.00000000000000
@@ -255,10 +255,10 @@
ASDF
0
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
4.00000000000000
135.00000000000000
@@ -269,10 +269,10 @@
ASDF
0
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
8.00000000000000
225.00000000000000
@@ -283,10 +283,10 @@
ASDF
0
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
12.00000000000000
315.00000000000000
@@ -297,10 +297,10 @@
ASDF
0
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
16.00000000000000
45.00000000000000
@@ -311,10 +311,10 @@
ASDF
0
- 5
- 0
- 1
- 0
+ 5
+ 0
+ 1
+ 0
16.00000000000000
225.00000000000000
@@ -325,10 +325,10 @@
ASDF
0
- 6
- 0
- 1
- 1
+ 6
+ 0
+ 1
+ 1
18.00000000000000
135.00000000000000
@@ -339,10 +339,10 @@
ASDF
0
- 7
- 0
- 1
- 2
+ 7
+ 0
+ 1
+ 2
20.00000000000000
45.00000000000000
@@ -353,10 +353,10 @@
ASDF
0
- 8
- 0
- 1
- 3
+ 8
+ 0
+ 1
+ 3
22.00000000000000
315.00000000000000
@@ -367,10 +367,10 @@
ASDF
0
- 9
- 0
- 1
- 4
+ 9
+ 0
+ 1
+ 4
24.00000000000000
225.00000000000000
@@ -380,10 +380,10 @@
120
-100291.43213
-
-
-
-
+
+
+
+
@@ -394,10 +394,10 @@
elim
2
3.33
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0.00000000000000
99.21747441146101
@@ -408,10 +408,10 @@
elim
2
3.33
- 1
- 0
- 0
- 1
+ 1
+ 0
+ 0
+ 1
3.16227766016838
144.21747441146101
@@ -422,10 +422,10 @@
elim
2
3.33
- 2
- 0
- 0
- 2
+ 2
+ 0
+ 0
+ 2
7.16227766016838
238.28252558853902
@@ -436,10 +436,10 @@
elim
2
3.33
- 3
- 0
- 0
- 3
+ 3
+ 0
+ 0
+ 3
11.63441361516796
328.28252558853899
@@ -450,10 +450,10 @@
elim
2
3.33
- 4
- 0
- 0
- 4
+ 4
+ 0
+ 0
+ 4
14.63441361516796
45.00000000000000
@@ -464,10 +464,10 @@
elim
2
3.33
- 5
- 0
- 0
- 5
+ 5
+ 0
+ 0
+ 5
15.63441361516796
99.21747441146101
diff --git a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gfs b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gfs
index 2e33190e148..cdcc455c90f 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gfs
@@ -12,23 +12,23 @@
5.00000
- node_pos
- node_pos
+ vertex_pos
+ vertex_pos
Integer
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gml b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gml
index ff716018344..a9a21dc0f2c 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_lines.gml
@@ -14,10 +14,10 @@
6,2
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
90
@@ -25,10 +25,10 @@
11,5
- -1
- 3
- 0
- 3
+ -1
+ 3
+ 0
+ 3
6.82842712474619
45
@@ -36,10 +36,10 @@
9,3
- 2
- 2
- 0
- 2
+ 2
+ 2
+ 0
+ 2
4
22.5
@@ -47,10 +47,10 @@
9,3
- -2
- 2
- 0
- 2
+ -2
+ 2
+ 0
+ 2
4
22.5
@@ -58,10 +58,10 @@
-1,-1
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
90
@@ -69,10 +69,10 @@
1,-1
- -1
- 1
- 0
- 1
+ -1
+ 1
+ 0
+ 1
2
90
@@ -80,10 +80,10 @@
-1,-1
- -2
- 0
- 0
- 0
+ -2
+ 0
+ 0
+ 0
0
90
@@ -91,10 +91,10 @@
2,0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
0
@@ -102,10 +102,10 @@
3,3
- -1
- 3
- 0
- 3
+ -1
+ 3
+ 0
+ 3
4
0
@@ -113,10 +113,10 @@
3,2
- 2
- 2
- 0
- 2
+ 2
+ 2
+ 0
+ 2
3
45
@@ -124,10 +124,10 @@
3,2
- -2
- 2
- 0
- 2
+ -2
+ 2
+ 0
+ 2
3
45
@@ -135,10 +135,10 @@
3,1
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
90
@@ -146,10 +146,10 @@
5,1
- -1
- 1
- 0
- 1
+ -1
+ 1
+ 0
+ 1
2
90
@@ -157,10 +157,10 @@
3,1
- -2
- 0
- 0
- 0
+ -2
+ 0
+ 0
+ 0
0
90
@@ -168,10 +168,10 @@
7,-3
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
90
@@ -179,10 +179,10 @@
10,-3
- -1
- 1
- 0
- 1
+ -1
+ 1
+ 0
+ 1
3
90
@@ -190,10 +190,10 @@
7,-3
- -2
- 0
- 0
- 0
+ -2
+ 0
+ 0
+ 0
0
90
@@ -201,10 +201,10 @@
6,-3
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
0
45
@@ -212,10 +212,10 @@
10,1
- -1
- 1
- 0
- 1
+ -1
+ 1
+ 0
+ 1
5.65685424949238
45
@@ -223,20 +223,20 @@
6,-3
- -2
- 0
- 0
- 0
+ -2
+ 0
+ 0
+ 0
0
45
-
-
-
-
+
+
+
+
diff --git a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gfs b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gfs
index 9562ab5c004..224ccde9625 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gfs
+++ b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gfs
@@ -28,28 +28,28 @@
Real
- node_pos
- node_pos
+ vertex_pos
+ vertex_pos
Integer
- node_index
- node_index
+ vertex_index
+ vertex_index
Integer
- node_part
- node_part
+ vertex_part
+ vertex_part
Integer
- node_part_ring
- node_part_ring
+ vertex_part_ring
+ vertex_part_ring
Integer
- node_part_index
- node_part_index
+ vertex_part_index
+ vertex_part_index
Integer
diff --git a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gml b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gml
index 9827e769184..18b33c66cb1 100644
--- a/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gml
+++ b/python/plugins/processing/tests/testdata/expected/extract_specific_nodes_polys.gml
@@ -17,11 +17,11 @@
aaaaa
33
44.123456
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
0
315
@@ -32,11 +32,11 @@
aaaaa
33
44.123456
- -1
- 6
- 0
- 0
- 6
+ -1
+ 6
+ 0
+ 0
+ 6
16
315
@@ -47,11 +47,11 @@
aaaaa
33
44.123456
- 5
- 5
- 0
- 0
- 5
+ 5
+ 5
+ 0
+ 0
+ 5
13
225
@@ -62,11 +62,11 @@
aaaaa
33
44.123456
- -5
- 2
- 0
- 0
- 2
+ -5
+ 2
+ 0
+ 0
+ 2
8
135
@@ -77,11 +77,11 @@
Aaaaa
-33
0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
0
90
@@ -92,11 +92,11 @@
Aaaaa
-33
0
- -1
- 3
- 0
- 0
- 3
+ -1
+ 3
+ 0
+ 0
+ 3
4.82842712474619
90
@@ -107,11 +107,11 @@
bbaaa
0.123
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
0
315
@@ -122,11 +122,11 @@
bbaaa
0.123
- -1
- 4
- 0
- 0
- 4
+ -1
+ 4
+ 0
+ 0
+ 4
4
315
@@ -137,11 +137,11 @@
bbaaa
0.123
- -5
- 0
- 0
- 0
- 0
+ -5
+ 0
+ 0
+ 0
+ 0
0
315
@@ -152,11 +152,11 @@
ASDF
0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
0
45
@@ -167,11 +167,11 @@
ASDF
0
- -1
- 9
- 0
- 1
- 4
+ -1
+ 9
+ 0
+ 1
+ 4
24
225
@@ -182,11 +182,11 @@
ASDF
0
- 5
- 5
- 0
- 1
- 0
+ 5
+ 5
+ 0
+ 1
+ 0
16
225
@@ -197,11 +197,11 @@
ASDF
0
- -5
- 5
- 0
- 1
- 0
+ -5
+ 5
+ 0
+ 1
+ 0
16
225
@@ -211,11 +211,11 @@
120
-100291.43213
-
-
-
-
-
+
+
+
+
+
@@ -226,11 +226,11 @@
elim
2
3.33
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
0
99.217474411461
@@ -241,11 +241,11 @@
elim
2
3.33
- -1
- 5
- 0
- 0
- 5
+ -1
+ 5
+ 0
+ 0
+ 5
15.634413615168
99.217474411461
@@ -256,11 +256,11 @@
elim
2
3.33
- 5
- 5
- 0
- 0
- 5
+ 5
+ 5
+ 0
+ 0
+ 5
15.634413615168
99.217474411461
@@ -271,11 +271,11 @@
elim
2
3.33
- -5
- 1
- 0
- 0
- 1
+ -5
+ 1
+ 0
+ 0
+ 1
3.16227766016838
144.217474411461
diff --git a/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml b/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
index 3ca2e5b1539..18cb8fcd808 100755
--- a/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
+++ b/python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
@@ -1267,8 +1267,8 @@ tests:
name: expected/single_sided_buffer_multiline_bevel.gml
type: vector
- - algorithm: qgis:extractnodes
- name: Test (qgis:extractnodes)
+ - algorithm: qgis:extractvertices
+ name: Extract vertices from multipolygons
params:
INPUT:
name: multipolys.gml
@@ -1284,8 +1284,8 @@ tests:
angle:
precision: 7
- - algorithm: qgis:extractnodes
- name: Extract nodes from polygons
+ - algorithm: qgis:extractvertices
+ name: Extract vertices from polygons
params:
INPUT:
name: polys.gml
@@ -1301,8 +1301,8 @@ tests:
angle:
precision: 7
- - algorithm: qgis:extractnodes
- name: Extract nodes from multilines
+ - algorithm: qgis:extractvertices
+ name: Extract vertices from multilines
params:
INPUT:
name: multilines.gml
@@ -1318,8 +1318,8 @@ tests:
angle:
precision: 7
- - algorithm: qgis:extractnodes
- name: Extract nodes from lines
+ - algorithm: qgis:extractvertices
+ name: Extract vertices from lines
params:
INPUT:
name: lines.gml
@@ -1756,13 +1756,13 @@ tests:
name: expected/extend_multilines.gml
type: vector
- - algorithm: qgis:extractspecificnodes
- name: Extract specific nodes lines
+ - algorithm: qgis:extractspecificvertices
+ name: Extract specific vertices lines
params:
INPUT:
name: lines.gml
type: vector
- NODES: 0,-1,2,-2
+ VERTICES: 0,-1,2,-2
results:
OUTPUT:
name: expected/extract_specific_nodes_lines.gml
@@ -1771,13 +1771,13 @@ tests:
fields:
fid: skip
- - algorithm: qgis:extractspecificnodes
- name: Extract specific nodes polygons
+ - algorithm: qgis:extractspecificvertices
+ name: Extract specific vertices polygons
params:
INPUT:
name: polys.gml
type: vector
- NODES: 0,-1,5,-5
+ VERTICES: 0,-1,5,-5
results:
OUTPUT:
name: expected/extract_specific_nodes_polys.gml
@@ -4686,8 +4686,8 @@ tests:
name: expected/difference.gml
type: vector
- - algorithm: native:removeduplicatenodes
- name: Remove duplicate nodes lines
+ - algorithm: native:removeduplicatevertices
+ name: Remove duplicate vertices from lines
params:
INPUT:
name: custom/line_duplicate_nodes.gml
diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt
index 19b4337de48..c52d938cff5 100755
--- a/src/analysis/CMakeLists.txt
+++ b/src/analysis/CMakeLists.txt
@@ -35,7 +35,7 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmextractbyexpression.cpp
processing/qgsalgorithmextractbyextent.cpp
processing/qgsalgorithmextractbylocation.cpp
- processing/qgsalgorithmextractnodes.cpp
+ processing/qgsalgorithmextractvertices.cpp
processing/qgsalgorithmfiledownloader.cpp
processing/qgsalgorithmfixgeometries.cpp
processing/qgsalgorithmjoinbyattribute.cpp
@@ -52,7 +52,7 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmpackage.cpp
processing/qgsalgorithmpromotetomultipart.cpp
processing/qgsalgorithmrasterlayeruniquevalues.cpp
- processing/qgsalgorithmremoveduplicatenodes
+ processing/qgsalgorithmremoveduplicatevertices.cpp
processing/qgsalgorithmremovenullgeometry.cpp
processing/qgsalgorithmrenamelayer.cpp
processing/qgsalgorithmsaveselectedfeatures.cpp
diff --git a/src/analysis/processing/qgsalgorithmextractnodes.cpp b/src/analysis/processing/qgsalgorithmextractvertices.cpp
similarity index 69%
rename from src/analysis/processing/qgsalgorithmextractnodes.cpp
rename to src/analysis/processing/qgsalgorithmextractvertices.cpp
index 8b41906084f..66d41bbb111 100644
--- a/src/analysis/processing/qgsalgorithmextractnodes.cpp
+++ b/src/analysis/processing/qgsalgorithmextractvertices.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- qgsalgorithmextractnodes.cpp
+ qgsalgorithmextractvertices.cpp
--------------------------
begin : November 2017
copyright : (C) 2017 by Mathieu Pellerin
@@ -15,58 +15,58 @@
* *
***************************************************************************/
-#include "qgsalgorithmextractnodes.h"
+#include "qgsalgorithmextractvertices.h"
#include "qgsabstractgeometry.h"
#include "qgsgeometryutils.h"
///@cond PRIVATE
-QString QgsExtractNodesAlgorithm::name() const
+QString QgsExtractVerticesAlgorithm::name() const
{
- return QStringLiteral( "extractnodes" );
+ return QStringLiteral( "extractvertices" );
}
-QString QgsExtractNodesAlgorithm::displayName() const
+QString QgsExtractVerticesAlgorithm::displayName() const
{
- return QObject::tr( "Extract nodes" );
+ return QObject::tr( "Extract vertices" );
}
-QStringList QgsExtractNodesAlgorithm::tags() const
+QStringList QgsExtractVerticesAlgorithm::tags() const
{
- return QObject::tr( "points,vertex,vertices" ).split( ',' );
+ return QObject::tr( "points,vertex,nodes" ).split( ',' );
}
-QString QgsExtractNodesAlgorithm::group() const
+QString QgsExtractVerticesAlgorithm::group() const
{
return QObject::tr( "Vector geometry" );
}
-QString QgsExtractNodesAlgorithm::groupId() const
+QString QgsExtractVerticesAlgorithm::groupId() const
{
return QStringLiteral( "vectorgeometry" );
}
-QString QgsExtractNodesAlgorithm::shortHelpString() const
+QString QgsExtractVerticesAlgorithm::shortHelpString() const
{
- return QObject::tr( "This algorithm takes a line or polygon layer and generates a point layer with points representing the nodes in the input lines or polygons. The attributes associated to each point are the same ones associated to the line or polygon that the point belongs to." ) +
+ return QObject::tr( "This algorithm takes a line or polygon layer and generates a point layer with points representing the vertices in the input lines or polygons. The attributes associated to each point are the same ones associated to the line or polygon that the point belongs to." ) +
QStringLiteral( "\n\n" ) +
- QObject::tr( "Additional fields are added to the nodes indicating the node index (beginning at 0), the node’s part and its index within the part (as well as its ring for polygons), distance along original geometry and bisector angle of node for original geometry." );
+ QObject::tr( "Additional fields are added to the point indicating the vertex index (beginning at 0), the vertex’s part and its index within the part (as well as its ring for polygons), distance along original geometry and bisector angle of vertex for original geometry." );
}
-QgsExtractNodesAlgorithm *QgsExtractNodesAlgorithm::createInstance() const
+QgsExtractVerticesAlgorithm *QgsExtractVerticesAlgorithm::createInstance() const
{
- return new QgsExtractNodesAlgorithm();
+ return new QgsExtractVerticesAlgorithm();
}
-void QgsExtractNodesAlgorithm::initAlgorithm( const QVariantMap & )
+void QgsExtractVerticesAlgorithm::initAlgorithm( const QVariantMap & )
{
addParameter( new QgsProcessingParameterFeatureSource( QStringLiteral( "INPUT" ), QObject::tr( "Input layer" ) ) );
- addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Nodes" ) ) );
+ addParameter( new QgsProcessingParameterFeatureSink( QStringLiteral( "OUTPUT" ), QObject::tr( "Vertices" ) ) );
}
-QVariantMap QgsExtractNodesAlgorithm::processAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
+QVariantMap QgsExtractVerticesAlgorithm::processAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
std::unique_ptr< QgsFeatureSource > featureSource( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
if ( !featureSource )
@@ -83,13 +83,13 @@ QVariantMap QgsExtractNodesAlgorithm::processAlgorithm( const QVariantMap ¶m
}
QgsFields outputFields = featureSource->fields();
- outputFields.append( QgsField( QStringLiteral( "node_index" ), QVariant::Int, QString(), 10, 0 ) );
- outputFields.append( QgsField( QStringLiteral( "node_part" ), QVariant::Int, QString(), 10, 0 ) );
+ outputFields.append( QgsField( QStringLiteral( "vertex_index" ), QVariant::Int, QString(), 10, 0 ) );
+ outputFields.append( QgsField( QStringLiteral( "vertex_part" ), QVariant::Int, QString(), 10, 0 ) );
if ( QgsWkbTypes::geometryType( featureSource->wkbType() ) == QgsWkbTypes::PolygonGeometry )
{
- outputFields.append( QgsField( QStringLiteral( "node_part_ring" ), QVariant::Int, QString(), 10, 0 ) );
+ outputFields.append( QgsField( QStringLiteral( "vertex_part_ring" ), QVariant::Int, QString(), 10, 0 ) );
}
- outputFields.append( QgsField( QStringLiteral( "node_part_index" ), QVariant::Int, QString(), 10, 0 ) );
+ outputFields.append( QgsField( QStringLiteral( "vertex_part_index" ), QVariant::Int, QString(), 10, 0 ) );
outputFields.append( QgsField( QStringLiteral( "distance" ), QVariant::Double, QString(), 20, 14 ) );
outputFields.append( QgsField( QStringLiteral( "angle" ), QVariant::Double, QString(), 20, 14 ) );
diff --git a/src/analysis/processing/qgsalgorithmextractnodes.h b/src/analysis/processing/qgsalgorithmextractvertices.h
similarity index 82%
rename from src/analysis/processing/qgsalgorithmextractnodes.h
rename to src/analysis/processing/qgsalgorithmextractvertices.h
index e1589b2da5b..daeda55ac38 100644
--- a/src/analysis/processing/qgsalgorithmextractnodes.h
+++ b/src/analysis/processing/qgsalgorithmextractvertices.h
@@ -1,5 +1,5 @@
/***************************************************************************
- qgsalgorithmextractnodes.h
+ qgsalgorithmextractvertices.h
-------------------------
begin : November 2017
copyright : (C) 2017 by Mathieu Pellerin
@@ -15,8 +15,8 @@
* *
***************************************************************************/
-#ifndef QGSALGORITHMEXTRACTNODES_H
-#define QGSALGORITHMEXTRACTNODES_H
+#ifndef QGSALGORITHMEXTRACTVERTICES_H
+#define QGSALGORITHMEXTRACTVERTICES_H
#define SIP_NO_FILE
@@ -28,12 +28,12 @@
/**
* Native extract nodes algorithm.
*/
-class QgsExtractNodesAlgorithm : public QgsProcessingAlgorithm
+class QgsExtractVerticesAlgorithm : public QgsProcessingAlgorithm
{
public:
- QgsExtractNodesAlgorithm() = default;
+ QgsExtractVerticesAlgorithm() = default;
void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
QString name() const override;
QString displayName() const override;
@@ -41,7 +41,7 @@ class QgsExtractNodesAlgorithm : public QgsProcessingAlgorithm
QString group() const override;
QString groupId() const override;
QString shortHelpString() const override;
- QgsExtractNodesAlgorithm *createInstance() const override SIP_FACTORY;
+ QgsExtractVerticesAlgorithm *createInstance() const override SIP_FACTORY;
protected:
@@ -52,6 +52,6 @@ class QgsExtractNodesAlgorithm : public QgsProcessingAlgorithm
///@endcond PRIVATE
-#endif // QGSALGORITHMEXTRACTNODES_H
+#endif // QGSALGORITHMEXTRACTVERTICES_H
diff --git a/src/analysis/processing/qgsalgorithmremoveduplicatenodes.cpp b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp
similarity index 60%
rename from src/analysis/processing/qgsalgorithmremoveduplicatenodes.cpp
rename to src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp
index 313b83b9589..768a09ce951 100644
--- a/src/analysis/processing/qgsalgorithmremoveduplicatenodes.cpp
+++ b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- qgsalgorithmremoveduplicatenodes.cpp
+ qgsalgorithmremoveduplicatevertices.cpp
---------------------
begin : November 2017
copyright : (C) 2017 by Nyall Dawson
@@ -15,60 +15,60 @@
* *
***************************************************************************/
-#include "qgsalgorithmremoveduplicatenodes.h"
+#include "qgsalgorithmremoveduplicatevertices.h"
///@cond PRIVATE
-QString QgsAlgorithmRemoveDuplicateNodes::name() const
+QString QgsAlgorithmRemoveDuplicateVertices::name() const
{
- return QStringLiteral( "removeduplicatenodes" );
+ return QStringLiteral( "removeduplicatevertices" );
}
-QString QgsAlgorithmRemoveDuplicateNodes::displayName() const
+QString QgsAlgorithmRemoveDuplicateVertices::displayName() const
{
- return QObject::tr( "Remove duplicate nodes" );
+ return QObject::tr( "Remove duplicate vertices" );
}
-QStringList QgsAlgorithmRemoveDuplicateNodes::tags() const
+QStringList QgsAlgorithmRemoveDuplicateVertices::tags() const
{
- return QObject::tr( "points,valid,overlapping" ).split( ',' );
+ return QObject::tr( "points,valid,overlapping,vertex,nodes" ).split( ',' );
}
-QString QgsAlgorithmRemoveDuplicateNodes::group() const
+QString QgsAlgorithmRemoveDuplicateVertices::group() const
{
return QObject::tr( "Vector geometry" );
}
-QString QgsAlgorithmRemoveDuplicateNodes::groupId() const
+QString QgsAlgorithmRemoveDuplicateVertices::groupId() const
{
return QStringLiteral( "vectorgeometry" );
}
-QString QgsAlgorithmRemoveDuplicateNodes::outputName() const
+QString QgsAlgorithmRemoveDuplicateVertices::outputName() const
{
return QObject::tr( "Cleaned" );
}
-QString QgsAlgorithmRemoveDuplicateNodes::shortHelpString() const
+QString QgsAlgorithmRemoveDuplicateVertices::shortHelpString() const
{
- return QObject::tr( "This algorithm removes duplicate nodes from features, wherever removing the nodes does "
+ return QObject::tr( "This algorithm removes duplicate vertices from features, wherever removing the vertices does "
"not result in a degenerate geometry.\n\n"
"The tolerance parameter specifies the tolerance for coordinates when determining whether "
"vertices are identical.\n\n"
- "By default, z values are not considered when detecting duplicate nodes. E.g. two nodes "
+ "By default, z values are not considered when detecting duplicate vertices. E.g. two vertices "
"with the same x and y coordinate but different z values will still be considered "
"duplicate and one will be removed. If the Use Z Value parameter is true, then the z values are "
- "also tested and nodes with the same x and y but different z will be maintained.\n\n"
- "Note that duplicate nodes are not tested between different parts of a multipart geometry. E.g. "
+ "also tested and vertices with the same x and y but different z will be maintained.\n\n"
+ "Note that duplicate vertices are not tested between different parts of a multipart geometry. E.g. "
"a multipoint geometry with overlapping points will not be changed by this method." );
}
-QgsAlgorithmRemoveDuplicateNodes *QgsAlgorithmRemoveDuplicateNodes::createInstance() const
+QgsAlgorithmRemoveDuplicateVertices *QgsAlgorithmRemoveDuplicateVertices::createInstance() const
{
- return new QgsAlgorithmRemoveDuplicateNodes();
+ return new QgsAlgorithmRemoveDuplicateVertices();
}
-void QgsAlgorithmRemoveDuplicateNodes::initParameters( const QVariantMap & )
+void QgsAlgorithmRemoveDuplicateVertices::initParameters( const QVariantMap & )
{
addParameter( new QgsProcessingParameterNumber( QStringLiteral( "TOLERANCE" ),
QObject::tr( "Tolerance" ), QgsProcessingParameterNumber::Double,
@@ -77,14 +77,14 @@ void QgsAlgorithmRemoveDuplicateNodes::initParameters( const QVariantMap & )
QObject::tr( "Use Z Value" ), false ) );
}
-bool QgsAlgorithmRemoveDuplicateNodes::prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback * )
+bool QgsAlgorithmRemoveDuplicateVertices::prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback * )
{
mTolerance = parameterAsDouble( parameters, QStringLiteral( "TOLERANCE" ), context );
mUseZValues = parameterAsBool( parameters, QStringLiteral( "USE_Z_VALUE" ), context );
return true;
}
-QgsFeature QgsAlgorithmRemoveDuplicateNodes::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
+QgsFeature QgsAlgorithmRemoveDuplicateVertices::processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback * )
{
QgsFeature f = feature;
if ( f.hasGeometry() )
diff --git a/src/analysis/processing/qgsalgorithmremoveduplicatenodes.h b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.h
similarity index 81%
rename from src/analysis/processing/qgsalgorithmremoveduplicatenodes.h
rename to src/analysis/processing/qgsalgorithmremoveduplicatevertices.h
index 92267bd2f1b..e8dbd107650 100644
--- a/src/analysis/processing/qgsalgorithmremoveduplicatenodes.h
+++ b/src/analysis/processing/qgsalgorithmremoveduplicatevertices.h
@@ -1,5 +1,5 @@
/***************************************************************************
- qgsalgorithmremoveduplicatenodes.h
+ qgsalgorithmremoveduplicatevertices.h
---------------------
begin : November 2017
copyright : (C) 2017 by Nyall Dawson
@@ -15,8 +15,8 @@
* *
***************************************************************************/
-#ifndef QGSALGORITHMREMOVEDUPLICATENODES_H
-#define QGSALGORITHMREMOVEDUPLICATENODES_H
+#ifndef QGSALGORITHMREMOVEDUPLICATEVERTICES_H
+#define QGSALGORITHMREMOVEDUPLICATEVERTICES_H
#define SIP_NO_FILE
@@ -28,19 +28,19 @@
/**
* Native remove duplicate nodes algorithm.
*/
-class QgsAlgorithmRemoveDuplicateNodes : public QgsProcessingFeatureBasedAlgorithm
+class QgsAlgorithmRemoveDuplicateVertices : public QgsProcessingFeatureBasedAlgorithm
{
public:
- QgsAlgorithmRemoveDuplicateNodes() = default;
+ QgsAlgorithmRemoveDuplicateVertices() = default;
QString name() const override;
QString displayName() const override;
QStringList tags() const override;
QString group() const override;
QString groupId() const override;
QString shortHelpString() const override;
- QgsAlgorithmRemoveDuplicateNodes *createInstance() const override SIP_FACTORY;
+ QgsAlgorithmRemoveDuplicateVertices *createInstance() const override SIP_FACTORY;
void initParameters( const QVariantMap &configuration = QVariantMap() ) override;
protected:
@@ -58,6 +58,6 @@ class QgsAlgorithmRemoveDuplicateNodes : public QgsProcessingFeatureBasedAlgorit
///@endcond PRIVATE
-#endif // QGSALGORITHMSIMPLIFY_H
+#endif // QGSALGORITHMREMOVEDUPLICATEVERTICES_H
diff --git a/src/analysis/processing/qgsnativealgorithms.cpp b/src/analysis/processing/qgsnativealgorithms.cpp
index ed268f4f847..0526c891096 100644
--- a/src/analysis/processing/qgsnativealgorithms.cpp
+++ b/src/analysis/processing/qgsnativealgorithms.cpp
@@ -32,7 +32,7 @@
#include "qgsalgorithmextractbyexpression.h"
#include "qgsalgorithmextractbyextent.h"
#include "qgsalgorithmextractbylocation.h"
-#include "qgsalgorithmextractnodes.h"
+#include "qgsalgorithmextractvertices.h"
#include "qgsalgorithmfiledownloader.h"
#include "qgsalgorithmfixgeometries.h"
#include "qgsalgorithmjoinbyattribute.h"
@@ -49,7 +49,7 @@
#include "qgsalgorithmpackage.h"
#include "qgsalgorithmpromotetomultipart.h"
#include "qgsalgorithmrasterlayeruniquevalues.h"
-#include "qgsalgorithmremoveduplicatenodes.h"
+#include "qgsalgorithmremoveduplicatevertices.h"
#include "qgsalgorithmremovenullgeometry.h"
#include "qgsalgorithmrenamelayer.h"
#include "qgsalgorithmsaveselectedfeatures.h"
@@ -116,7 +116,7 @@ void QgsNativeAlgorithms::loadAlgorithms()
addAlgorithm( new QgsExtractByExpressionAlgorithm() );
addAlgorithm( new QgsExtractByExtentAlgorithm() );
addAlgorithm( new QgsExtractByLocationAlgorithm() );
- addAlgorithm( new QgsExtractNodesAlgorithm() );
+ addAlgorithm( new QgsExtractVerticesAlgorithm() );
addAlgorithm( new QgsFileDownloaderAlgorithm() );
addAlgorithm( new QgsFixGeometriesAlgorithm() );
addAlgorithm( new QgsJoinByAttributeAlgorithm() );
@@ -133,7 +133,7 @@ void QgsNativeAlgorithms::loadAlgorithms()
addAlgorithm( new QgsPackageAlgorithm() );
addAlgorithm( new QgsPromoteToMultipartAlgorithm() );
addAlgorithm( new QgsRasterLayerUniqueValuesReportAlgorithm() );
- addAlgorithm( new QgsAlgorithmRemoveDuplicateNodes() );
+ addAlgorithm( new QgsAlgorithmRemoveDuplicateVertices() );
addAlgorithm( new QgsRemoveNullGeometryAlgorithm() );
addAlgorithm( new QgsRenameLayerAlgorithm() );
addAlgorithm( new QgsSaveSelectedFeatures() );