diff --git a/examples/exportalldata_onecity.py b/examples/exportalldata_onecity.py index fdfc3d0..1942c4b 100755 --- a/examples/exportalldata_onecity.py +++ b/examples/exportalldata_onecity.py @@ -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. @@ -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"]: @@ -42,7 +46,7 @@ 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, @@ -50,4 +54,5 @@ export_video=False, export_file_format=export_file_format, existing_network_spacing=ens, + city_boundary_file=city_boundary_file, ) diff --git a/growbikenet/growbikenet.py b/growbikenet/growbikenet.py index 3977864..64995ca 100644 --- a/growbikenet/growbikenet.py +++ b/growbikenet/growbikenet.py @@ -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'