momepy.
Tessellation
Generates tessellation.
Three versions of tessellation can be created:
Morphological tessellation around given buildings gdf within set limit.
gdf
limit
Proximity bands around given street network gdf within set limit.
Enclosed tessellation based on given buildings gdf within enclosures.
enclosures
Pass either limit to create morphological tessellation or proximity bands or enclosures to create enclosed tessellation.
See [FFRP20] for details of implementation of morphological tessellation and [AF19] for proximity bands.
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 MultiPolygon - at some cases, features with narrow links between parts split into two during ‘shrinking’. In most cases that is not an issue and resulting tessellation is correct anyway, but sometimes this result in a cell being MultiPolygon, which is not correct.
3. Overlapping features - features which overlap even after ‘shrinking’ cause invalid tessellation geometry.
All three types can be tested prior momepy.Tessellation using momepy.CheckTessellationInput.
momepy.Tessellation
momepy.CheckTessellationInput
GeoDataFrame containing building footprints or street network
name of the column with unique id
MultiPolygon or Polygon defining the study area limiting morphological tessellation or proximity bands (otherwise it could go to infinity).
distance for negative buffer to generate space between adjacent polygons (if geometry type of gdf is (Multi)Polygon).
maximum distance between points after discretization
if True, shows progress bars in loops and indication of steps
Enclosures geometry. Can be generated using momepy.enclosures().
momepy.enclosures()
name of the enclosure_id containing unique identifer for each row in enclosures. Applies only if enclosures are passed.
The minimum threshold for a building to be considered within an enclosure. Threshold is a ratio of building area which needs to be within an enclosure to inlude it in the tessellation of that enclosure. Resolves sliver geometry issues. Applies only if enclosures are passed.
Use parallelised algorithm based on dask.dataframe. Requires dask. Applies only if enclosures are passed.
dask.dataframe
Number of chunks to be used in parallelization. Ideal is one chunk per thread. Applies only if enclosures are passed. Defualt automatically uses n == dask.system.cpu_count.
Examples
>>> tess = mm.Tessellation( ... buildings_df, 'uID', limit=mm.buffered_limit(buildings_df) ... ) Inward offset... Generating input point array... Generating Voronoi diagram... Generating GeoDataFrame... Dissolving Voronoi polygons... >>> tess.tessellation.head() uID geometry 0 1 POLYGON ((1603586.677274485 6464344.667944215,... 1 2 POLYGON ((1603048.399497852 6464176.180701573,... 2 3 POLYGON ((1603071.342637536 6464158.863329805,... 3 4 POLYGON ((1603055.834005827 6464093.614718676,... 4 5 POLYGON ((1603106.417554705 6464130.215958447,...
>>> enclosures = mm.enclosures(streets, admin_boundary, [railway, rivers]) >>> encl_tess = mm.Tessellation( ... buildings_df, 'uID', enclosures=enclosures ... ) >>> encl_tess.tessellation.head() uID geometry eID 0 109.0 POLYGON ((1603369.789 6464340.661, 1603368.754... 0 1 110.0 POLYGON ((1603368.754 6464340.097, 1603369.789... 0 2 111.0 POLYGON ((1603458.666 6464332.614, 1603458.332... 0 3 112.0 POLYGON ((1603462.235 6464285.609, 1603454.795... 0 4 113.0 POLYGON ((1603524.561 6464388.609, 1603532.241... 0
GeoDataFrame containing resulting tessellation
geometry,
geometry
unique_id matching with parental building,
unique_id
enclosure_id matching with enclosure integer index
enclosure_id
original GeoDataFrame
Series containing used unique ID
used shrink value
used segment value
list of unique_id’s of collapsed features (if there are some) Applies only if limit is passed.
list of unique_id’s of features causing MultiPolygons (if there are some) Applies only if limit is passed.
__init__
Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(gdf, unique_id[, limit, shrink, …])
Initialize self.