1

I have tried osmconvert to convert osm to .o5m and .pbf file it works fine but am having problem converting osm to .csv or excel file I used

./osmconvert addis.osm --all-to-nodes --csv="@id @lon @lat amenity cafe restaurant name" or ./osmconvert addis.osm --all-to-nodes --csv="@id @lon @lat amenity cafe name"

but nothing comes up is there any other way to convert osm to excel sheet or csv file?

asked 25 Feb '13, 18:01

AddisMap%20Meti's gravatar image

AddisMap Meti
71449
accept rate: 0%

you forgot --out-csv and --o=...

also, see my answer

(25 Feb '13, 19:38) gormo

3 Answers:
5

OSMconvert is not a filter. This means that all features will be converted.

To achieve your goal of having only certain features in your csv file, you will have to filter the csv file generated by osmconvert afterwards.

Also, the arguments to the --csv option of osmconvert are the tag keys you want to have in your csv file. If you want "amenity" and "name" columns in addition to id, lat and lon, you specify "@id @lon @lat amenity name", and then filter the CSV output.

For example:

./osmconvert addis.osm --all-to-nodes --csv="@id @lon @lat amenity name" --out-csv -o=outfile.csv

grep cafe outfile.csv > cafes.csv
grep restaurant outfile.csv > restaurants.csv
cat cafes.csv restaurants.csv > cafes_and_restaurants.csv
permanent link

answered 25 Feb '13, 19:37

gormo's gravatar image

gormo
2.9k32660
accept rate: 13%

edited 25 Feb '13, 19:39

how to store that in mysql

(20 May '14, 12:16) say_hello_to...
1

What do you mean with "that"?

(20 May '14, 12:30) scai ♦

Have you ever tried any internet search engines like duckduckgo, google, yahoo or similar, and do a search there for "import csv in mysql" or similar?????

(21 May '14, 18:18) stephan75
1

@stephan75 : apparently he has not bothered. So he might find some hints for the problem he faces at http://stackoverflow.com/questions/3635166/how-to-import-csv-file-to-mysql-table . At least be helpful, too.

(21 May '14, 20:01) gormo
0

I have tried do a similar thing: convert a way in baikal.osm to baikal.csv . The problem is the order of nodes I get in .csv file. I used

osmconvert baikal.osm --all-to-nodes --csv="@lon @lat" > baikal.csv

I get nodes in wrong order. osmconvert do not read the second part of .osm file with <nd ref= ...

How to solve this?

permanent link

answered 28 May '14, 20:29

miko679's gravatar image

miko679
11112
accept rate: 0%

0

You can also have closer look at the Java based tool OsmPoisPbf, which scans an OpenStreetMap file for nodes and areas (and relations) whose tags indicate them as POIs (points of interest) and extracts those into a comma separated file (CSV).

permanent link

answered 17 Dec '15, 20:38

stephan75's gravatar image

stephan75
12.5k454209
accept rate: 6%

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:

×41
×33
×31
×7
×6

question asked: 25 Feb '13, 18:01

question was seen: 8,394 times

last updated: 17 Dec '15, 20:38

powered by OSQA