Opened 4 years ago
Last modified 4 years ago
#21341 new enhancement
Access restriction node without object
| Reported by: | Famlam | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core validator | Version: | |
| Keywords: | access highway node | Cc: | skyper |
Description (last modified by )
Split off from #20742
Replying to skyper:
Just found this node even without a barrier tag.
As a suggestion, possibly:
way[highway][!/^(access|motor_vehicle|vehicle)(:backward|:forward|:both_ways)?(:conditional)?$/] > node[/^(access|motor_vehicle|vehicle)$/][!barrier][!railway][!traffic_sign][!entrance][/^(access|motor_vehicle|vehicle)$/=~/^(no|private)$/][!/^(access|motor_vehicle|vehicle):conditional/] { throwWarning: tr("{0} without {1} on a public highway", "{0.tag}", "{1.key}"); }
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-09-03 03:12:33 +0200 (Fri, 03 Sep 2021) Build-Date:2021-09-03 01:31:19 Revision:18193 Relative:URL: ^/trunk
Attachments (0)
Change History (6)
comment:1 by , 4 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 4 years ago
| Description: | modified (diff) |
|---|---|
| Keywords: | highway node added |
comment:3 by , 4 years ago
A quick test showed at least an overlap with "only one tag". Some of the more complex access tags should be added there.
I do not understand [!railway] and all the :conditional plus :both_ways on its own is not useful as it either could be simply dropped one of :forward or :backward should be present. Last but not least, I switched to warn for all access values but yes. So this is what I will test for now:
/* #21341 - access without primary tag */ way[highway][!/^(access|motor_vehicle|vehicle)(:backward|:forward)?$/] > node[/^(access|motor_vehicle|vehicle)$/][!barrier][!traffic_sign][!entrance][/^(access|motor_vehicle|vehicle)$/!~/yes/][number_of_tags() > 1] { throwWarning: tr("{0} without {1} on a public highway", "{0.tag}", "{1.key}"); group: tr("missing tag"); }
follow-up: 5 comment:4 by , 4 years ago
Ah, I understand your point regarding :conditional (a conditional yes implies there's also a moment when it's not yes - requiring "an object" like a barrier or traffic sign to enforce that outside of the conditional times).
True about :both_ways, although the warning might be misleading (as it's not wrong either to use it, right?)
Regarding [!railway]: I was thinking about railway (level_)crossings that are permanently closed yet not demolished. (e.g. access=no / train=yes or so). About 300 worldwide.
I restricted it to private/no as I thought positive values (yes, designated, permissive, destination, ...) could occur on many more types of objects, like traffic_calming. It's not used a lot, but wouldn't be invalid I think.
Edit: another one to exclude is [!ford]
Edit2: and exclude [!amenity] (or all those listed in https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/geometry.mapcss#L325 , like amenity=parking_entrance)
comment:5 by , 4 years ago
Replying to Famlam:
Ah, I understand your point regarding
:conditional(a conditionalyesimplies there's also a moment when it's not yes - requiring "an object" like a barrier or traffic sign to enforce that outside of the conditional times).
Yes, with :conditional I expect some other access tags for the time/transport_mode the conditions do not reflect.
True about
:both_ways, although the warning might be misleading (as it's not wrong either to use it, right?)
Sure :both_ways is valid together with lanes:both_ways=* but it makes only sense in detailed :lanes-tagging in other situations less complex access tags (usually without any suffix) can be used.
Regarding
[!railway]: I was thinking about railway (level_)crossings that are permanently closed yet not demolished. (e.g. access=no / train=yes or so). About 300 worldwide.
[/^(.*:)?railway$/ !~ /^(level_)?crossing$/] ?
I restricted it to
private/noas I thought positive values (yes, designated, permissive, destination, ...) could occur on many more types of objects, like traffic_calming. It's not used a lot, but wouldn't be invalid I think.
Ah, yes, forgot designated and official. For the rest, I would expect them to be tagged on the highway, too, at least for middle nodes.
Edit: another one to exclude is
[!ford]
nice catch
Edit2: and exclude
[!amenity](or all those listed in https://josm.openstreetmap.de/browser/josm/trunk/resources/data/validator/geometry.mapcss#L325 , likeamenity=parking_entrance)
Well, I am not happy with a bunch of those connected directly to a highway and e.g. with amenity=parking_entrance access tags need to be on the highway, as-well, if mapped beyond. But fine, exclude them for now.
Altogether middle and end nodes might be handled differently, like in #20742
comment:6 by , 4 years ago
[/^(.*:)?railway$/ !~ /^(level_)?crossing$/]?
Lets keep things simple, regexes do not need to start matching at the beginning :)
[/(^|:)railway$/ !~ /^(level_)?crossing$/]
Well, I am not happy with a bunch of those connected directly to a highway and e.g. with amenity=parking_entrance access tags need to be on the highway, as-well, if mapped beyond. But fine, exclude them for now.
Better a false negative than a false positive, right? ;)



Thanks, I will test.