From 98bbf8c210460ef6c5fbadf0c7e23cee482d7316 Mon Sep 17 00:00:00 2001 From: Florian Amsallem Date: Fri, 9 Feb 2024 12:19:14 +0100 Subject: [PATCH] editoast: fix osm import handle invalid speed values --- editoast/src/converters/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editoast/src/converters/utils.rs b/editoast/src/converters/utils.rs index 47540ca6595..fd4aaccba2c 100644 --- a/editoast/src/converters/utils.rs +++ b/editoast/src/converters/utils.rs @@ -296,7 +296,7 @@ pub fn speed_sections(edge: &Edge) -> Vec { fn speed_section(edge: &Edge, limit: &String, dir: ApplicableDirections) -> SpeedSection { // We convert from km/h to m/s let speed_limit = f64::from_str(limit).map(|speed| Speed(speed / 3.6)).ok(); - if speed_limit.is_none() { + if speed_limit.is_none() || speed_limit.unwrap().0 <= 0. { warn!("Invalid speed limit '{limit}' for way {}", edge.osm_id.0); }