Skip to content
Merged
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
8 changes: 3 additions & 5 deletions linkbikenet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
-------
Expand All @@ -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
Expand Down
Loading