Modify

Opened 3 years ago

Closed 3 years ago

#22166 closed defect (fixed)

[PATCH][RFC] psv=yes on barrier=lift_gate suspicious?

Reported by: Gazer75 Owned by: team
Priority: normal Milestone: 22.07
Component: Core validator Version: tested
Keywords: Cc:

Description

This should be perfectly valid for automated lift gates that let these vehicles through. Typically bus, garbage truck and emergency services.

Attachments (0)

Change History (6)

comment:1 by taylor.smock, 3 years ago

Milestone: 22.07
Summary: psv=yes on barrier=lift_gate suspicious?[PATCH][RFC] psv=yes on barrier=lift_gate suspicious?

This is probably from source:trunk/resources/data/validator/combinations.mapcss#L483 (see r14975/#17572 for initial barrier exclusion). Which was originally added in r6548 (migrations), but r4777/#5017 appears to be the originating commit for this check ("Testing for typical tag combinations (derived from Taginfo)").

Anyway, looking at https://wiki.openstreetmap.org/w/index.php?title=Tag:barrier%3Dlift_gate&oldid=418304, access=* has been valid for some time for lift gates. I'd prefer to have a list of barrier types that are ok for psv=*, but that is a good chunk of them.

  • bollard
  • lift_gate
  • sliding_beam
  • height_restrictor(are there instances where psv is ok but non-psv is not?)
  • sliding_gate
  • gate
  • entrance
  • coupure(maybe there are some for psv only?)
  • cattle_grid
  • bus_trap
  • bump_gate
  • sally_port
  • spikes
  • swing_gate
  • toll_booth
  • yes
  • chain
  • rope
  • jersey_barrier(are there motorized variants?)
  • kerb
  • Anything else that I missed.
  • resources/data/validator/combinations.mapcss

    diff --git a/resources/data/validator/combinations.mapcss b/resources/data/validator/combinations.mapcss
    index a94e8f81a6..e694cfc196 100644
    a b node[lanes ][!barrier][!ford][highway!=mini_roundabout][!junction][leisure!~/^(b  
    480480way[lanes  ][!barrier][!ford][!highway ][!area:highway][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
    481481*[tunnel   ][!highway][!area:highway][!railway][!waterway][!piste:type][type!=tunnel][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=tunnel][power!=cable],
    482482*[bridge   ][!highway][!area:highway][!railway][!waterway][!piste:type][type!=bridge][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge],
    483 *[psv      ][!highway][!area:highway][!railway][!waterway][barrier!=bollard][amenity !~ /^parking.*/],
     483*[psv      ][!highway][!area:highway][!railway][!waterway][barrier !~ /^(bollard|bump_gate|bus_trap|cattle_grid|chain|coupure|entrance|gate|height_restrictor|jersey_barrier|kerb|lift_gate|rope|sally_port|sliding_beam|sliding_gate|spikes|swing_gate|toll_booth|yes)$/][amenity !~ /^parking.*/],
    484484*[width    ][!highway][!area:highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track],
    485485*[maxspeed ][!highway][!area:highway][!railway][traffic_sign !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][traffic_sign:forward !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][traffic_sign:backward !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type != enforcement][waterway !~ /^(canal|fairway|lock|river|tidal_channel)$/][!traffic_calming][aerialway!=zip_line],
    486486way[incline][!highway][!area:highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan][leisure!=slipway] {
Last edited 3 years ago by taylor.smock (previous) (diff)

comment:2 by Klumbumbus, 3 years ago

So should we apply the patch as is?

comment:3 by taylor.smock, 3 years ago

We definitely could. I just tend to be a bit more cautious on tagging changes. In other words, I wanted to give people a chance to tell me I'm an idiot. :)

TBH, I'd prefer to add whitelisted values, but that is a lot of values to whitelist. [barrier!=bollard][barrier!=lift_gate][...]

comment:4 by Klumbumbus, 3 years ago

You could use the a regex to have a bit more human readable overview about the values list, but I don't know if this is better performance wise.
[barrier!~/^(bollard|lift_gate|...)$/]

comment:5 by taylor.smock, 3 years ago

On a file with 2,157,637 features, after adding psv=yes to everything,
CPU samples and Memory allocations were done using MapCSSTagChecker.check(OsmPrimitive)

TypeTimeCPU samplesMemory
Original3:0774,53835,386,991,672
Regex4:40114,05634,628,652,016
[!=]5:37118,00634,990,241,112

So the regex is (surprisingly) cheaper than the [barrier!=bollard][barrier!=lift_gate][...] alternative. But is still much worse when compared to the original version.
EDIT: Add original version for comparison (barrier!=bollard)

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:6 by taylor.smock, 3 years ago

Resolution: fixed
Status: newclosed

In 18522/josm:

Fix #22166: ignore more barrier types for psv suspicious tag combination

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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