1

I try to get a list of all streets/addresses for a single geocodeArea. E.g.

{{geocodeArea:Heidelberg}}->.searchArea;
(
nwr[highway=highway][name](area.searchArea);
nwr[highway=living_street][name](area.searchArea);
nwr[highway=residential][name](area.searchArea);
nwr[highway=primary][name](area.searchArea);  
nwr[highway=secondary][name](area.searchArea);
);
(._;>;);
out;

With that, for the primary and secondary highways I also get bus_stop (Node 3205201698) and tram_stops because they relate to the chosen highway type. I tried removing them with the difference operator but with no luck so far.

Where am I wrong?

1 Answer 1

1

The bus stop node 3205201698 is part of the highway 259359975. You can't remove it or otherwise your highway will have a gap.

In OSM the geometry of a way is defined by nodes. Both ways and nodes can have tags. This means a node already being part of a highway can represent an additional object, such as a bus stop. Removing this node will remove part of the way geometry.

6
  • Alright, that I get. No doubt the bus_stop should be in relation to that highway. When I try to get only the names of certain highway types, how can I avoid getting the names of their related objects?
    – entenbein
    Jan 29, 2020 at 15:04
  • 1
    You could simplify your query. First, only search for ways since you aren't interested in nodes and relations: Replace nwr with way. Then, drop the recursion step ((._;>;);) if you only need highway names but not their geometry. This will lead to the following query: {{geocodeArea:Heidelberg}}->.searchArea;(way[highway=highway][name](area.searchArea);way[highway=living_street][name](area.searchArea);way[highway=residential][name](area.searchArea);way[highway=primary][name](area.searchArea); way[highway=secondary][name](area.searchArea););out; (overpass-turbo.eu/s/QdJ).
    – scai
    Jan 29, 2020 at 15:15
  • Worked like a charm! I tried replacing way by nwr and removing the recursion step before, but also overpass suggested (when choosing a "visual output") reparing the data (= adding (._;>;); ). Since it didn't show anything without it, I fell for it... As a csv-output everything is fine. Thanks a lot!
    – entenbein
    Jan 29, 2020 at 15:51
  • 1
    It suggests to repair it because it isn't able to show (i.e. to render) ways if the corresponding nodes are missing. Nevertheless these ways are contained in the output, without their geometry.
    – scai
    Jan 30, 2020 at 7:06
  • Great, one more question: How can I limit my search with a geocodeArea and e.g. postal_code?
    – entenbein
    Jan 30, 2020 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.