Accessibility Module

urbanpy.accessibility.hu_access_map(units, pois, population_column, weight=1, d0=1250)[source]

Create accessibility surface from Hu et al. 2019. The authors provide an accessibility to healthy foods indicator that contemplates both the catchment area of a store and the access from a city block/district/county (denoted as E2SFCA).

Parameters:
  • units (GeoDataFrame) – Input spatial units to calculate access.

  • pois (GeoDataFrame) – Input points of interest for access calculations

  • population_column (str) – Key for population values in each spatial unit

  • weight (int) – Weight for final indicator computation. Defaults to 1

  • d0 (int) – Buffer size. Defaults to 1250

Returns:

access_map – Input unit dataframe with accessibility values.

Return type:

GeoDataFrame

Examples

>>> surface = urbanpy.accessibility.hu_access_map(blocks, pois, 'pop_2020')
>>> surface.head()
geometry     | place_id      | osm_type     | osm_id     | display_name     | place_rank  |  category | type               | importance     | icon
MULTIPOLYGON | 235480647 | relation | 1944670.0  | Lima, Peru       | 12          |  boundary |     administrative | 0.703484       | https://nominatim.openstreetmap.org/images/map...

References

Hu, L., Zhao, C., Wang, M., Su, S., Weng, M., & Wang, W. (2020). Dynamic healthy food accessibility in a rapidly urbanizing metropolitan area: socioeconomic inequality and relative contribution of local factors. Cities, 105, 102819.

urbanpy.accessibility.pressure_map(blocks, pois, demand_column, operation='intersects', buffer_size=1250)[source]

Create the unaggregated pressure map from Ritsema van Eck & de Jong, 1999.

Parameters:
  • blocks (GeoDataFrame) – Input spatial units to calculate pressure. As per the paper these are city blocks.

  • pois (GeoDataFrame) – Input points of interest for pressure calculations

  • demand_column (str) – Key for demand values in each spatial unit.

  • operation (str) – Spatial operation to use. One of the operations supported by GeoPandas

  • buffer_size (int) – Buffer size. Defaults to 1250

Returns:

blocks – Input blocks dataframe with pressure values (ds). Unaggregated, if grouped into a higher resolution, sum ‘ds’.

Return type:

GeoDataFrame

Examples

>>> surface = urbanpy.accessibility.pressure_map(blocks, pois, 'pop_2020')
>>> surface.head()
POB16  | ds        |    geometry
    69         | 0.784091  |        POLYGON ((301151.794 8670216.675, 301167.165 8...
    84         | 0.617647  |        POLYGON ((282595.509 8677560.543, 282627.393 8...
    117        | 2.785714  |        POLYGON ((279276.449 8681335.243, 279323.599 8...
    41         | 20.500000 |    POLYGON ((313155.536 8677088.663, 313180.700 8...
    59         | 1.404762  |        POLYGON ((280125.735 8684068.209, 280098.318 8..

References

Van Eck, J. R., & de Jong, T. (1999). Accessibility analysis and spatial competition effects in the context of GIS-supported service location planning. Computers, environment and urban systems, 23(2), 75-89.

urbanpy.accessibility.travel_times(inputs, pois, col_label='poi', nearest_neighbor_dist='haversine')[source]

Calculate travel times (durations) and distances from each input geometry to the nearest poi with an active osrm server.

Parameters:
  • inputs (GeoDataFrame) – Input grid-spatial units to calculate pressure.

  • pois (GeoDataFrame) – Input points of interest for travel distance and durations calculations

Returns:

gdf – Input geodataframe with travel distances and durantions to nearest poi.

Return type:

GeoDataFrame