momepy.buffered_limit#

momepy.buffered_limit(gdf, buffer=100, min_buffer=0, max_buffer=100, **kwargs)[source]#

Define limit for tessellation as a buffer around buildings.

The function calculates a buffer around buildings and returns a MultiPolygon or Polygon defining the study area. The buffer can be either a fixed number or “adaptive” which calculates the buffer based on Gabriel graph.

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

Parameters:
gdfGeoDataFrame | GeoSeries

A GeoDataFrame containing building footprints.

bufferfloat | str, optional

A buffer around buildings limiting the extend of tessellation. If “adaptive”, the buffer is calculated based on Gabriel graph as the half of the maximum distance between neighbors (represented as centroids) of each node + 10% of such the maximum distance. The lower and upper bounds can be furhter specified by min_buffer and max_buffer. By default 100.

min_bufferfloat, optional

The minimum adaptive buffer distance. By default 0.

max_bufferfloat, optional

The maximum adaptive buffer distance. By default 100.

**kwargs

Keyword arguments passed to geopandas.GeoSeries.buffer().

Returns:
MultiPolygon

A MultiPolygon or Polygon defining the study area.

Examples

>>> path = momepy.datasets.get_path("bubenec")
>>> buildings = geopandas.read_file(path, layer="buildings")
>>> buildings.head()
   uID                                           geometry
0    1  POLYGON ((1603599.221 6464369.816, 1603602.984...
1    2  POLYGON ((1603042.88 6464261.498, 1603038.961 ...
2    3  POLYGON ((1603044.65 6464178.035, 1603049.192 ...
3    4  POLYGON ((1603036.557 6464141.467, 1603036.969...
4    5  POLYGON ((1603082.387 6464142.022, 1603081.574...
>>> limit = momepy.buffered_limit(buildings)
>>> type(limit)
<class 'shapely.geometry.polygon.Polygon'>