Find gates/stiles at the junction of three footpaths

I’m trying to find nodes like this: Node: 1281894951 | OpenStreetMap
i.e. where there is a gate, stile or similar that is positioned at the junction of three footpaths, since a gate or stile must lie on a single way

What I think I need is:
a barrier=* node that lies on three highway=* ways
or a barrier=* node that lies on two highway=* ways, and it is a middle node (not the first or last node) of at least one of the ways

If the barrier=* node is the first or last node of both of the ways, that is fine obviously

Is is possible to write an overpass query to return this? Hope this makes sense!

1 Like

We’ll start with the “at least two ways” part of the question, because it’s the easiest one:

[bbox:{{bbox}}];
node[barrier=stile];
foreach -> .n {
  way[highway](bn.n);
  if (count(ways) > 2) {
     .n out;
  }
}
4 Likes

i.e. where there is a gate, stile or similar that is positioned at the junction of three footpaths, since a gate or stile must lie on a single way

a gate or stile could in theory be located at the intersection of 3 ways.

A similar situation, but really not possible, are steps connected to a road (there should always be a “virtual” connection from the steps to the road center, and if it isn’t mapped with a footway most probably the steps way will be too long)

It would be a nice job for osmose, but I can’t find it.

It is impossible for a stile to be at a junction of three paths, although quite common to be close to one.

In sjorford’s example the question is does a walker coming from the north cross the stile to continue south or west or before the junction?

If before the junction then a walker coming from the south will not cross the stile if going west but will if going north.

Unfortunately imagery (or historic mapping) is not clear enough to answer that question.

There could of course be two stiles

2 Likes

This just makes me want to build a stile over a corner where three walls meet at a point. :slight_smile: