segregation.network.calc_access

segregation.network.calc_access(geodataframe, network, distance=2000, decay='linear', variables=None, precompute=True)[source]

Calculate access to population groups.

Parameters
geodataframegeopandas.GeoDataFrame

geodataframe with demographic data

networkpandana.Network

pandana.Network instance. This is likely created with get_osm_network or via helper functions from OSMnet or UrbanAccess.

distanceint

maximum distance to consider accessible (the default is 2000).

decaystr

decay type pandana should use “linear”, “exp”, or “flat” (which means no decay). The default is “linear”.

variableslist

list of variable names present on gdf that should be calculated

precompute: bool (default True)

whether pandana should precompute the distance matrix. It can only be precomputed once, so If you plan to pass the same network to this function several times, you should set precompute=False for later runs

Returns
pandas.DataFrame

DataFrame with two columns, total_population and group_population which represent the total number of each group that can be reached within the supplied distance parameter. The DataFrame is indexed on node_ids