Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm new to OpenStreetMaps. I have followed their wiki/main page and tried to understand it.

Can anyone briefly explain how exactly OSM xml data works and how it is rendered? ...Any links /pointers would be useful.

I went to this link: cloudmade osm xml extracts. Here I'm seeing various file extensions of the OpenStreetMap files. I want to know, is there a way to use OSM xml extracts to download /display a map?

Also, how can I use OpenStreetMap data to make an Android app completely offline? E.g., tripadvisor recently launched such apps.

Any help, suggestions are welcome. Thanks.

share|improve this question
    
wiki.openstreetmap.org/wiki/Android has many links for Google Android and OpenStreetMap data –  Mapperz Dec 29 '11 at 14:59

3 Answers 3

For offline maps using OSM data i find three libraries very much useful.

  1. osmdroid : I use this library if i have to work with tiles that are in mbtiles format that i generate using tilemill. There is a bonus library for routing called osmbonuspack that adds lots of routing and POI functionality to this library.

  2. mapsforge: I use this library when i need to have the map data in vector format and also because it works with another great library called graphhopper in android.

  3. graphhopper: I use this library for offline routing using osm data. This is a lightweight java routing library which work for android as well.

I suggest you take a look at these libraries if you want to use OSM with android. Also after you get somewhat familiar with these libraries i suggest you take a look at the code for popular android based tools for osm like osmand, osmtracker and Vespucci

You can find lots of tutorials on the internet based on these libraries. Do explore. I hope this helps.

share|improve this answer

Normally, OSM data is rendered to images by way of a program called osm2pgsql, which converts the raw XML extracts to a Postgres database with geometry in it. Then, a program called Mapnik is used to render the images from the database, by way of a stylesheet.

Rendering on Android is a pretty hard problem, but I've been working on a stylesheet that's designed to generate small, maximally-compressed image tiles. Maybe that would be appropriate for you?

https://github.com/migurski/OSM-Solar

share|improve this answer
    
thanks for the info abt map rendering , i shall check out that link :) –  android_hungry Dec 29 '11 at 18:07
    
Michal great link - keep up the good work. –  Mapperz Dec 29 '11 at 18:35
    
For large areas or high zoom level I doubt that image tiles will solve the problem for mobile offline usage –  Karussell Oct 28 at 21:08

Rendering "offline on Android" means you would need to:

  1. Understand OSM data schema and how the data features are organized.
  2. Implement the map rendering code using Android rendering API.

The second point is the tougher one. I don't know if there are any good open source OSM map rendering libraries for Android. If there aren't, you will have to invest quite a lot of time to implement one yourself. Also, there are issues of how large the area you want to cover and in what level of detail. Don't expect to be able to render the whole world in zoom level 15. for example - there's just too much OSM data to be able to store it on an Android device.

An alternative would be to pre-generate map tiles on a PC and upload them to the Android device, but that requires even more storage.

share|improve this answer
    
thanks for the hints and explanation , i dont need osm map for the world , i need a whole city map atmost –  android_hungry Dec 29 '11 at 18:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.