Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions examples/exportalldata_onecity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

Parameters
----------
nominatimstring : str, optional, default Barcelona
The string to search for in nominatim/OSM.
city_name : str
Name of the city that the analysis should be performed on. This is the query string used to fetch the data from nominatim.
export_file_format : str, optional, default "geojson"
File format for the data export. 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.

Expand All @@ -26,14 +26,18 @@
import growbikenet as gbn
import sys

nominatimstring = "Barcelona"
city_name = "Barcelona"
export_file_format = "geojson"
city_boundary_file = None

if len(sys.argv) >= 2:
nominatimstring = sys.argv[1]
city_name = sys.argv[1]
if len(sys.argv) >= 3:
export_file_format = sys.argv[2]
if len(sys.argv) >= 4:
city_boundary_file = sys.argv[3]

print("Exporting " + export_file_format + " data for " + nominatimstring)
print("Exporting " + export_file_format + " data for " + city_name)

for seed_point_type in ["grid", "rail"]:
for ranking in ["betweenness_centrality", "closeness_centrality", "random"]:
Expand All @@ -42,12 +46,13 @@
else: ens_string = ""
print("\n" + "Exporting " + seed_point_type + ", " + ranking + ens_string)
gbn.growbikenet(
city_name=nominatimstring,
city_name=city_name,
ranking=ranking,
seed_point_type=seed_point_type,
export_data=True,
export_plots=False,
export_video=False,
export_file_format=export_file_format,
existing_network_spacing=ens,
city_boundary_file=city_boundary_file,
)
2 changes: 1 addition & 1 deletion growbikenet/growbikenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def growbikenet(
Parameters
----------
city_name : str
Name of the city that the analysis should be performed on. Overruled (for data fetching) if city_boundary_file is set.
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_crs : str, 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.
ranking : str, default 'betweenness_centrality'
Expand Down
Loading