https://wiki.openstreetmap.org/wiki/Tag:barrier%3Dgate#On_a_way says
gates can be ways.
So the biggest gate in the world would need fit on a single node to get rendered?
What the wiki says is not of that much concern here. What matters most is how tags are actually used. Looking at a few places practice of using barrier=gate on ways seems to vary a lot. In some places it is used in addition to a node, in some places alone. Sometimes there are several connected ways separately tagged as this (presumably several parts or wings of a gate).
I think independent of consistency of use just flatly rendering a symbol at ST_PointOnSurface(way) would be counterproductive because the correct location for rendering a gate mapped with a linear way with a point symbol would be at the intersection with the highway it spans.
The wiki was changed back in 2010. The original proposal was that gates should be on nodes shared by the highway. See https://wiki.openstreetmap.org/wiki/Talk:Tag:barrier%3Dgate#Mapping_on_a_way_instead_of_a_node.3F and the change https://wiki.openstreetmap.org/w/index.php?title=Tag%3Abarrier%3Dgate&type=revision&diff=462212&oldid=459004
Probably this should be discussed on the wiki first. It's also relevant for other barriers types that are only rendered on nodes, eg: 'gate', 'swing_gate', 'block', 'log', 'cattle_grid', 'stile', 'motorcycle_barrier', 'cycle_barrier', 'full-height_turnstile', 'turnstile', 'kissing_gate'.
A symbol at ST_PointOnSurface(way) would be counterproductive because the correct location for rendering a gate mapped with a linear way with a point symbol would be at the intersection with the highway it spans.
Right. How difficult is it to render an icon at the location of a node shared by a highway= way and barrier=gate way, uisng something like ST_Intersects or ST_Intersection? Is that an option or would it be too slow?
All I know is something needs to be done soon, to prevent people from
traveling miles and miles, OSM map in hand, only to be confronted by a
big, fat, locked, gate.
Well the road would be marked private anyway, with grey dashes, so they would know in advance anyway.
Well what if the road is not private, but there is a big gate upon it, that someone edited according to best practices... or not. There is a gate... and we don't wan't people to stumble into some DMZ...
Yup, some gate in some fence, (no nearby road, just nearby fence, which is a different Way, possibly not even connected to the gate Way, as it might be an electric fence which needs a gap from other objects) that someone should know about, even if the gate is in bad repair or fell over in a swamp. Because they are now standing on North Korean territory, and due to a defect in OSM, they weren't aware or it.
Well international borders are clearly visible on the map anyway.
OK, they are now standing on the private property of Mr. Nebbercracker, and thus in even deeper trouble.
How difficult is it to render an icon at the location of a node shared by a highway= way and barrier=gate way, uisng something like ST_Intersects or ST_Intersection? Is that an option or would it be too slow?
It is possible but it is also non-trivial with all the special cases and i doubt it is a good idea given the current mapping practice. barrier=gate nodes are vastly dominating and are used very consistently on the intersections between the highway lines and the physical barrier. barrier=gate however are used in a number of very different ways on ways, including:
And probably there are also gates mapped with closed ways as polygons out there.
Do router use ways which intersect with a "gate" way when the connection point is not tagged?
@HolgerJeronim
I think routers would ignore the gate if it isn't tagged on the node shared with the way. At least e.g. OsmAnd would. They are basically invisible, similarly to pedestrian crossings, bollards and other such objects.
The example https://www.openstreetmap.org/way/732810564 from @jidanni is clearly tagged wrong, as the gate osm way has no shared node with the highway.
So it no routing software of the world would exclude the highway based on the crossing gate object (but would because the highway itself has a private access). But QA tools should shout.
But even when the ways share nodes like this highway and this gate the router do not "move the access restriction" to the route.
https://www.openstreetmap.org/directions?engine=graphhopper_car&route=50.77834%2C6.06449%3B50.77850%2C6.06424
So we never should move an icon from the crossing way to the junction to support proper tagging like in https://www.openstreetmap.org/way/291520687
It sounds like we have consensus that this issue should be closed without changes, because we want to support consistent use of these types of barrier= tags on a node shared with the highway. Is that correct?
Also see some discussion on https://wiki.openstreetmap.org/wiki/Talk:Tag:barrier%3Dgate
Closing, mappers will be supported in using these type of barrier=gate and related tags on nodes which are shared by the highway=.