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

correct comments for "compress edge if it crosses a traffic signal" #199

Merged
merged 2 commits into from
Mar 16, 2020

Conversation

wangyoucao577
Copy link

Issue

What issue is this PR targeting? If there is no issue that addresses the problem, please open a corresponding issue and link it here.
Closes #198

Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.

Tasklist

Requirements / Relations

Link any requirements here. Other pull requests this PR is based on?
This PR is cherry-pick from Project-OSRM#5384 which don't know when can be merged.

@wangyoucao577 wangyoucao577 self-assigned this Mar 6, 2020
@wangyoucao577 wangyoucao577 added this to the Sprint 60(Dev:03/17) milestone Mar 6, 2020
// traffic signals in the `traffic signal` list, which EdgeData
// doesn't have access to.
*/
// add node penalty when compress edge if it crosses a traffic signal.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

// Add node penalty when compress edge crosses a traffic signal

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@wangyoucao577
Copy link
Author

Some proof of this PR:

I try to add a debug log at here like this:

                if (has_node_penalty)
                {
                    util::Log(logDEBUG) << "node: " << node_v << " has traffic_signal when compress.";

                    // we cannot handle this as node penalty, if it depends on turn direction
                    if (fwd_edge_data1.flags.restricted != fwd_edge_data2.flags.restricted)
                        continue;

Then I got some logs when I compile the latest nevada.osm.pbf:

[debug] node: 16454 has traffic_signal when compress.
[debug] node: 48093 has traffic_signal when compress.
[debug] node: 71512 has traffic_signal when compress.
[debug] node: 82989 has traffic_signal when compress.
[debug] node: 115384 has traffic_signal when compress.
...

I check several of them in compiled .osrm.cnbg, none of them is exist, which means all of them have been compressed.

$ osrm-files-extractor -alsologtostderr -f nevada-latest.osrm.cnbg -summary 2
I0311 12:30:04.623195   27125 contents.go:41] Loaded from nevada-latest.osrm.cnbg
I0311 12:30:04.624706   27125 contents.go:42]   OSRN v5.22.0
I0311 12:30:04.624754   27125 contents.go:44]   compressed node based graph meta 746678 count 746678
I0311 12:30:04.624779   27125 contents.go:46]     CompressedNodeBasedGraphEdges[0] {Source:15 Target:724080}
I0311 12:30:04.624831   27125 contents.go:46]     CompressedNodeBasedGraphEdges[1] {Source:15 Target:589125}
$ 
$ osrm-files-extractor -alsologtostderr -f nevada-latest.osrm.cnbg -summary 746678 2>&1 | grep ":16454"

@CodeBear801 CodeBear801 self-requested a review March 11, 2020 16:17
@wangyoucao577 wangyoucao577 merged commit 68faf19 into master Mar 16, 2020
@wangyoucao577 wangyoucao577 deleted the feature/correct-comment branch March 16, 2020 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Correct comment: compress edge if it crosses a traffic signal
2 participants