My end goal is to get a CSV of restaurants in my area. I experimented with Turbo and then converted via convertcsv.com, but when I tried uploading it into a program, it was all errors. I opened it in Excel and saw that all of the info was jumbled up. Can anyone help me troubleshoot this or tell me if this is something I can even achieve using OSM?

asked 17 Apr, 22:40

doakickflip's gravatar image

doakickflip
112
accept rate: 0%

3

Please share what you've tried so far. Your overpass-turbo query, the results... Also overpass has an option to directly output CSV IIRC. Have a look at the documentation. Regards.

(17 Apr, 23:57) H_mlet

I queried "restaurants" and it suggested "fast food" which is what I went with. Here is the coding result of it:

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“"fast food"”
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “"fast food"”
  node["amenity"="fast_food"]({{bbox}});
  way["amenity"="fast_food"]({{bbox}});
  relation["amenity"="fast_food"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

This is what I'm seeing as options when I try to export the data:

download/copy as GeoJSON

download/copy as GPX

download/copy as KML

download/copy as raw OSM data

raw data directly from Overpass API

load data into an OSM editor: JOSM, Level0

What am I overlooking for the CSV?

(18 Apr, 14:31) doakickflip

Overpass Turbo is an interface for Overpass-API. CSV output is a feature of the Overpass-API query language rather than Overpass Turbo.

Here's a script that finds fast_food and restaurants and outputs a few of the attributes:

[out:csv(name,amenity,::lat,::lon)];
nwr[amenity~"fast_food|restaurant"](bbox:{{bbox}});
out;

Additional attributes can be added to output, each one has to be explicitly added to appear. The query language has quite a lot of functionality: https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL

permanent link

answered 18 Apr, 15:01

maxerickson's gravatar image

maxerickson
12.5k1079175
accept rate: 31%

That was a very clear query command, thank you. But I'm still not clear on how to export the data..

(18 Apr, 15:40) doakickflip

Just run execute... Or if you need it programmatically, you can export/copy the request, and run it when needed, with curl for example.

(18 Apr, 15:46) H_mlet

But if I can export it directly as a CSV from the query, I can't find that option.

(18 Apr, 15:47) doakickflip

Check Export -> Data -> raw data.

(19 Apr, 07:11) scai ♦
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:

×164
×136
×35

question asked: 17 Apr, 22:40

question was seen: 160 times

last updated: 19 Apr, 07:11

powered by OSQA