Skip to content

Commit

Permalink
Merge pull request #42 from rust-transit/no_merge_different_tag
Browse files Browse the repository at this point in the history
No merge different tag
  • Loading branch information
Tristramg authored Jun 12, 2024
2 parents 78a8d75 + ebd2e65 commit 27a245a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "osm4routing"
edition = "2021"
version = "0.6.2"
version = "0.6.3"
authors = ["Tristram Gräbener <[email protected]>"]
description = "Convert OpenStreetMap data into routing friendly CSV"
homepage = "https://github.com/Tristramg/osm4routing2"
Expand Down
4 changes: 3 additions & 1 deletion src/osm4routing/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Reader {
let node = self
.nodes
.get_mut(node_id)
.expect("Missing node, id: {node_id}");
.unwrap_or_else(|| panic!("Missing node, id: {}", node_id.0));
// Count double extremities nodes to be sure to include dead-ends
if i == 0 || i == way.nodes.len() - 1 {
node.uses += 2;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 27a245a

Please sign in to comment.