Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS offline map for whole country (OSM)

I tried to prepare the OSM ( *.osm.pbf ) - data of whole Italy for using it offline for an iPhone-app. I need zoom-levels from 7 to 16 because there are a lot of POI all over the country.

This was my starting point. The problem with this solution is the huge file-size of the database.

Is there a open-source solution for vector-based offline map usage for iOS 6/7 ? Or, is it possible to minimize the database file size?

like image 799
Thomas G. Avatar asked Oct 22 '13 08:10

Thomas G.


Video Answer


2 Answers

I've done extensive research on this topic, because my current project demands offline-mapping functionality.

I'll save you a lot of time by pointing you at some of the available open-source tools & projects I've found.

OpenStreetPad - https://github.com/beelsebob/OpenStreetPad/

This project is no longer maintained. However, it reads directly from osm.pbf files and renders the maps successfully. You will have to manage the size of the region you want to map, because this implementation seems to hang and eventually crash if you try to load an entire country into it. I used a 25mb osm.pbf file for a subset of the LA region and it worked great. I think the rendering engine needs optimization.

Mapsforge ported to iOS - https://github.com/medvedNick/Mapsforge_iOS

This one is faster and seems to do a better job rendering the vector data.

libosmscout - http://wiki.openstreetmap.org/wiki/Libosmscout

This is an open-source C++ library for offline rendering and routing with vector maps. It is actively maintained (see their mailing list). I had trouble getting it to compile on Mac OSX but maybe you will have better luck. Seems to be a very capable, powerful, and portable library. They've gotten it running on Fedora, Moblin, Ubuntu, Debian, Windows, Qt, and Mac OSX/iOS.

Good luck. If you achieve some kind of breakthrough using these tools, please come back and share your results. I'm working on the same stuff and I could use pointers myself.

like image 106
BigDan Avatar answered Nov 15 '22 09:11

BigDan


The size of the database heavily depends on what information you want to store. OSM has really a lot of different features of which you will need only a small subset. If you just need POIs then you can filter out all highways, landuses, lakes and rivers, power lines and maybe building outlines. This can be done by dropping all elements with the corresponding tags and as a consequence the resulting database will be much smaller. osmfilter might be of help.

There is a long list of OSM-based applications for iOS of which some are open source. And there is a wiki page about vector tiles. But keep in mind that tiles usually just represent a visual map without containing information about POIs or other features.

like image 45
scai Avatar answered Nov 15 '22 09:11

scai