From b1fdd28c8b113bd3512575c56df9de60ac4adfb2 Mon Sep 17 00:00:00 2001 From: Harrissou Sant-anna Date: Thu, 31 Oct 2024 13:37:54 +0100 Subject: [PATCH] Add Vector coverage algorithms Fixes #9082 --- .../processing_algs/qgis/index.rst | 1 + .../processing_algs/qgis/vectorcoverage.rst | 228 ++++++++++++++++++ .../processing_algs/qgis/vectorgeometry.rst | 11 +- 3 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 docs/user_manual/processing_algs/qgis/vectorcoverage.rst diff --git a/docs/user_manual/processing_algs/qgis/index.rst b/docs/user_manual/processing_algs/qgis/index.rst index 3547cc999f5..d7605cccb91 100644 --- a/docs/user_manual/processing_algs/qgis/index.rst +++ b/docs/user_manual/processing_algs/qgis/index.rst @@ -33,6 +33,7 @@ algorithms. rasterterrainanalysis rastertools vectoranalysis + vectorcoverage vectorcreation vectorgeneral vectorgeometry diff --git a/docs/user_manual/processing_algs/qgis/vectorcoverage.rst b/docs/user_manual/processing_algs/qgis/vectorcoverage.rst new file mode 100644 index 00000000000..643d51ae06c --- /dev/null +++ b/docs/user_manual/processing_algs/qgis/vectorcoverage.rst @@ -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** diff --git a/docs/user_manual/processing_algs/qgis/vectorgeometry.rst b/docs/user_manual/processing_algs/qgis/vectorgeometry.rst index ff16f7c2b56..cc75114ae7b 100644 --- a/docs/user_manual/processing_algs/qgis/vectorgeometry.rst +++ b/docs/user_manual/processing_algs/qgis/vectorgeometry.rst @@ -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 .......... @@ -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 .......... @@ -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 @@ -6400,9 +6400,8 @@ this will not be smoothed. For example, setting the maximum angle to :ref:`features in-place modification ` of line and polygon features -.. seealso:: :ref:`qgissimplifygeometries`, - :ref:`qgisdensifygeometries`, - :ref:`qgisdensifygeometriesgivenaninterval` +.. seealso:: :ref:`qgissimplifygeometries`, :ref:`qgiscoveragesimplify`, + :ref:`qgisdensifygeometries`, :ref:`qgisdensifygeometriesgivenaninterval` Parameters ..........