Skip to content

Commit

Permalink
DOC: note on a precision issue in enclosed_tessellation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Jun 13, 2024
1 parent e3c1f03 commit ea42951
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions momepy/functional/_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ def morphological_tessellation(
and there are three particular patterns causing issues:
1. Features will collapse into empty polygon - these
do not have tessellation cell in the end.
do not have tessellation cell in the end.
2. Features will split into MultiPolygons - in some cases,
features with narrow links between parts split into two
during 'shrinking'. In most cases that is not an issue
and the resulting tessellation is correct anyway, but
sometimes this results in a cell being a MultiPolygon,
which is not correct.
features with narrow links between parts split into two
during 'shrinking'. In most cases that is not an issue
and the resulting tessellation is correct anyway, but
sometimes this results in a cell being a MultiPolygon,
which is not correct.
3. Overlapping features - features which overlap even
after 'shrinking' cause invalid tessellation geometry.
after 'shrinking' cause invalid tessellation geometry.
All three types can be tested using :class:`momepy.CheckTessellationInput`.
Expand Down Expand Up @@ -115,14 +115,14 @@ def enclosed_tessellation(
particular patterns causing issues:
1. Features will collapse into empty polygon - these
do not have tessellation cell in the end.
do not have tessellation cell in the end.
2. Features will split into MultiPolygons - in some cases,
features with narrow links between parts split into two during 'shrinking'.
In most cases that is not an issue and the resulting tessellation is correct
anyway, but sometimes this results in a cell being a MultiPolygon, which is
not correct.
features with narrow links between parts split into two during 'shrinking'.
In most cases that is not an issue and the resulting tessellation is correct
anyway, but sometimes this results in a cell being a MultiPolygon, which is
not correct.
3. Overlapping features - features which overlap even
after 'shrinking' cause invalid tessellation geometry.
after 'shrinking' cause invalid tessellation geometry.
All three types can be tested using :class:`momepy.CheckTessellationInput`.
Expand Down Expand Up @@ -152,6 +152,17 @@ def enclosed_tessellation(
The number of jobs to run in parallel. -1 means using all available cores.
By default -1
Warnings
--------
Due to the floating point precision issues in clipping the tessellation cells to the
extent of their parental enclosures, the result does not form a precise polygonal
coverage. To build a contiguity graph, use fuzzy contiguity builder with a small
buffer, e.g.::
from libpysal imoprt graph
graph.Graph.build_fuzzy_contiguity(tessellation, buffer=1e-8)
Returns
-------
GeoDataFrame
Expand Down

0 comments on commit ea42951

Please sign in to comment.