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 , 3 years ago
Milestone: | → 22.07 |
---|---|
Summary: | psv=yes on barrier=lift_gate suspicious? → [PATCH][RFC] psv=yes on barrier=lift_gate suspicious? |
comment:3 by , 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 , 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 , 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)
Type | Time | CPU samples | Memory |
---|---|---|---|
Original | 3:07 | 74,538 | 35,386,991,672 |
Regex | 4:40 | 114,056 | 34,628,652,016 |
[!=] | 5:37 | 118,006 | 34,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
)
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 ofbarrier
types that are ok forpsv=*
, 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
resources/data/validator/combinations.mapcss
!=bollard][amenity !~ /^parking.*/],