TransWikia.com

There are some OpenStreetMap data that doesn't show when I query it with Overpass. Why does this happen?

Geographic Information Systems Asked on November 1, 2021

So I noticed when I wrote this call

https://api.openstreetmap.org/api/0.6/map?bbox=-118.652199,34.210391,-118.641990,34.214548&page=0&traffic_sign

I get a lot of data and some of them are nodes with traffic signs like

<node id="6786529269" visible="true" version="1" changeset="74327303" timestamp="2019-09-10T19:50:23Z" user="Clarke22" uid="703694" lat="34.2108057" lon="-118.6474817">
        <tag k="direction" v="forward"/>
        <tag k="highway" v="stop"/>
</node>

However when I move to the same bbox on Overpass Turbo and write this query

[out:json][timeout:25];
// gather results
(
  // query part for: “highway=*”
  node["traffic_sign"]({{bbox}});
  way["traffic_sign"]({{bbox}});
  relation["traffic_sign"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Very few traffic signs are shown or mapped.
Why is this? I need to find all the traffic signs in a given bbox.

2 Answers

The traffic_sign bit on your query string bbox=-118.652199,34.210391,-118.641990,34.214548&page=0&traffic_sign doesn't do anything. If you replace that with a random string you get back the same set of features. I don't think the OSM API can filter on tags like that.

The node you mention only has two tags, so it won't be found by searching for traffic_sign via the Overpass API either:

  <tag k="direction" v="forward"/>
  <tag k="highway" v="stop"/>

The wiki for "stop" says this:

Insert a node with tag highway=stop on the approach way(s) that must stop, 
at the stopping point. Drivers may be required to give way (yield) whether
or not a physical sign is present; but if you also want to capture the
signs, you can use a traffic_sign=* tag as well. 

So the presence of that node with those tag is expressing the way traffic should behave at that point, it doesn't indicate the presence of any physical object.

If there is a STOP sign on a post there, then perhaps the traffic_sign tag should be there, but if it is just a big "STOP" painted on the road, then I don't think that is a traffic sign in the way its described in the wiki for traffic sign.

From looking at the Overpass API query for traffic signs in my area, I can see that it is not used with much consistency.

Answered by Spacedman on November 1, 2021

Your Overpass API query looks for the traffic_sign=* tag, however node 6786529269 doesn't have this tag. Instead it is tagged as highway=stop. You have to expand your query to look for both tags:

node["traffic_sign"]({{bbox}});
node["highway"="stop"]({{bbox}});
way["traffic_sign"]({{bbox}});
way["highway"="stop"]({{bbox}});
relation["traffic_sign"]({{bbox}});
relation["highway"="stop"]({{bbox}});

As you can see, the tagging of traffic signs is not consistent unfortunately. There are other traffic signs such as highway=give_way which you may want to include, too. Also take a look at the tags for speed limits as well as limits for width, height and weight.

Also note that you can drop the relation part. Usually traffic signs are either mapped as nodes or are part of a way if they apply to the whole way.

Answered by scai on November 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP