Search code examples
overpass-api

Prevent Overpass API from returning nodes and show ways only


I'm trying to get all roads around a certain point. I'm using the following query:

(
  way
    (around:300,50.7913547,-1.0944082)
    ["highway"~"^(primary|secondary|tertiary|residential)$"]
    ["crossing"!~"."]
    ["name"];
  >;
);
out;

I added the crossing exclusion because it kept including "markers" for crossings, and I'm only interested in roads.

However it seems to be ignoring the crossing and still plotting markers on the map, rather than just showing road outlines. This can be seen here.

These "nodes" that I don't want have the tags:

crossing=zebra
highway=crossing

which should fail my regex query, but it doesn't.

How do I get it to just return road plot lines, and none of these nodes/markers?

Sorry if my terminology is all wrong, I'm very new to this


Solution

  • The filter criterion you tried to use would only apply to the way itself rather than the nodes. Usually, a way wouldn't have a crossing tag, so this filter didn't have much of an effect on the final result. By using >; all of the nodes tags would shown up in the final result again.

    I removed >; in your query and replaced out; by out geom; to only output the node lat/lon position without any tags.

    You can try this out using the following link (currently pointing to overpass turbo beta)

    Link

    enter image description here