momepy.Blocks

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

Generate blocks based on buildings, tesselation and street network

Captures bID to buildings and tesselation as attributes.

Parameters
tessellationGeoDataFrame

GeoDataFrame containing morphological tessellation

edgesGeoDataFrame

GeoDataFrame containing street network

buildingsGeoDataFrame

GeoDataFrame containing buildings

id_namestr

name of the unique blocks id column to be generated

unique_idstr

name of the column with unique id. If there is none, it could be generated by unique_id(). This should be the same for cells and buildings, id’s should match.

Examples

>>> blocks_generate = mm.Blocks(tessellation_df, streets_df, buildings_df, 'bID', 'uID')
Buffering streets...
Generating spatial index...
Difference...
Defining adjacency...
Defining street-based blocks...
Defining block ID...
Generating centroids...
Spatial join...
Attribute join (tesselation)...
Generating blocks...
Multipart to singlepart...
Attribute join (buildings)...
Attribute join (tesselation)...
>>> blocks_generate.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

GeoDataFrame containing generated blocks

buildings_idSeries

Series derived from buildings with block ID

tessellation_idSeries

Series derived from morphological tessellation with block ID

tessellationGeoDataFrame

GeoDataFrame containing original tessellation

edgesGeoDataFrame

GeoDataFrame containing original edges

buildingsGeoDataFrame

GeoDataFrame containing original buildings

id_namestr

name of the unique blocks id column

unique_idstr

name of the column with unique id

__init__(self, tessellation, edges, buildings, id_name, unique_id)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, tessellation, edges, …)

Initialize self.