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

I want to use osmconvert to convert an osm file to a csv file with just the street, city, state, latitude/longitude fields. But I don't know what the actual field names are in the osm file. How do I open it to see or is there a list somewhere? The .osm file is rather large, so if there was a cmd line to view fields, that would be easier. Thanks!

asked 13 Sep '12, 22:08

JMB5's gravatar image

JMB5
16334
accept rate: 0%

edited 13 Sep '12, 22:09


If you want to see what the most commonly used keys are worldwide, have a look at Taginfo. You can use standard GNU/Unix utilities to look at what's in the ".osm" file, if it's too big for a text editor. If you're on Windows and don't have things like "grep" available, have a look at Unxutils, which is a native build of most of the common GNU utilities for Windows, or Cygwin, which is a slightly different approach to solving the same problem.

For example, looking at a small .osm file that I happen to have lying around:

c:\Temp\osm\new>grep 'k="highway"' local_101017_01.osm | wc
    3182     9546   109056

I can see that there are 3182 "highway" items (roads, paths, bus stops etc.)

To see what sort of highway items there are I can do:

c:\Temp\osm\new>grep 'k="highway"' local_101017_01.osm | \utils\sort -u | more

  tag k="highway" v="bridleway"
  tag k="highway" v="bus_stop"
  tag k="highway" v="cycleway"
  tag k="highway" v="footway"
  tag k="highway" v="ford"

(rest of output truncated and chevrons removed)

permanent link

answered 13 Sep '12, 23:36

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Have a look at the similar program osmfilter.

It has features to produce a listing for all used keys in an osm file, see Osmfilter#Getting_Tag_Statistics

permanent link

answered 15 Sep '12, 14:35

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

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:

×47
×42
×4

question asked: 13 Sep '12, 22:08

question was seen: 6,130 times

last updated: 15 Sep '12, 14:35

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