0

Can someone perhaps be so kind to give me some hints? I completely fail to put all the simple overpass examples together to get what I need:

  • Inside the relation: http://www.openstreetmap.org/relation/2618040
  • I want to get all ways where "highway" is "motorway, trunk, primary, motorway_link, ..."
  • All nodes those ways are referring to.
  • From the ways I want to keep the tags name, highway and oneway
  • I want the nodes without any additional data. Like so: <node id="122317" lat="53.5282633" lon="10.0232716"/>

1 Answers1

0

I'm not an Overpass API expert but this should work:

[out:json][timeout:25];
area["iso3166-2"="DE-HH"];
way(area)["highway"];
(._;>;);
out;

See the result on overpass turbo (warning: this is a lot of data, your browser could have trouble handling it). You might also have to increase the timeout for the query to succeed. Alternatively see the raw data directly from Overpass API.

I replaced your relation ID 2618040 with a specific tag which should be more stable. But of course you can also use the relation ID if you like. For this you have to add 3600000000 to the relation ID because areas aren't native elements in OSM:

[out:json][timeout:25];
way(area:3602618040)[highway];
(._;>;);
out;
scai
  • 20,297
  • 4
  • 56
  • 72
  • Nice, that really seems to work. (Overpass looks like a thing from the past...) But can overpass also drop tags from the result set? Stuff that I used osmfilter before? Like `--keep-node-tags="all highway=traffic_signals" --keep-way-tags="all name= highway= oneway=" -o=hamburg.osm` –  Aug 04 '15 at 16:51
  • 2
    At the moment, you can only use the CSV output format for Overpass API to get specific tags only. All other formats like XML or JSON will always return all existing tags. BTW: What do you mean by "Overpass looks like a thing from the past"? – mmd Aug 04 '15 at 20:48
  • 1
    Regarding filtering of tags, there's also the following feature request on Github: https://github.com/drolbr/Overpass-API/issues/221 – mmd Aug 05 '15 at 09:15
  • Ok, thanks, I keep on using osmfilter for the filtering part then. (And it was the most polite way to say that I think the Overpass API should look totally different.) –  Aug 05 '15 at 16:37
  • @marcus: well, there's a dedicated Overpass developer list: overpass@listes.openstreetmap.fr - maybe you want to post your ideas there? – mmd Aug 05 '15 at 18:17