This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to easy export osm data in csv

0

For example: I want to export the position, Street and names of all fire hydrants of my city in a spreadsheet or csv file? How can I do that? Is there an easy web frontend to configure and download the export? Or do I have to code?

asked 18 Dec '18, 08:27

Vale's gravatar image

Vale
11113
accept rate: 0%

I am experimenting with http://overpass-turbo.eu/ For example I try to get all glass containers in a city.

qith the query I get all recycling related points: // query part for: “recycling” node"amenity"="recycling"; way"amenity"="recycling"; relation"amenity"="recycling";

How do I get only the glass containers?

(18 Dec '18, 08:52) Vale

One Answer:

4

As you've already found out (for not all too large areas) the overpass api or the overpass-turbo frontend is likely the best choice.

If you need to refine your searches you should consult the wiki for information on the objects and how they are tagged (and yes there may be a couple of variants that you will need to consider).

For your example http://overpass-turbo.eu/s/EC5

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

To get CSV output you will need to directly use the overpass-api and specify that you want CSV output.

answered 18 Dec '18, 11:17

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 18 Dec '18, 12:20

I've added the Overpass API query to your answer in case overpass-turbo becomes (temporarily) unavailable.

(18 Dec '18, 11:45) scai ♦
1

You can get csv in overpass turbo, by replaceing [out:json] like this:

[out:csv (::id, ::lat,::lon, "recycling_type","recycling:glass_bottles")]

(18 Dec '18, 12:52) SK53 ♦

Source code available on GitHub .