Enhanced street graph processing of OSM areas - #6463
Conversation
Points along a straight line are often considered convex
One fake visibility point leading to nowhere was removed by convexity optimization.
Code deals with regular graph vertices. Nothing ends in the mentioned points.
- Refactor related code - Do not split the edge to many segments. Instead, merge properties of crossed areas.
They are needed only during graph building
Graph will get corrupted
This reverts commit 4219a43.
Code added every visibility edge two times.
…dule/osm/ParkingProcessor.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
…TripPlanner into fix-merged-area-platforms
| implements OsmInfoGraphBuildRepository, Serializable { | ||
|
|
||
| private final Map<Edge, Platform> platforms = new HashMap<>(); | ||
| private final Map<Area, Platform> areaPlatforms = new HashMap<>(); |
There was a problem hiding this comment.
Area doesn't seem to have equals or hashcode. Are the maps using idenity in that case?
There was a problem hiding this comment.
I did not even realize this issue, just trusted Java magic. I have to check this.
There was a problem hiding this comment.
I guess java uses object address as hash or something like that. I do not see any problem in this.
| .map(VertexLabel::osm) | ||
| .collect(Collectors.toSet()) | ||
| ), | ||
| Arguments.of(true, Set.of(VertexLabel.osm(3223067049L), VertexLabel.osm(768590748))) |
There was a problem hiding this comment.
I believe this is intended, but can you explain what is going on?
There was a problem hiding this comment.
One of the optimizations was adding a threshold for convexity. 3 points along a straight line were randomly interpreted to define a convex or concave angle, because of inaccuracy of computations. Only true concave points matter in visibility computations. Herrenberg test platform lost one unnecessary fake visibility point which is good.
|
Generally this looks very good and I can confirm that it resolves an issue in one of my data sets. I understand that you radically simplified the WalkableAreaBuilder. I would love to understand what you did and what you removed. Are you available for a quick meeting about this? |
One of the platforms in now concave (L shape). Average of vertices is outside the area of the platform. Test that walkable area building generates a boarding location point which is inside the area.
|
Can you pull this commit so that we have a bit of documentation on equals/hashcode leonardehrenfried@f0a94d2 ? |
OTP 1.x relayed on /**
* Object identity is used for eq/hc. In this case this is safe since instances are
* created during graph build and is guaranteed to be unique.
*/
@Override
public final boolean equals(Object other) {
return super.equals(other);
}
/**
* See {@link #equals(Object)}
*/
@Override
public final int hashCode() {
return super.hashCode();
}Note! Both methods are |
…e/Area.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
…e/Area.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
Summary
Street graph generation code, which processes OSM areas, refactorized and optimized.
The images below show stop linking in Kerava railway station. After the changes, a railway stop gets linked to a platform. In the past, a stop link teleported travellers far away from the platforms.
Before:

After:

Issue
Closes #6103
Unit tests
Some existing tests updated to reflect new improvements.
Documentation
Lots of outdated code comments removed and updated.