2
1

Hi, I'm a complete newbie here. Please bear with me. I'm trying to find a way to include offline mapping in my iOS and Android app which effectively plots a GPS position (or many positions/trail) on a map background. I can do this live/on line (if a data connection is available) with, say, Google Maps, but now want to add offline capability.

I have the GPS/positioning (getting and manipulating Lat/Lon data) side of things pretty much sussed but have no idea how to simply/easily offer the capability to plot positions on a pre-downloaded map within my app. I can currently load in, say, an image, and display it but have no idea as to how to then scale said image correctly and pass in a position (Lat/Lon) for display on said 'image'...

Is there an SDK for Android / iOS ? Am I missing something really obvious ? Am I in the right place ? Maybe this has already been done and is now a little passee but I'm really keen to do soemthing with OSM as the map source. Sorry, completely lost !

Can anyone point me in the right direction please ?

asked 21 Sep '11, 14:38

JanCol's gravatar image

JanCol
29113
accept rate: 0%


OpenStreetMap doesn't provide a formal SDK. We focus on creating the map data; we don't provide an end-user product or developer tools. We leave that to other people!

For iOS, the most popular map library is RouteMe, which is open source. Bear in mind, however, that if your app uses map images from openstreetmap.org, you absolutely must adhere to the Tile Usage Policy, and that pretty much means using your own server or a third-party one unless you're expecting only miniscule amounts of usage.

You may also find CloudMade's SDKs of interest.

link

answered 21 Sep '11, 16:03

Richard's gravatar image

Richard
18.4k29163246
accept rate: 20%

Hi. Thanks for the answers. Appreciated. I'm still confused though - sorry... like i say, i'm new to this. So, I understand that OSM 'provides' the map data. And others provide the ability to view such data... I guess I'd like /need to find a suitable SDK -or- create my own but, how would i download a particular area/map tile? If i did download one, am i able to use it offline? Would i be able to zoom in/out or is the tile of a fixed zoom level once downloaded ? Would i need to download the same tile at various zoom levels to be able to zoom in/out or....is the map image/tile scaled? I mean how is the map bounds and scale data incorporated? Within the map 'tile' or as a separate 'data' file... I'm really keen to provide off-line mapping but am looking for some pointers as to the established 'norms' so i can decide if i need to create something myself and how simple it is to download the map tiles themselves and then scale them/set the lat/lon bounds etc Like i say, I'm keen to use OSM as my data source but am confused as to how to/where to start... as you'll have gathered from the above...

If you've gotten this far then thanks. I hope you can help point me in the right direction TIA, Jane.

(21 Sep '11, 22:28) JanCol
1

First of all you need to decide whether you want map tiles (pre-rendered vector images, usually .pngs of 256x256 pixels each) or to draw your own map from vector data. Map tiles are easier to work with for simple map display - the Route-Me library, for example, uses map tiles - but you'll need to identify a server from where you can get them.

Once you've decided that, come back and ask us more - right now your question is a bit too open-ended for us to advise more.

(23 Sep '11, 11:40) Richard
1

Saying more about that : map tiles are simple pre-rendered image files (png or jpg) you can store on your device for the offline mode. But be aware that this requires a lot of storage memory, depending the amount of zooms and the area you want to cover. Storing the vector data is surely an alternative that offers other possibilities like off-line routing but you will have to render the images yourself.

(23 Sep '11, 12:23) Pieren

The map data is provided as whole planet dumps or extracts. See Planet.osm on the wiki for more details. These are quite large files and contain every (current) bit of data is the osm database. For a mobile app you would probably run the data through filters beforehand possibly changing the format as well as discarding unwanted elements. Then you application would have to read the vector data and render it on the mobile device.

This is fairly complex to program, you might find open source programs which can do this already and try to use them.

The other way is to use map tiles which are rendered on a server and sent as pictures (usually png). This is what you see on the main site. You can use the tiles rendered by the openstreetmap servers but there is the Tile Usage Policy mentioned by Richard which doesn't allow mass downloading of tiles for offline use. The solution is to set up your own server to render the tiles (or find another source of tiles with a compatible usage policy).

A disadvantage of this is that the tiles take up quite a lot more storage than the vector data so the offline area would be more restricted. Making a program to display map tiles is much easier and uses less processing power on the device, again you might find an already existing open source program which would help.

link

answered 22 Sep '11, 14:07

quantumstate's gravatar image

quantumstate
4401512
accept rate: 30%

Have a look at the OSM wiki about Apple iOS and Android ... there are some apps that are opensource.

Have a look how they get theit OSM derived data and how they display it.

link

answered 21 Sep '11, 18:34

stephan75's gravatar image

stephan75
7.6k235130
accept rate: 6%

Thanks... a lot to be thinking about. Thanks for the clear and concise answers to my somewhat vague questions. Back to the wiki.again - thanks

(22 Sep '11, 22:26) JanCol

thanks... like i say a lot to be thinking about. Need to decide first i guess on vector or png-style (raster, i guess) mapping... again, back to the wiki...

(22 Sep '11, 22:28) JanCol
Your answer
toggle preview

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

Tags:

×14
×3
×1

Asked: 21 Sep '11, 14:38

Seen: 4,312 times

Last updated: 23 Sep '11, 12:23

powered by OSQA