blocksnet.method.population_centrality

Classes

PopulationCentrality(*, city_model[, verbose])

Provides methods to calculate and visualize the population centrality of urban blocks.

class blocksnet.method.population_centrality.PopulationCentrality(*, city_model: City, verbose: bool = True)[source]

Bases: BaseMethod

Provides methods to calculate and visualize the population centrality of urban blocks. Population centrality is determined based on connectivity and population density within a specified radius.

plot(gdf, linewidth=0.1, figsize=(10, 10))[source]

Plots population centrality data on a map.

calculate(connectivity_radius=1000) gpd.GeoDataFrame[source]

Calculates population centrality for urban blocks based on connectivity and population density.

static plot(gdf: GeoDataFrame, linewidth=0.1, figsize: tuple[int, int] = (10, 10))[source]

Plots population centrality data for blocks on a map.

Parameters:
  • gdf (geopandas.GeoDataFrame) – GeoDataFrame containing block geometries and population centrality data.

  • linewidth (float, optional) – Line width for plotting the geometries, by default 0.1.

  • figsize (tuple of int, optional) – Size of the figure to plot, by default (10, 10).

Return type:

None

calculate(connectivity_radius: float = 1000) GeoDataFrame[source]

Calculate population centrality for urban blocks based on connectivity and population density.

Parameters:

connectivity_radius (float, optional) – The radius within which to consider connectivity between blocks, by default 1000 meters.

Returns:

  • geopandas.GeoDataFrame – GeoDataFrame of urban blocks with an added column for population centrality.

  • This method calculates the connectivity of urban blocks within the specified radius,

  • computes the degree centrality of each block, normalizes the values, and combines them with

  • normalized population density to determine the final population centrality.

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

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