Modify ↓
Opened 5 years ago
#18383 new enhancement
[WIP PATCH RFC] Add class and methods to expand `access` tags
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | access | Cc: |
Description
This patch doesn't expand conditional
tags. It replaces values in ConditionalKeys.java
(specifically the RESTRICTION_VALUES
and TRANSPORT_MODES
).
This is so that other classes can expand access values (so hgv=yes
expands to hgv=yes + hgv_articulated=yes
).
Future use cases:
- mapcss:
way[highway][motorway][!foot][access("foot") == "yes"] { throwOther: "Probable bad access tag"; }
- Routing tests
public boolean usable(Way way, String transportMode) { List<String> possibleModes = Access.getTransportModes().stream().filter(way::hasKey).collect(Collectors.toList()); Map<String, String> accessMap = new HashMap<>(); possibleModes.forEach(mode -> Access.mergeMaps(accessMap, Access.expandAccessMode(mode, way.get(mode)))); return Access.getPositiveAccessValues().contains(accessMap.getOrDefault(transportMode, "no"));
Attachments (1)
Note:
See TracTickets
for help on using tickets.
Create class for access tags