User reference

This is the user reference for the GrowBikeNet package. If you are looking for an introduction to GrowBikeNet, read the Getting started guide.

The standard way to import the GrowBikeNet package is via import growbikenet as gbn. The main growbikenet() function below is then called via gbn.growbikenet(), see the Minimum working example.

growbikenet.growbikenet.growbikenet(city_name, proj_crs='3857', ranking='betweenness_centrality', seed_point_type='grid', seed_point_grid_spacing=1707, seed_point_delta=500, existing_network_spacing=None, export_data=True, export_data_slug=None, export_file_format='geojson', export_plots=False, export_video=False, allow_edge_overlaps=False, city_boundary_file=None)[source]

Creates a list of edges ordered by a specified ranking method.

The edges form a subnetwork of a city’s street network, interpreted as a growing bicycle network following [1]. By default, growth is from scratch, but the existing bicycle network can also be used as a starting point[Raf425b00f903-2]_. Note that the original paper [1] uses minimum weight triangulation, but Delaunay triangulation is much faster due to the Delaunay scipy function and gives in most cases identical results. Triangulation and metrics (betweenness, closeness) are calculated for the abstract network for which egde lengths are taken from the routed network.

Parameters:
city_namestr

Name of the city that the analysis should be performed on. This is the query string used to fetch the data from nominatim. Overruled (for data fetching) if city_boundary_file is set.

proj_crsstr, default ‘3857’

Coordinate reference system that is used to project osm data. Default is ‘3857’ (WGS 84 / Pseudo-Mercator). If this web mercator projection is not needed, then for Europe ‘3035’ (LAEA) and globally ‘54035’ (Equal Earth) is better.

rankingstr, default ‘betweenness_centrality’

Method used to rank edges. Must be ‘betweenness_centrality’ (default), ‘closeness_centrality’, or ‘random’.

seed_point_typestr, optional, default ‘grid’

If set to ‘grid’, creates a square grid If set to ‘rail’, uses rail stations

seed_point_grid_spacingint, optional, default 1707

If seed_point_type is set to ‘grid’, this is the spacing between seed points, in meters

seed_point_deltaint, optional, default 500

Maximum distance between generated seed points and osm nodes for snapping

existing_network_spacingint, optional, default None

Spacing between seed points, in meters, only on the existing bicycle network. If not set to a positive integer, the existing network is ignored.

export_databool, optional, default True

If set to True, data will be saved to a file. The filename is [slug]-[ranking]-[seed_point_type].gpkg, where slug is a string id made out of city_name.

export_data_slugstr, optional, default None

If not set to None, the city_name will be slugified and used as the slug in the filename of the data export

export_file_formatstr, optional, default “geojson”

File format for the data export, relevant if export_data set to True. Default “geojson”, also possible “gpkg”. If exporting as geojson, generates extra files for seed points and city boundary. If exporting as gkpg, these are added all in one file as extra layers.

export_plotsbool, optional, default False

If set to True, plots will be saved to files. Will overwrite previous files.

export_videobool, optional, default False

If set to True, video will be saved to a file (only possible if export_plots is set to True). Will overwrite previous files.

allow_edge_overlapsbool, default False

If set to False, removes edge overlaps in consecutive growth stages. In this case, growth stages that do not add anything new are deleted.

city_boundary_file(str | None), default None

If not set to None, the study area will be selected from the (Multi)Polygon provided in the city_boundary_file shape file, ideally in unprojected latitude-longitude degrees (EPSG:4326), but EPSG:3857 also works. For example, “./tests/test_data/copenhagen.shp”.

Returns:
a_edgesgeopandas.geodataframe.GeoDataFrame

ordered geodataframe of all edges in street network

References

[1] (1,2)
  1. Szell, S. Mimar, T. Perlman, G. Ghoshal, R. Sinatra, “Growing urban bicycle networks”, Scientific Reports 12, 6765 (2022)

[2]
  1. Folco, L. Gauvin, M. Tizzoni, M. Szell, “Data-driven micromobility network planning for demand and safety”, Environment and planning B: Urban analytics and city science 50(8), 2087-2102 (2023)