momepy.Blocks#

class momepy.Blocks(tessellation, edges, buildings, id_name, unique_id, **kwargs)[source]#

Generate blocks based on buildings, tessellation, and street network. Dissolves tessellation cells based on street-network based polygons. Links resulting ID to buildings and tessellation as attributes.

Parameters
tessellationGeoDataFrame

A GeoDataFrame containing morphological tessellation.

edgesGeoDataFrame

A GeoDataFrame containing a street network.

buildingsGeoDataFrame

A GeoDataFrame containing buildings.

id_namestr

The name of the unique blocks ID column to be generated.

unique_idstr

The name of the column with the unique ID. If there is none, it can be generated with momepy.unique_id(). This should be the same for cells and buildings; ID’s should match.

Examples

>>> blocks = mm.Blocks(tessellation_df, streets_df, buildings_df, 'bID', 'uID')
>>> blocks.blocks.head()
    bID     geometry
0   1.0     POLYGON ((1603560.078648818 6464202.366899694,...
1   2.0     POLYGON ((1603457.225976106 6464299.454696888,...
2   3.0     POLYGON ((1603056.595487018 6464093.903488506,...
3   4.0     POLYGON ((1603260.943782872 6464141.327631323,...
4   5.0     POLYGON ((1603183.399594798 6463966.109982309,...
Attributes
blocksGeoDataFrame

A GeoDataFrame containing generated blocks.

buildings_idSeries

A Series derived from buildings with block ID.

tessellation_idSeries

A Series derived from morphological tessellation with block ID.

tessellationGeoDataFrame

A GeoDataFrame containing original tessellation.

edgesGeoDataFrame

A GeoDataFrame containing original edges.

buildingsGeoDataFrame

A GeoDataFrame containing original buildings.

id_namestr

The name of the unique blocks ID column.

unique_idstr

The name of the column with unique ID.

__init__(tessellation, edges, buildings, id_name, unique_id, **kwargs)[source]#

Methods

__init__(tessellation, edges, buildings, ...)