NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I net to run by terminal (eg. using wget or curl) an Overpass query... Something like

(  node[place]({{bbox}}); relation[boundary]({{bbox}});  );

but returning a CSV file with csv(id,user,type,wikidata,name,place, boundary) (perhaps with verbosity='meta').

So, how to express this query in a standard URL-API? What the best URL to use, overpass-api.de?

PS: I need a full URL to test, as http://overpass-api.de/api/interpreter?data=[out:csv];...

asked 30 Jul '18, 15:34

ppKrauss's gravatar image

ppKrauss
95192225
accept rate: 0%

edited 30 Jul '18, 15:35


Simple answer is (if I understand question correctly)

http://overpass-api.de/api/interpreter?data=%5Bbbox%3A51%2E505049609500325%2C%2D0%2E11482000350952147%2C51%2E51091261939121%2C%2D0%2E10587215423583984%5D%5Bout%3Acsv%28%3A%3Aid%2C%3A%3Auser%2C%3A%3Atype%2C%22wikidata%22%2C%22name%22%2C%22place%22%2C%22boundary%22%29%5D%3B%28node%5B%22place%22%5D%3Brelation%5B%22boundary%22%5D%3B%29%3Bout%20meta%3B%0A

In a bit more detail I have rewritten your query and typed into overpass turbo (if this isnt quite what you want I hope you get the general idea)

[out:csv(::id,::user,::type,wikidata,name,place, boundary)]
[bbox:{{bbox}}];   
(  node[place] ;
   relation[boundary];  
);     
out meta ;

Running this gives

@id @user   @type   wikidata    name    place   boundary
450524790   SK53    node    Q154322 South Bank  suburb  
51781   kalc    relation    Q179351 City of Westminster     administrative
51800   lefty74 relation    Q23311  City of London      administrative
......

I then selected Export > convert to (compact) OverpassQL Which opens new tab with the rather long URL quoted above

permanent link

answered 30 Jul '18, 16:33

andrewblack's gravatar image

andrewblack
3651214
accept rate: 57%

edited 30 Jul '18, 16:40

Hi, thanks, near perfect! I need also restriction to "wikidata is not null". About BBOX I posted another question, because will be easy starting with a relation ID.

(30 Jul '18, 17:03) ppKrauss

Solved the "wikidata is not null" constraint by node[place][wikidata]; relation[boundary][wikidata];

(30 Jul '18, 17:28) ppKrauss
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×42

question asked: 30 Jul '18, 15:34

question was seen: 4,868 times

last updated: 30 Jul '18, 17:28

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum