Opened 4 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:


This patch doesn't expand conditional tags. It replaces values in (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)

18383.patch (27.2 KB) - added by taylor.smock 4 years ago.
Create class for access tags

Download all attachments as: .zip

Change History (1)

Changed 4 years ago by taylor.smock

Attachment: 18383.patch added

Create class for access tags

Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to taylor.smock
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.