Skip to content

Commit

Permalink
[processing] port extract specific vertices algorithm to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Dec 9, 2019
1 parent 4bbb07f commit c2d1649
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 166 deletions.
7 changes: 0 additions & 7 deletions python/plugins/processing/algs/help/qgis.yaml
Expand Up @@ -136,13 +136,6 @@ qgis:extractbyexpression: >

For more information about expressions see the <a href ="{qgisdocs}/user_manual/working_with_vector/expression.html">user manual</a>

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.

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.

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.

Expand Down
155 changes: 0 additions & 155 deletions python/plugins/processing/algs/qgis/ExtractSpecificVertices.py

This file was deleted.

2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
Expand Up @@ -43,7 +43,6 @@
from .EliminateSelection import EliminateSelection
from .ExecuteSQL import ExecuteSQL
from .ExportGeometryInfo import ExportGeometryInfo
from .ExtractSpecificVertices import ExtractSpecificVertices
from .FieldPyculator import FieldsPyculator
from .FieldsCalculator import FieldsCalculator
from .FieldsMapper import FieldsMapper
Expand Down Expand Up @@ -136,7 +135,6 @@ def getAlgs(self):
EliminateSelection(),
ExecuteSQL(),
ExportGeometryInfo(),
ExtractSpecificVertices(),
FieldsCalculator(),
FieldsMapper(),
FieldsPyculator(),
Expand Down
Expand Up @@ -234,7 +234,7 @@ tests:
name: expected/extend_multilines.gml
type: vector

- algorithm: qgis:extractspecificvertices
- algorithm: native:extractspecificvertices
name: Extract specific vertices lines
params:
INPUT:
Expand All @@ -249,7 +249,7 @@ tests:
fields:
fid: skip

- algorithm: qgis:extractspecificvertices
- algorithm: native:extractspecificvertices
name: Extract specific vertices polygons
params:
INPUT:
Expand Down
1 change: 1 addition & 0 deletions src/analysis/CMakeLists.txt
Expand Up @@ -58,6 +58,7 @@ SET(QGIS_ANALYSIS_SRCS
processing/qgsalgorithmextractlayoutmapextent.cpp
processing/qgsalgorithmextractzmvalues.cpp
processing/qgsalgorithmextractvertices.cpp
processing/qgsalgorithmextractspecificvertices.cpp
processing/qgsalgorithmfiledownloader.cpp
processing/qgsalgorithmfilter.cpp
processing/qgsalgorithmfiltervertices.cpp
Expand Down

0 comments on commit c2d1649

Please sign in to comment.