How do I use OSM files - obf, osm, pbf, etc

Hello all -

I have succeeded in greatly confusing myself. (it is probably not hard to do!)

Can someone teach me the purpose of the various OSM files?

I thimk I have figured out that .obf is file format used on the actual android device.

However, I tried to import the .obf file into JOSM, and no luck or option to do such.

Questions:

  1. What are the .osm and .pbf files and what is their purpose?
  2. How do I display a .obf map on a desktop computer?
  3. Is there a resource I can use to read about these and educate myself?

(about #3, I have been surfing the internet until my eyes pop out)

I have three andorid devices Ultimately, I want to be able to copy the same map to all devices AND be able to open it on my desktop so I can also consolidate all my saved places into one GPX.

I also have a Garmin device, and want to import the maps into Base Camp… but that is another topic I think (eg: convert to .img file)

Thanks!

1 Like

There some information here:
https://wiki.openstreetmap.org/wiki/OSM_file_formats

1 Like

Perhaps you could give more detail on what you are trying to do. For many “normal” uses of maps based on OSM, it isn’t necessary to know about these things. I use various Android apps to view the map and to edit it, but I don’t know what file formats they use. Similarly I rarely think about file formats when using JOSM, except maybe to save a change file that I want to continue working on later.

Of course it’s possible your proposed usage really does require knowledge of the details of different formats (aside from the Garmin use which probably really does need that). It will be easier for people to help if you can clarify that.

1 Like

Hello there! Many thanks for the link! I will indeed give it a good read!

1 Like

Hi Alan - Many thanks for the quick response!!

Let me expand on “what I am trying to do”.

First, my hardware:

3 - Android devices with OSMAND installed
1 - Gamin Drive Smart
1 - PC (laptop) w/ BaseCamp

The Android devices are used under different scenario’s as is the Garmin.

It is normal for me to add favorites (my places) to the different devices as I travel or use the different ones.

Periodically, I pull all the GPX files from the devices, bring them into BaseCamp and compile a “waypoint master”. I then load the compiled / consolidated “way point master” back into each device and every thing is in sync. That is, the same favorites / my places / way points are all the same on each device.

All is well on this point, I have this part figured out.

I also want to be able to keep the same maps on each device.

This is what is throwing me into overload / confusion.

I actually had this figured out a few years ago, but I can not for the life of me figure out how I did it.

What I want to be able to do is:

Down load a map file, and load them into all my devices, in different file formats, including the Garmin and Base Camp.

As an example:

I have a file “Mexico_full_gmapsupp.obf”. If I am not mistaken, this is the file I drop into OSMAND on my android devices. I also have the same file, “Mexico_full_gmapsupp.img” - this is the file for my Garmin and basecamp (if I can figure out how I brought it into basecamp before)

So, trying to state the goal more basic…

How do I down load an OSM map, install it on my Android devices as a file, and then also do the same for my Garmin and subsequently also Basecamp?

As an experiment, I tried to use JOSM, but it will not load an .obf file.

So, I am completely confused how I did this before… :frowning:

Any advice?

Hi again - I just skimmed the info at the link you sent.

I think I found that as I searched…

What is missing on the list is .obf.

If I am not mistaken, .obf is the file format that is needed by OSM on my Android Devices - am I correct?

Needed by OSMand, not by OSM :smiley:

Please see OsmAnd Binary Maps - .obf | OsmAnd

Edit: You could use OSMand with an Android Emulator (i.e. from Windows App Store) on your PC.

3 Likes

The thing is you don’t actually want a “OSM” file. Raw OSM data (that is what is in osm, pbf, o5m etc files) is not really suitable for rendering in an app (OSM editors do that, and that is a royal PITA).

What you need is OSM data converted to a format that can be rendered by the relevant apps, so for garmin you would be using mkgmap, for osmand whatever their generator is called that produces .obf files, and so on (not to forget vector tiles, but that is a bit of a digression).

Typically in that conversion process you will need to provide a style file of sorts that will determine what the output will look like. So yes you could have many formats with at least a similar style. OpenTopoMap has for example similar styling for its web and its garmin variant https://garmin.opentopomap.org/.

1 Like

At a tangent from your main question, that, broadly, is what this does. I only use it with Garmin waypoints, and these are stored outside of OSM, so for example the waypoint “SNC277004” in this file got added as this node (“NC” in the name means “national cycleway” and the number after it was assigned automatically.by the software.

Hi there Simon - many many thanks for the very helpful post! I think this helps me understand they “hierarchy” of files much more. So, basically, the “OSM” file is “raw” data and I need to convert this into a format that can be rendered by my application… eg: obf and img formats.

Correct?

I quickly looked at mkgmap and at first skim, it appears to be exactly what I am looking for!

SK

1 Like

Many thanks for the helpful reply!

…many thanks for the helpful response. Let me fiddle around a bit more and see if I can get where I want to go … (no pun intended)

Well the issue is is that there is no one common format for consumption by apps so Garmin, OsmAnd, Organic Maps all use different formats (there’s the whole subject of routing that I skipped).