diff --git a/linkbikenet/functions.py b/linkbikenet/functions.py index eb5fa8f..d584b22 100644 --- a/linkbikenet/functions.py +++ b/linkbikenet/functions.py @@ -8,7 +8,7 @@ from scipy.spatial import cKDTree from shapely.geometry import LineString -def import_network(street_network, import_path=settings.import_path): +def import_network(street_network): """Import and project a street network from gpkg file For all edges between a pair of nodes u and v there must be one edge with key 0. @@ -19,8 +19,6 @@ def import_network(street_network, import_path=settings.import_path): The street network will be loaded from this file. Must be a gpkg file in unprojected crs EPSG:4326 with layers nodes and edges, with the structure that a osmnx street network g has after saving its undirected version via ox.io.save_graph_geopackage(). For example: >>> g = ox.graph_from_place("Barcelona", network_type='all_public', simplify=False, retain_all=True) >>> ox.io.save_graph_geopackage(g, "Barcelona_streets.gpkg") - import_path : str, default settings.import_path - Path to import files. Returns ------- @@ -34,8 +32,8 @@ def import_network(street_network, import_path=settings.import_path): Convex hull of the street network """ - nodes = gpd.read_file(import_path+street_network, layer='nodes') - edges = gpd.read_file(import_path+street_network, layer='edges') + nodes = gpd.read_file(settings.import_path+street_network, layer='nodes') + edges = gpd.read_file(settings.import_path+street_network, layer='edges') # Set indices as required by osmnx.convert.graph_from_gdfs # See: https://osmnx.readthedocs.io/en/stable/user-reference.html#osmnx.utils_graph.graph_from_gdfs