User reference¶
This is the user reference for the FixBikeNet package. If you are looking for an introduction to FixBikeNet, read the Getting started guide.
The standard way to import the FixBikeNet package is via import fixbikenet as fbn. The main fixbikenet() function below is then called via fbn.fixbikenet(), see the Minimum working example.
fixbikenet.fixbikenet¶
- fixbikenet.fixbikenet.fixbikenet(city_query, radius=2500, mingap=20, maxgap=800, numgaps=50, export_data=True, city_id=None, export_plot=False, import_files={})[source]
Finds gaps in bicycle networks and returns the numgaps that are the most important to fill.
- Parameters:
- city_querystr
name of the city that the analysis should be performed on
- radiusint, default 2500
cut-off length for computation of local betweenness centrality, in meters
- mingapint, default 20
minimum distance between node pairs to be considered as a potential gap, in meters
- maxgapint, default 800
maximum distance between node pairs to be considered as a potential gap, in meters
- numgapsint, default 50
Number of gaps to find.
- export_databool, optional, default True
If set to True, data will be saved to a file. The filename is [slug].gpkg, where slug is a string id made out of city_name
- city_idstr | None, default None
If set, the slugified city_id is used in the filename of the data export. For example, a city_id “Athens” will slugify into “athens” in filenames. If set to None, the slugified city_query is used in the filename of the data export. It is useful to set a city_id for cities where the city_query is not the city name, for example to set for a city_query “Municipality of Athens” the city_id to “Athens”.
- export_plotbool, optional, default False
If set to True, plot will be saved to a file
- import_files: dict, default {}
The following key:value entries can be set:
- ‘city_boundary’None or str, default None
If not set to None, the study area is selected from the (Multi)Polygon provided in the city_boundary shape or gpkg file, ideally in unprojected latitude-longitude degrees (EPSG:4326), but EPSG:3857 also works.
- ‘street_network’str | None, default None
If not set to None, the street network is loaded from this file. Must be a gpkg file in unprojected crs EPSG:4326 with layers nodes and edges, with the structure that an undirected osmnx street network g has after saved via ox.io.save_graph_geopackage(). For example: >>> ox.settings.useful_tags_way = [“highway”, “cycleway”, “cycleway:right”, “cycleway:left”, “cycleway:both”, “cyclestreet”] >>> g = ox.graph_from_place(“Barcelona”, network_type=’all’, simplify=False) >>> g = nx.MultiGraph(ox.convert.to_digraph(g)) >>> ox.io.save_graph_geopackage(g, “Barcelona_streets.gpkg”).
- Returns:
- gaps_orderedgeopandas.geodataframe.GeoDataFrame
ordered geodataframe with the numgaps most important gaps to fill
References
[1] Vybornova, A., Cunha, T., Gühnemann, A. and Szell, M. (2023), Automated Detection of Missing Links in Bicycle Networks. Geogr Anal, 55: 239-267. https://doi.org/10.1111/gean.12324
fixbikenet.settings¶
Global settings for fixbikenet that can be configured by the user.
- export_file_format{‘gpkg’, ‘geojson’}, default ‘gpkg’
File format for the data export, relevant if export_data is set to True. If exporting as geojson, generates extra files for seed points, city boundary, and existing bicycle network (if relevant). If exporting as gkpg, these are added all in one file as extra layers.
- export_pathdict(str)
Paths to results folder to save data.
- import_pathstr
Path to import files (as defined in fixbikenet’s import_files parameter).
- random_seedint, default 43
Random number generator seed for reproducibility
- silentbool, default False
If set to True, suppresses all user feedback. Useful for batch exports.