-
-
Notifications
You must be signed in to change notification settings - Fork 1k
expose concave hull of polygons & fill gaps between polygons alg #11081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1301,7 +1301,7 @@ Parameters | |
| - Description | ||
| * - **Input layer** | ||
| - ``INPUT`` | ||
| - [vector: point] | ||
| - [vector: geometry] | ||
| - Input vector layer with multipoint features | ||
|
Comment on lines
+1304
to
1305
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to review this description as well as the algorithm description. They are outdated because of focusing on multipoint input fetures. |
||
| * - **Threshold** | ||
| - ``ALPHA`` | ||
|
|
@@ -3253,6 +3253,107 @@ Python code | |
| :start-after: **algorithm_code_section** | ||
| :end-before: **end_algorithm_code_section** | ||
|
|
||
| .. _qgistightconcavehullofpolygons: | ||
|
|
||
| Fill gaps between polygons | ||
| --------------------------- | ||
|
|
||
| ``Added in 4.2`` | ||
|
|
||
| Calculates a concave hull for each multi-polygon feature in an input layer. | ||
|
|
||
| Unlike the standard Concave Hull algorithm, a tight concave hull is a (possibly) | ||
| non-convex polygon containing all the input polygons. | ||
| The computed hull fills the gaps between the polygons without intersecting their interiors. | ||
| It strictly follows the outer boundaries of the input polygons, allowing you to fill gaps between | ||
| them without distorting their original shapes. | ||
|
|
||
| It is particularly useful for cases such as generalizing groups of building outlines, | ||
| creating 'district' polygons around blocks, or removing gaps and joining disjoint sets of polygons. | ||
|
|
||
| The algorithm works by creating a constrained Delaunay Triangulation of the space between | ||
| the polygons and removing the longest outer edges until a target criterion is reached. | ||
|
|
||
| The input geometry must be a valid Polygon or MultiPolygon (i.e., the individual polygons must not overlap). | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this sentence is taken from the GUI but something makes me uncomfortable with it:
|
||
|
|
||
| .. figure:: img/fill_gaps_between_polygons.png | ||
| :align: center | ||
|
|
||
| Filling gaps between polygons using ratio values of 0, 0.3 and 1. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As suggested above, turn the images -90°? |
||
|
|
||
|
|
||
| .. seealso:: :ref:`qgisconvexhull`, :ref:`qgisconcavehullbyfeature` | ||
|
|
||
| Parameters | ||
| .......... | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
| :widths: 20 20 20 40 | ||
| :class: longtable | ||
|
|
||
| * - Label | ||
| - Name | ||
| - Type | ||
| - Description | ||
| * - **Input layer** | ||
| - ``INPUT`` | ||
| - [vector: polygon] | ||
| - Input vector layer with multipolygon features | ||
| * - **Ratio** | ||
| - ``RATIO`` | ||
| - [numeric: double] | ||
|
|
||
| Default: 0.3 | ||
| - Specifies the maximum edge length as a fraction of the difference between the longest and shortest edge | ||
| lengths between the polygons. This normalizes the maximum edge length to be scale-free. | ||
| A value of 1 produces the convex hull; a value of 0 produces the original polygons. | ||
| * - **Allow holes** | ||
| - ``HOLES`` | ||
| - [boolean] | ||
|
|
||
| Default: True | ||
| - Controls whether the computed concave hull is allowed to contain holes. | ||
| * - **Tight concave hulls** | ||
| - ``OUTPUT`` | ||
| - [vector: polygon] | ||
|
|
||
| Default: ``[Create temporary layer]`` | ||
| - Specify the output vector layer. :ref:`One of <output_parameter_widget>`: | ||
|
|
||
| .. 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 | ||
| :class: longtable | ||
|
|
||
| * - Label | ||
| - Name | ||
| - Type | ||
| - Description | ||
| * - **Tight concave hulls** | ||
| - ``OUTPUT`` | ||
| - [vector: polygon] | ||
| - The output vector layer containing the tight concave hull | ||
| for each input multipolygon feature. | ||
|
|
||
| Python code | ||
| ........... | ||
|
|
||
| **Algorithm ID**: ``native:tightconcavehullofpolygons`` | ||
|
|
||
| .. include:: ../algs_include.rst | ||
| :start-after: **algorithm_code_section** | ||
| :end-before: **end_algorithm_code_section** | ||
|
|
||
|
|
||
|
|
||
| .. _qgisfilterverticesbym: | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add more space between the different scenarios to help distinguish the different groups? And instead of reading from top to bottom, what about organizing the images from left to right, i.e. rotate -90°.
Question: the feature in the middle has a hole, right? A hole whose vertices touch the outer ring of the polygon? Is this valid?