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 clustering #59

Merged
merged 8 commits into from
Jan 14, 2015
Merged

Intersection clustering #59

merged 8 commits into from
Jan 14, 2015

Conversation

tedsteiner
Copy link
Owner

This code addition (no changes to existing functions were needed) allows clustering of intersection nodes into a single node. This is helpful in the case of boulevards and divided highways crossing one another and inducing 3+ intersections, rather than a single highway intersection. This allows you to get a better estimate of how many highway intersections are present in a region, because the divided highways will not inflate the count.

There is also a function included to replace all clustered intersections' node IDs in the highway list, so that the highways all pass through a single point. This might speed up routing a little bit in some cases, and also enables findIntersections() to be run again on the new set of highways to get the more accurate count.

I also added tests and documentation for the features.

Closes Issue #31.

…ntersections.

Highways with a common name but different IDs occur when a boulevard is represented as two separate ways.
Clustered intersections occur when boulevards intersect. This results in a single "intersection," as a human would consider it, being represented by several way crossings. This is helpful for routing purposes, but not for user interactions.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
I was getting errors on OS X.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
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>
…IntersectionConsolidation

Pulling in minor bug fix for plotMap.

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Now if a highway has been removed from highways but still exists in the roadways classifier, it will simply be skipped during highway segmentation.
Previously this resulted in a key not found error.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
Changed type HighwayCluster to HighwaySet.
Intersection clustering requires nodes to be in ENU coordinates.

Issue #31.

Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
…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>
Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+1.96%) when pulling 6447217 on IntersectionConsolidation into 37a4e40 on master.

@garborg
Copy link
Collaborator

garborg commented Jan 14, 2015

Very cool. It will be interesting to see how this plays with @yeesian's work on turn restrictions / relations -- exciting to see a lot in motion!

@tedsteiner
Copy link
Owner Author

Yeah, I'm not sure how it will go with turn restrictions. Probably we will need to make the function that replaces nodes in the highway list smarter, to make sure it preserves the turn restrictions, shifting them as necessary.

In general use, it's probably not necessary to have them both working together. If you want accurate routing, you'll probably use the full graph. This is more about counting the intersections. And it would also be useful for "human readable" driving directions, so we could give a list of intersections. Even in that case, though, all that would be needed is the mapping between true intersections and their associated clusters (the output of the clustering function).

@tedsteiner
Copy link
Owner Author

It looks like Travis failed only on the julianightlies branch, involving reading the xml files with libexpat:

signal (11): Segmentation fault
XML_SetUserData at /home/travis/.julia/v0.4/LibExpat/src/lX_common_h.jl:4

Has anyone tried running `Pkg.test("OpenStreetMap") with version 0.4 yet?

@garborg
Copy link
Collaborator

garborg commented Jan 14, 2015

Yep, I generally work on 0.4, and then test at the end that I'm also 0.3 compatible. Merging #55 passed Travis on 0.4, and I also tested it locally on 0.4. I've tagged a new version of LibExpat.jl since then, though -- it was tested alone and under OpenStreetMap.jl on 0.4 before tagging, but who knows. I can't look more now, but I will try to look later.

@garborg
Copy link
Collaborator

garborg commented Jan 14, 2015

I tested this branch on 0.4 locally, all passing. Opening another issue for the recent Travis-only 0.4 failures, to handle separately if it doesn't go away in a day or so.

@tedsteiner
Copy link
Owner Author

Ok, I'll go ahead and merge it then, despite Travis being cranky. It looks like the master branch is having the same issue right now, anyways.

tedsteiner added a commit that referenced this pull request Jan 14, 2015
@tedsteiner tedsteiner merged commit e2b2681 into master Jan 14, 2015
@tedsteiner tedsteiner deleted the IntersectionConsolidation branch January 14, 2015 21:29
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.

3 participants