-
Notifications
You must be signed in to change notification settings - Fork 1k
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
OSM area processing obeys tag mapping #6164
OSM area processing obeys tag mapping #6164
Conversation
Walkable area builder used hardcoded bike+pedestrial default permissions for area edges. Now default permissions take tag mapping into account.
Rule whicgh assigns pedestrian permissions to transit platforms is not enough, because another rule which contains more tags overrules it.
OSM tag mappers now use normal OOP inheritance. It is usually a bad idea to implement classes directly from an inteface.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6164 +/- ##
=============================================
- Coverage 69.95% 69.75% -0.20%
+ Complexity 17756 17658 -98
=============================================
Files 1999 2006 +7
Lines 75500 75571 +71
Branches 7728 7734 +6
=============================================
- Hits 52813 52718 -95
- Misses 20013 20140 +127
- Partials 2674 2713 +39 ☔ View full report in Codecov by Sentry. |
About your second point, this kind of fuzzy matching has caused me problems before, so I added Lines 8 to 20 in f4bfedf
It think it could be helpful here. There was talk about making it the default but we were scared of the unintended consequences. |
I wonder if absence of a tag in BestMatchSpecifier should actually reduce match scores? Less than conflicting value but something at least. |
I find |
application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java
Outdated
Show resolved
Hide resolved
Instead of adding competing best match rules, start using the well designed exact match specifier. This may cause some unexpected changes but as the change concerns only one specific rule, we should be able to deal with them,
application/src/main/java/org/opentripplanner/osm/tagmapping/OsmTagMapper.java
Outdated
Show resolved
Hide resolved
And you need to resolve the conflicts. |
application/src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java
Outdated
Show resolved
Hide resolved
.getOsmProvider() | ||
.getWayPropertySet() | ||
.getDataForWay(areaEntity); | ||
wayData = areaEntity.getOsmProvider().getWayPropertySet().getDataForWay(areaEntity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way vs area thing here is slightly confusing, but I think it's a common problem that we use these way properties for areas as well so if we were to rename things, we would need to rename a lot of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit unfortunate that we now lose all history on this file but since we are combining two files, I think it's impossible to avoid some history being lost.
Summary
OSM parsing and graph building code always applied hard coded bicycle and pedestrian permissions to areas. Now the code uses the configured wayPropertySet and national tag mapping to define the permissions.
Secondly, detailed propertly rule for
highway=footway;bicycle=yes;area=yes
tag combination overruled simpler rules like plainhighway=footway
because the former rule often has more matching tags. This is a bit surprising because absence ofbicycle=yes
tag does not reduce scores. This problem is fixed by using ExactMatchSpecifier.Thirdly, OSM tag mapping is a typical example of a situation where OOP works very well. Class hierarchy is now refactored to use very simple inheritance with a base class and national sub classes.
Issue
Closes #5354
Unit tests
Area permission tests for Finland and Germany tag mappers added.
Documentation
Updated.