blocksnet.preprocessing.blocks_generator
Module to generate blocks (land parcels) based on boundaries, roads, railways, and water objects.
Classes
|
Generates blocks (land parcels) based on boundaries, roads, railways, and water objects. |
|
|
|
|
|
|
|
|
|
- class blocksnet.preprocessing.blocks_generator.BoundariesSchema(*args, **kwargs)[source]
Bases:
BaseSchema
- class blocksnet.preprocessing.blocks_generator.RoadsSchema(*args, **kwargs)[source]
Bases:
BaseSchema
- class blocksnet.preprocessing.blocks_generator.RailwaysSchema(*args, **kwargs)[source]
Bases:
BaseSchema
- class blocksnet.preprocessing.blocks_generator.WaterSchema(*args, **kwargs)[source]
Bases:
BaseSchema
- class blocksnet.preprocessing.blocks_generator.BlocksSchema(*args, **kwargs)[source]
Bases:
BaseSchema
- class blocksnet.preprocessing.blocks_generator.BlocksGenerator(boundaries: GeoDataFrame, roads: GeoDataFrame | None = None, railways: GeoDataFrame | None = None, water: GeoDataFrame | None = None)[source]
Bases:
object
Generates blocks (land parcels) based on boundaries, roads, railways, and water objects.
- Parameters:
boundaries (gpd.GeoDataFrame) – Boundaries of a city or a territory. Must contain
geometry
column ofPolygon
orMultiPolygon
geometries.roads (gpd.GeoDataFrame | None, optional) – Roads geometries. Can be obtained via OSMnx and must contain
geometry
column ofLineString
geometries. By default None.railways (gpd.GeoDataFrame | None, optional) – Railways geometries. Can be obtained via OSM tags
railway==rail
and must containgeometry
column ofLineString
geometries. By default None.water (gpd.GeoDataFrame | None, optional) – Water objects geometries. Can be obtained via OSM tags like
riverbank==*
,pond==*
, etc. Must containgeometry
column ofLineString
,Polygon
orMultiPolygon
. By default None.
- run(min_block_width=None)[source]
Generates blocks based on the provided boundaries, roads, railways, and water objects.
- property local_crs: CRS
Local CRS, defined by boundaries geometry.
- Returns:
pyproj.CRS
object- Return type:
CRS
- run(min_block_width: float | None = None) GeoDataFrame [source]
Generates blocks based on the provided boundaries, roads, railways, and water bodies.
- Parameters:
min_block_width (float, optional) – Minimum width for the blocks. If specified, small blocks and bottlenecks will be filtered out. By default None.
- Returns:
GeoDataFrame containing the generated blocks with
geometry
column.- Return type:
gpd.GeoDataFrame
- static _get_enclosures(barriers: GeoDataFrame, limit: GeoDataFrame)[source]
Identifies enclosures formed by the barriers and within the limit.
- Parameters:
barriers (gpd.GeoDataFrame) – GeoDataFrame containing barrier geometries.
limit (gpd.GeoDataFrame) – GeoDataFrame containing the limit within which enclosures are to be found.
- Returns:
GeoDataFrame containing the identified enclosures.
- Return type:
gpd.GeoDataFrame