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



I'm trying to write a small android application that must be used offline.

Basically i need to find a lib to access osm data offline. I've read about PBF and OBF, and think they should be appropriate. But i'm having a hard time finding a lib.

I don't want to display the map or anything, i'd like to access raw data ... nodes, ways, relations ...

asked 13 Mar '13, 16:01

ZARk's gravatar image

accept rate: 0%

edited 14 Mar '13, 07:13

mmehl's gravatar image


Osmosis can read pbf as well as osm, osm.gz and osm.bz2. I've posted example code on the forum a while ago. It's not 100% up to date but should give you a first impression how you could use it:

Additional features of Osmosis include filters and other pipeline elements to e.g. trim unwanted data while you are reading it. Osmosis is most commonly used as a stand-alone command line tool, but do not let that fool you: It is a decent choice as a Java library as well. I've used it in several of my projects.

However, I'm not an Android developer and do not know whether Osmosis works on Android. So take my recommendation with a grain of salt!

permanent link

answered 13 Mar '13, 19:36

Tordanik's gravatar image

accept rate: 35%

Hello Toranik !

Thanks for the link, i'm actually trying to build with your snippet i found when searching the forum.

But i'm actually having compilation issues when including the jar files from osmosis. So far it seems like the best solution (if I can compile on android with it)

(14 Mar '13, 16:16) ZARk

The OSM wiki page has links to the protobuf code.

permanent link

answered 13 Mar '13, 16:50

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

edited 13 Mar '13, 17:37

via wiki/O5m I found recently o5m4j ... a small java lib.

permanent link

answered 13 Mar '13, 17:11

stephan75's gravatar image

accept rate: 6%

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: 13 Mar '13, 16:01

question was seen: 16,012 times

last updated: 14 Mar '13, 16:28

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