momepy.Blocks¶
-
class
momepy.
Blocks
(tessellation, edges, buildings, id_name, unique_id, **kwargs)[source]¶ Generate blocks based on buildings, tesselation and street network.
Dissolves tessellation cells based on street-network based polygons. Links resulting id to
buildings
andtesselation
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
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') 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.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__
(tessellation, edges, buildings, id_name, unique_id, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
(tessellation, edges, buildings, …)Initialize self.