5

I want to get the data out of http://wiki.openstreetmap.org/wiki/Planet.osm

I have just come back from the site http://wiki.openstreetmap.org/wiki/Planet.osm

which has got some files that belong to the openstreetmap-Project. i downloaded a similar file that is derived from a German Mirrorsite - this one here:

http://ftp5.gwdg.de/pub/misc/openstreetmap/download.geofabrik.de/

i downloaded the file called germany.osm,bz2

according to this instruction

type bzip2 -d planet.osm.bz2; or your OS may support double-click unpacking. See Wikipedia's list of compression programs.

i did the following - but without success-,

martin@linux-wyee:~/poi_abzug/geofabrik> bzip2 -d germany.osm,bz2;
bzip2: Can't open input file germany.osm,bz2: No such file or directory.

Can anybody explain why i did not succeed?

further questions:

  • Is this a XML-File ?

I only need the data for the Pois in Germany: can i use this file here - http://ftp5.gwdg.de/pub/misc/openstreetmap/

As this might be of general interest i think that many users can benefit from an answer to this question.

So my question is:

  • How to read the above mentioned dataset - how to read it - on a OpenSuse-Linux-machine!?
  • Should i do it in the terminal?

Note - i want to store all in a csv file - and i look for all the restaurants... What is the easiest way to do this?

closed as too broad by PolyGeo Feb 12 '18 at 6:17

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You certainly don't need Planet.osm if you only want to look for POIs in Germany. Germany.osm listed e.g. in ftp5.gwdg.de/pub/misc/openstreetmap/download.geofabrik.de will be enough. – underdark Apr 14 '12 at 18:23
  • hello dear underdark - many many thanks for the answer. Note; i have written an update - see above I am happy that you pointed me to the right source. Unfortunatly i have some issues to open the file in Opensuse 12.1 - i want to inspect the data - and have a closer look . is it possible to have a look at the xml data - eg. the name of the entity - which is the name of a restaurant, then the street and some times even some additional infos. Is it possible to extract those data out of the above mentioned file!? Look forward to hear from you - greetings – zero Apr 15 '12 at 2:06
  • 1
    Your command did not succeed because the file is named germany.osm.bz2 instead of the germany.osm,bz2 you typed. Only a small difference for your eyes, but a big for the computer ;-) – AndreJ Aug 13 '13 at 5:21
  • btw. are you 100% sure that your filename is germany.osm,bz2 usually there is no , in filenames just . (dot) – simplexio Aug 13 '13 at 11:59
2

You can use cloudmate to download OSM data in shape file format per country. Check the following link:

http://downloads.cloudmade.com/

  • can i do some requests on POIs of Openstreetmap with XAPI. doing like so: i send a request to the API-Server - over http as a respond i get the following result - in XML example: the following link gives back all the Nodes of the Type amenity=restaurant in XML-Format. the bounding box (bbox) limits the area: xapi.openstreetmap.org/api/0.6/… what do you say!? – zero Apr 17 '12 at 22:03
  • 2
    Looks like cloudmate dismitted this service. Today downloads.cloudmade.com will redirect you to 404 (page not found) – augusto Oct 1 '14 at 18:22
4

As Underdark noted, you don't need to use planet.osm, but instead use the link she provided contains all data (included restaurants) within Germany.

You'll want to use Osmosis, an OSM data parser. (Check out the detailed usage page to find out more of how to use osmosis, if you're interested.

There may be other ways in osmosis to do it, The following filter should leave you with a file that removes all ways and nodes that DO NOT have the value amenity=restaurant (since Restaurants could be coded in OSM as a node or a way). You have to run 3 commands, as follows:

osmosis --read-xml input.osm --tf accept-nodes amenity=restaurant --write-xml output-nodes.osm

osmosis --read-xml input.osm --tf accept-ways amenity=restaurant --write-xml --used-node output-ways.osm

osmosis --rx output-ways.osm --rx output-nodes.osm --merge --wx merged.osm

As for getting it into a CSV file ? Not sure, but I don't think there's a particular program that directly exports OSM to CSV. Is there a particular reason you want it into a CSV file ? If you're using an application that supports imports of CSV, it might also support other file formats that .OSM data could be exported into.

  • just looking for the mirror of osmosis pepo for opensuse 12.1 ftp.suse.de/pub/opensuse/repositories/Application:/Geo/… is this the path that i need..? – zero Apr 15 '12 at 10:21
  • can i do some requests on POIs of Openstreetmap with XAPI. doing like so: i send a request to the API-Server - over http as a respond i get the following result - in XML example: the following link gives back all the Nodes of the Type amenity=restaurant in XML-Format. the bounding box (bbox) limits the area: xapi.openstreetmap.org/api/0.6/… what do you say!? – zero Apr 17 '12 at 22:03
2

Try Overpass, it gives easy access to search POI data from openstreetmap.

Or get the germany.osm data dump and use this link to get the POIs as a CSV file.

(Problems with unzipping a bzip2 file should probably be asked on another stackexchange site)

2

https://github.com/MorbZ/OsmPoisPbf

Check above link and download osmpois.jar

This will parse the .osm.pbf file and will creates .csv file with containing tag type,tag name ,tag id,longitude, latitude

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