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

Intersection Consolidation #31

Closed
tedsteiner opened this issue Sep 24, 2014 · 6 comments
Closed

Intersection Consolidation #31

tedsteiner opened this issue Sep 24, 2014 · 6 comments

Comments

@tedsteiner
Copy link
Owner

I think it would significantly speed up routing if intersections within a certain radius in a map could be consolidated into a single node.

OpenStreetMap treats divided highways as separate one-way roads. This means that when divided highways cross one another, this results in 4 intersections rather than just 1. If we could represent this as a single intersection, Dijkstra's algorithm would route faster. Also, the intersections found in an environment would be more useful for higher-level tasks, such as displaying directions ("turn left, turn right").

The way to approach this is probably to add a new node in the center of an intersection to the global list of nodes, and replace all nodes within a certain distance of it that belong to highways with references to the new node, instead. These existing nodes shouldn't be deleted, in case we want to do a "refinement" step on the routing, and they should still be used for plotting.

@garborg
Copy link
Collaborator

garborg commented Sep 24, 2014

This sounds great -- it would be nice to do it after there are tests for respecting turn restrictions, but maybe it would be just as easy to add turn restriction adherance later (if it's not being handled -- haven't gotten that far in testing).

@tedsteiner
Copy link
Owner Author

I never thought of turn restrictions. That's a good idea. I found this page very helpful when I was doing the routing code, have you seeing it? http://wiki.openstreetmap.org/wiki/Routing#Highway-type

Right now I have the highway speeds set very arbitrarily (I just picked them), so if this is to be used for realistic routing we might need to look into finding more accurate speed data. Especially because I don't think the speeds translate well to other countries. I picked them to look reasonable for Boston, just as a start/default.

@garborg
Copy link
Collaborator

garborg commented Sep 24, 2014

Thanks for the link -- I hadn't seen at least that section of the page, but I've wondered about speed data.

@garborg
Copy link
Collaborator

garborg commented Oct 5, 2014

I'll try to look into in more, but I think highways speeds might not be realistic within the U.S., either -- no real evidence -- just doing a similar analysis to something I'd approximated with commercial maps before, and it looked like small roads were incurring significantly higher cost using the library.

Worth looking into what OSM routers do.

@tedsteiner
Copy link
Owner Author

Yeah, I just guessed these. And I think I might have intentionally differentiated the road styles when I was testing some routing stuff. So it wouldn't surprise me if they're not optimally set yet.

@yeesian
Copy link
Collaborator

yeesian commented Dec 22, 2014

Worth looking into what OSM routers do.

just for future reference: Project OSRM and Pandana

tedsteiner added a commit that referenced this issue Jan 13, 2015
Now when a highway is reduced to 0 length, it is deleted in the replaceHighwayNodes! function.
Now skip intersection consolidation when intersection has only one associated highway (ends of roads). This prevents the end of a boulevard (such as when cropped) from being joined together.
Removed unused clustered_highways variable.

Issue #31.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
tedsteiner added a commit that referenced this issue Jan 13, 2015
Changed type HighwayCluster to HighwaySet.
Intersection clustering requires nodes to be in ENU coordinates.

Issue #31.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
tedsteiner added a commit that referenced this issue Jan 14, 2015
…documentation.

The list of cluster IDs is no longer returned, since it can easily can be extracted from the intersection ID to cluster ID mapping dictionary.

Issue #31

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
@tedsteiner tedsteiner added this to the Release 0.8 milestone Jan 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants