6

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?

scai
  • 20,297
  • 4
  • 56
  • 72
Thomas G.
  • 1,003
  • 12
  • 27
  • Depending on how much and what data someone actually needs to show on an offline map it might be possible to implement a simple vector based offline map with geojson data files prepared for example in QGIS software without additional libraries as showed here: https://stackoverflow.com/questions/16732637/how-to-highlight-countries-in-ios-maps – Leszek Szary Jul 24 '23 at 16:54

3 Answers3

6

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.

BigDan
  • 176
  • 3
3

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.

scai
  • 20,297
  • 4
  • 56
  • 72
  • Thank you for the informations and links. I am new to the topic of maps especially offline maps. I figured out that the subject is deep and difficult to find a starting point. To drop some features dosen´t seem the right solution for me. The file size was still too big. Could you give me another point to starting with? (maybe vector based) Would it be possible to implement offline routing for future extensions? – Thomas G. Oct 24 '13 at 13:00
  • 1
    It might be better to use a whitelist for tags instead of dropping specific ones (via a blacklist) but this requires some effort. Anyway you have to do some reading in the wiki to get an idea which tags you will need and which you don't, depending in your use case(s). And of course you can use this later for offline routing, depending on which tags you keep and which tags you drop. Other than that I'm not sure what you are exactly trying to ask me. – scai Oct 24 '13 at 16:07
1

This question is a little old, but it turns up in searches for OSM vector maps.

The WhirlyGlobe-Maply toolkit can display vector maps based on OSM (and other) data. It's open source, based on OpenGL ES and very fast. The current version is for iOS with an Android port under development.

There's also a tool chain to help produce vector maps from OSM data. Read here for details.

mousebird
  • 1,029
  • 9
  • 18