Skip to content

Commit

Permalink
Add Vector coverage algorithms
Browse files Browse the repository at this point in the history
Fixes qgis#9082
  • Loading branch information
DelazJ committed Nov 4, 2024
1 parent bbf2f70 commit b1fdd28
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/user_manual/processing_algs/qgis/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ algorithms.
rasterterrainanalysis
rastertools
vectoranalysis
vectorcoverage
vectorcreation
vectorgeneral
vectorgeometry
Expand Down
228 changes: 228 additions & 0 deletions docs/user_manual/processing_algs/qgis/vectorcoverage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
Vector coverage
===============

.. only:: html

.. contents::
:local:
:depth: 1


.. _qgiscoverageunion:

Dissolve coverage
-----------------

Operates on a coverage (represented as a set of polygon features with exactly matching edge geometry)
to dissolve (union) the geometries.
It provides a heavily optimized approach for unioning these features compared with the standard Dissolve tools.

.. seealso:: :ref:`qgisdissolve`

Parameters
..........

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Input layer**
- ``INPUT``
- [vector: polygon]
- Input polygon vector layer
* - **Dissolved**
- ``OUTPUT``
- [vector: polygon]

Default: ``[Create temporary layer]``
- Specify the output vector layer. One of:

.. include:: ../algs_include.rst
:start-after: **layer_output_types**
:end-before: **end_layer_output_types**

Outputs
.......

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Dissolved**
- ``OUTPUT``
- [vector: polygon]
- The output polygon vector layer with dissolved geometries.

Python code
...........

**Algorithm ID**: ``native:coverageunion``

.. include:: ../algs_include.rst
:start-after: **algorithm_code_section**
:end-before: **end_algorithm_code_section**


.. _qgiscoveragesimplify:

Simplify coverage
-----------------

Operates on a coverage (represented as a set of polygon features with exactly matching edge geometry)
to apply a Visvalingam–Whyatt simplification to the edges, reducing complexity in proportion with the provided tolerance,
while retaining a valid coverage (i.e. no edges will cross or touch after the simplification).
Geometries will never be removed, but they may be simplified down to just a triangle.
Also, some geometries (such as polygons which have too few non-repeated points) will be returned unchanged.

If the input dataset is not a valid coverage due to overlaps, it will still be simplified,
but invalid topology such as crossing edges will still be invalid.

**Requires version of GEOS >= 3.12**

.. seealso:: :ref:`qgissimplifygeometries`, `qgissmoothgeometry`

Parameters
..........

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Input layer**
- ``INPUT``
- [vector: polygon]
- Input polygon vector layer
* - **Tolerance**
- ``TOLERANCE``
- [number]

Default: 0.0
- The maximum distance (in unit of choice) between two consecutive vertices to get merged.
* - **Preserve boundary**
- ``PRESERVE_BOUNDARY``
- [number]

Default: False
- When enabled, the outside edges of the coverage will be preserved without simplification
* - **Simplified**
- ``OUTPUT``
- [vector: polygon]

Default: ``[Create temporary layer]``
- Specify the output vector layer. One of:

.. include:: ../algs_include.rst
:start-after: **layer_output_types**
:end-before: **end_layer_output_types**

Outputs
.......

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Simplified**
- ``OUTPUT``
- [vector: polygon]
- The output polygon vector layer, with a lower number of vertices.

Python code
...........

**Algorithm ID**: ``native:coveragesimplify``

.. include:: ../algs_include.rst
:start-after: **algorithm_code_section**
:end-before: **end_algorithm_code_section**


.. _qgiscoveragevalidate:

Validate coverage
-----------------

Analyzes a coverage (represented as a set of polygon features with exactly matching edge geometry)
to find places where the assumption of exactly matching edges is not met.
Invalidity includes polygons that overlap or that have gaps smaller than the specified gap width.

**Requires version of GEOS >= 3.12**

.. seealso:: :ref:`qgischeckvalidity`

Parameters
..........

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Input layer**
- ``INPUT``
- [vector: polygon]
- Input polygon vector layer
* - **Gap width**
- ``GAP_WIDTH``
- [number]

Default: 0.0
- The maximum width of gap to detect
* - **Invalid edges**
- ``INVALID_EDGES``
- [vector: line]

Default: ``[Create temporary layer]``
- Specify the output vector layer. One of:

.. include:: ../algs_include.rst
:start-after: **layer_output_types_skip**
:end-before: **end_layer_output_types_skip**

Outputs
.......

.. list-table::
:header-rows: 1
:widths: 20 20 20 40

* - Label
- Name
- Type
- Description
* - **Invalid edges**
- ``OUTPUT``
- [vector: line]
- The output line vector layer showing error edges for each invalid polygon.
* - **Validity result**
- ``IS_VALID``
- [boolean]
- Returns whether the coverage is valid or not.

Python code
...........

**Algorithm ID**: ``native:coveragevalidate``

.. include:: ../algs_include.rst
:start-after: **algorithm_code_section**
:end-before: **end_algorithm_code_section**
11 changes: 5 additions & 6 deletions docs/user_manual/processing_algs/qgis/vectorgeometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ additional information (number of errors found and types of error):
**Default menu**: :menuselection:`Vector --> Geometry Tools`

.. seealso:: :ref:`qgisfixgeometries` and the core plugin
:ref:`geometry_checker`
:ref:`geometry_checker`, :ref:`qgiscoveragevalidate`

Parameters
..........
Expand Down Expand Up @@ -2134,7 +2134,7 @@ input feature that happens to be processed.

**Default menu**: :menuselection:`Vector --> Geoprocessing Tools`

.. seealso:: :ref:`qgisaggregate`, :ref:`qgiscollect`
.. seealso:: :ref:`qgiscoverageunion`, :ref:`qgisaggregate`, :ref:`qgiscollect`

Parameters
..........
Expand Down Expand Up @@ -6159,7 +6159,7 @@ of line and polygon features

**Default menu**: :menuselection:`Vector --> Geometry Tools`

.. seealso:: :ref:`qgissmoothgeometry`, :ref:`qgisdensifygeometries`,
.. seealso:: :ref:`qgiscoveragesimplify`, :ref:`qgissmoothgeometry`, :ref:`qgisdensifygeometries`,
:ref:`qgisdensifygeometriesgivenaninterval`

Parameters
Expand Down Expand Up @@ -6400,9 +6400,8 @@ this will not be smoothed. For example, setting the maximum angle to
:ref:`features in-place modification <processing_inplace_edit>`
of line and polygon features

.. seealso:: :ref:`qgissimplifygeometries`,
:ref:`qgisdensifygeometries`,
:ref:`qgisdensifygeometriesgivenaninterval`
.. seealso:: :ref:`qgissimplifygeometries`, :ref:`qgiscoveragesimplify`,
:ref:`qgisdensifygeometries`, :ref:`qgisdensifygeometriesgivenaninterval`

Parameters
..........
Expand Down

0 comments on commit b1fdd28

Please sign in to comment.