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

How do I read .osm-files from a pc

0

Hi! I have an .osm file on a USB-stick. How do I read, what is in the the file, from my pc?

Best regards

Hasse

asked 27 Apr '12, 17:59

resgi's gravatar image

resgi
11112
accept rate: 0%

edited 02 May '12, 16:18

TheOddOne2's gravatar image

TheOddOne2
6851621

1

@resgi A ".osm" files are just XML data files full of OSM map data (https://wiki.openstreetmap.org/wiki/OSM_XML). What do you want to do with the OSM data?

(27 Apr '12, 18:26) jwernerny

Hello jwernery! Thank you for your response to my question. I want to know what´s in those osm data, before I upload to my Garmin (EDGE 800). Hasse

(27 Apr '12, 21:14) resgi
2

uploading a pure osm-file to a Garmin device will not help you. Have a look at https://wiki.openstreetmap.org/wiki/Garmin to see how to use OSM data with those devices.

(02 May '12, 15:50) stephan75

One Answer:

2

What you'll probably have is either something like "blah.osm", "blah.osm.pbf" or "blah.osm.bz2".

The first of these is just a text file (in XML format). The second is the same data in a binary protocol buffer format, and because it's binary, the file's smaller. The third is the text XML version compressed with bzip2, and is slightly larger than the pbf version.

To convert .osm.pbf data into .osm data you could use osmconvert. To unzip .bz2 files you'd use bunzip2.

Because it's just text, ordinarily you'd just be able to use a text editor or viewer to look at it. If you've obtained a country-sized amount of data to process for a GPS, the XML data file is likely to be quite large ("great_britain.osm" is 8Gb) so you're probably not going to be able to use any old text editor with it. You could try something like "more blah.osm" though, to look at the data a page at a time.

answered 27 Apr '12, 23:34

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Source code available on GitHub .