From ebd2e6574c801ff8b3759eb25e0291ffac55ab9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristram=20Gr=C3=A4bener?= Date: Wed, 12 Jun 2024 14:44:22 +0200 Subject: [PATCH] Do not merge ways when the requested tags differ --- Cargo.toml | 2 +- src/osm4routing/reader.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 712d613..2207651 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "osm4routing" edition = "2021" -version = "0.6.2" +version = "0.6.3" authors = ["Tristram Gräbener "] description = "Convert OpenStreetMap data into routing friendly CSV" homepage = "https://github.com/Tristramg/osm4routing2" diff --git a/src/osm4routing/reader.rs b/src/osm4routing/reader.rs index 0230458..5109026 100644 --- a/src/osm4routing/reader.rs +++ b/src/osm4routing/reader.rs @@ -140,10 +140,12 @@ impl Reader { for (node, edges) in neighbors.drain() { // We merge two edges at the node if there are only two edges // The edges must have the same accessibility properties + // If the consummer asked to store the tags, the tags must be the same for both edges // The edges must be from different ways (no surface) // The edges must not have been merged this iteration (they might be re-merged through a recurive call) if edges.len() == 2 && edges[0].properties == edges[1].properties + && edges[0].tags == edges[1].tags && edges[0].id != edges[1].id && !already_merged.contains(&edges[0].id) && !already_merged.contains(&edges[1].id)