From 3401acfa2c83ca16b428abc5a4076c0872ef3953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Thu, 21 Dec 2017 12:37:29 +0100 Subject: [PATCH] fix rise when nodes are outside bounds --- src/c3nav/routing/router.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/c3nav/routing/router.py b/src/c3nav/routing/router.py index 4e7123e7..28d9e811 100644 --- a/src/c3nav/routing/router.py +++ b/src/c3nav/routing/router.py @@ -591,7 +591,12 @@ class RouterEdge: self.to_node = to_node.i self.waytype = waytype self.access_restriction = access_restriction - self.rise = rise if rise is not None else (to_node.altitude - from_node.altitude) + if rise is not None: + self.rise = rise + elif to_node.altitude is None or from_node.altitude is None: + self.rise = None + else: + self.rise = (to_node.altitude - from_node.altitude) self.distance = distance if distance is not None else np.linalg.norm(to_node.xyz - from_node.xyz)