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


Are there any methods to import osm data especially (properties) to excel sheet and vis versa?

asked 25 Feb '13, 14:27

AddisMap%20Meti's gravatar image

AddisMap Meti
accept rate: 0%

edited 25 Feb '13, 15:22

From OSM to Excel, I'd use osmconvert. Going the other way (once you've addressed all the usual "import" issues), try looking at the answers to this previous question.

permanent link

answered 25 Feb '13, 14:51

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

Thank you for your help but steel am having problems with osmconvert I can't get the option to convert ether to Excel or csv file can you help me with the code or ....

(25 Feb '13, 17:41) AddisMap Meti

As an example, here's the full process that I used to obtain all mapped railway stations in mainland GB with lat and long in a spreadsheet:

1) osmconvert great_britain.osm.pbf -o=great_britain.o5m

2) osmfilter great_britain.o5m --keep="railway=station" > stations.osm

3) osmconvert stations.osm --all-to-nodes --csv="@id @lat @lon railway name" --csv=headline > stations.txt

4) Open stations.txt in your spreadsheet program of choice, and remove lines that don't have "station" in column D

Step (1) is needed because osmfilter doesn't understand pbf (protobuf format) files. You could process as a raw .osm file, but it'd be much bigger.

Step (4) is a sanity check to get rid of a few bits and pieces.

(25 Feb '13, 17:46) SomeoneElse ♦

@SomeoneElse step 3 should read --csv-headline and not --csv=headline, as far as i can see.

Step 4 could also be achieved automatically with perl, e.g. with (untested):

 perl -ne'print if /.*?\t.*?\t.*?\t.*?\t(station).*/' stations.txt
(26 Feb '13, 07:09) gormo

Thank you very much it works! I also use Moor.XmlToCsvConverter.exe and its very simple!

(28 Feb '13, 15:07) AddisMap Meti

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 25 Feb '13, 14:27

question was seen: 15,048 times

last updated: 28 Feb '13, 15:19

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