Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve preprocessing of crossings #41

Merged
merged 3 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/ppr/preprocessing/osm_graph/osm_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ struct osm_node {
int_node_(nullptr) {}

bool can_be_compressed() const {
return access_allowed_ && in_edges_.size() == 1 && out_edges_.size() == 1 &&
!area_outer_ && !elevator_;
return access_allowed_ && crossing_ == crossing_type::NONE &&
in_edges_.size() == 1 && out_edges_.size() == 1 && !area_outer_ &&
!elevator_;
}

std::vector<osm_edge*> all_edges() {
Expand Down
9 changes: 6 additions & 3 deletions src/preprocessing/osm/crossing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ crossing_type::crossing_type get_crossing_type(osmium::TagList const& tags) {
return crossing_type::NONE;
} else {
// crossing=unmarked and unknown crossing types
return tags.has_tag("crossing:signals", "yes") ? crossing_type::SIGNALS
: crossing_type::UNMARKED;
if (tags.has_tag("crossing:signals", "yes")) {
return crossing_type::SIGNALS;
}
return tags.has_tag("crossing:island", "yes") ? crossing_type::ISLAND
: crossing_type::UNMARKED;
}
}

Expand All @@ -35,7 +38,7 @@ crossing_type::crossing_type get_crossing_type(osmium::TagList const& tags) {

crossing_type::crossing_type get_node_crossing_type(
osmium::TagList const& tags) {
if (tags.has_tag("highway", "crossing")) {
if (tags.has_tag("highway", "crossing") || tags.has_key("crossing")) {
return get_crossing_type(tags);
} else {
return crossing_type::NONE;
Expand Down