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)

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

Download all attachments as: .zip

Change History (1)

by taylor.smock, 5 years ago

Attachment: 18383.patch added

Create class for access tags

Modify Ticket

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

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.