blocksnet.method.vacant_area

Identify vacant areas within specified blocks.

Classes

VacantArea(*, city_model[, verbose, ...])

A class for identifying and calculating vacant areas within specified city blocks.

class blocksnet.method.vacant_area.VacantArea(*, city_model: City, verbose: bool = True, area_to_length_min: float = 4, area_min: float = 100, area_to_mrr_area_min: float = 0.5, path_buffer: float = 1, roads_buffer: float = 10, buildings_buffer: float = 10, blocks_buffer_min: float = 20, blocks_buffer_max: float = 40)[source]

Bases: BaseMethod

A class for identifying and calculating vacant areas within specified city blocks.

This class extends BaseMethod and includes methods to identify and calculate vacant areas in city blocks by considering various geographical features such as buildings, roads, natural areas, and amenities. The vacant areas are filtered based on their size, shape, and proximity to existing features.

Variables:
  • area_to_length_min (float) – Minimum ratio of area to length for considering an area as vacant.

  • area_min (float) – Minimum area size for considering an area as vacant.

  • area_to_mrr_area_min (float) – Minimum ratio of area to minimum rotated rectangle (MRR) area for considering an area as vacant.

  • path_buffer (float) – Buffer distance around path and footway geometries.

  • roads_buffer (float) – Buffer distance around road geometries.

  • buildings_buffer (float) – Buffer distance around building geometries.

  • blocks_buffer_min (float) – Minimum buffer distance around blocks.

  • blocks_buffer_max (float) – Maximum buffer distance around blocks.

area_to_length_min: float
area_min: float
area_to_mrr_area_min: float
path_buffer: float
roads_buffer: float
buildings_buffer: float
blocks_buffer_min: float
blocks_buffer_max: float
_dwn_other(geometry) GeoDataFrame[source]

Download non-standard areas within a block.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of non-standard areas.

Return type:

gpd.GeoDataFrame

_dwn_leisure(geometry) GeoSeries[source]

Download leisure areas within a block.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoSeries with the geometries of leisure areas.

Return type:

gpd.GeoSeries

_dwn_landuse(geometry) GeoDataFrame[source]

Download land use areas within a block, excluding residential areas.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of non-residential land use areas.

Return type:

gpd.GeoDataFrame

_dwn_amenity(geometry) GeoDataFrame[source]

Download amenity areas within a block.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of amenity areas.

Return type:

gpd.GeoDataFrame

_dwn_buildings(geometry) GeoDataFrame[source]

Download building areas within a block and apply a buffer.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with buffered building geometries.

Return type:

gpd.GeoDataFrame

_dwn_natural(geometry) GeoDataFrame[source]

Download natural feature areas within a block, excluding bays.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of natural feature areas.

Return type:

gpd.GeoDataFrame

_dwn_waterway(geometry) GeoDataFrame[source]

Download waterway areas within a block.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of waterway areas.

Return type:

gpd.GeoDataFrame

_dwn_highway(block) GeoDataFrame[source]

Download highway areas within a block, applying a buffer and excluding certain types of highways.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with buffered highway geometries.

Return type:

gpd.GeoDataFrame

_dwn_path(geometry) GeoDataFrame[source]

Download path and footway areas within a block and apply a buffer.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with buffered path and footway geometries.

Return type:

gpd.GeoDataFrame

_dwn_railway(geometry) GeoDataFrame[source]

Download railway areas within a block, excluding subways.

Parameters:

geometry (gpd.GeoSeries) – The polygon geometry of the block.

Returns:

A GeoDataFrame with the geometries of railway areas.

Return type:

gpd.GeoDataFrame

calculate(blocks: list[int] | list[blocksnet.models.city.Block] = []) GeoDataFrame[source]

Calculate vacant areas within specified blocks.

Parameters:

blocks (list[int] | list[Block]) – List of block identifiers or Block objects representing the areas to analyze. If not provided, the calculation will be done for the whole city.

Returns:

A GeoDataFrame containing the vacant areas within the specified blocks, including their area and length.

Return type:

gpd.GeoDataFrame

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.