momepy.morphological_tessellation#

momepy.morphological_tessellation(geometry, clip='bounding_box', shrink=0.4, segment=0.5)[source]#

Generate morphological tessellation.

Morpohological tessellation is a method to divide space into cells based on building footprints and Voronoi tessellation. The function wraps libpysal.cg.voronoi_frames() and provides customized default parameters following [Fleischmann et al., 2020].

Tessellation requires data of relatively high level of precision and there are three particular patterns causing issues:

  1. Features will collapse into empty polygon - these 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.

  3. Overlapping features - features which overlap even after ‘shrinking’ cause invalid tessellation geometry.

All three types can be tested using momepy.CheckTessellationInput.

See [Fleischmann et al., 2020] for details of implementation.

Parameters:
geometryGeoSeries | GeoDataFrame

A GeoDataFrame or GeoSeries containing buildings to tessellate the space around.

clipstr | shapely.Geometry | GeoSeries | GeoDataFrame | None

Polygon used to clip the Voronoi polygons, by default “bounding_box”. You can pass any option accepted by libpysal.cg.voronoi_frames() or geopandas object that will be automatically unioned.

shrinkfloat, optional

The distance for negative buffer to generate space between adjacent polygons). By default 0.4

segmentfloat, optional

The maximum distance between points after discretization. By default 0.5

Returns:
GeoDataFrame

GeoDataFrame with an index matching the index of input geometry

Examples

>>> path = momepy.datasets.get_path("bubenec")
>>> buildings = geopandas.read_file(path, layer="buildings")

Define a limit used to clip the extent:

>>> limit = momepy.buffered_limit(buildings, buffer="adaptive")

Generate tessellation:

>>> momepy.morphological_tessellation(buildings).head()
                                            geometry
0  POLYGON ((1603577.153 6464348.291, 1603576.946...
1  POLYGON ((1603166.356 6464326.62, 1603166.425 ...
2  POLYGON ((1603006.941 6464167.63, 1603009.97 6...
3  POLYGON ((1602995.269 6464132.007, 1603001.768...
4  POLYGON ((1603084.231 6464104.386, 1603083.773...