From e84c4f62fc928664da937278e41a0cdd464a0d87 Mon Sep 17 00:00:00 2001 From: Manuel-Knepper Date: Fri, 22 May 2026 10:40:13 +0200 Subject: [PATCH] moved config/config_osm.yml and made changes ot functions.py --- {config => fixbikenet/config}/config_osm.yml | 0 fixbikenet/functions.py | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) rename {config => fixbikenet/config}/config_osm.yml (100%) diff --git a/config/config_osm.yml b/fixbikenet/config/config_osm.yml similarity index 100% rename from config/config_osm.yml rename to fixbikenet/config/config_osm.yml diff --git a/fixbikenet/functions.py b/fixbikenet/functions.py index 1345cf0..e229c83 100644 --- a/fixbikenet/functions.py +++ b/fixbikenet/functions.py @@ -20,14 +20,17 @@ def map_edges_to_bike_infrastructure(g): """ # first step: map all highway attributes protected_bike_infra = yaml.load( - open("./config/config_osm.yml"), + open("fixbikenet/config/config_osm.yml"), Loader=yaml.FullLoader)["protected_bike_infra"] # add binary edge attribute "pbi" (protected bike infra: True/False) for edge in g.edges(keys=True): - g.edges[edge]["pbi"] = protected_bike_infra[ - g.edges[edge]["highway"] - ] + try: + g.edges[edge]["pbi"] = protected_bike_infra[ + g.edges[edge]["highway"] + ] + except: + g.edges[edge]["pbi"] = 0 return g def bike_infra_mapping_gdf(g, edges_gdf):