Quick iPhone app for offline traveling

Offline traveling may well be a neologism. The fact is that I am about to set off for a 2 week travel to the South of Italy. Now, I will bring my iPod touch with me, but it will be of limited use, since it has no 3G capability, and anyway 3G roaming is expensive; furthermore it is not always available as soon as you get away from the most beaten track.

Truly Sad. But, I did not want to do without it and the help it can offer when you are looking for your car route, for an hotel nearby, or for information about the place you are going to visit. An ipod/iphone is a great tool where you are traveling with all the information that is available on the web. So I decided to quickly hack a small app packaging:

  • information from the local Tourist Offices about places, events, and accommodations;
  • the wikipedia wealth of historical, geographical, tourist information;
  • a route map.

Main requirement was that this all could work offline. It was fun, the hardest part being downloading the wikipedia portals about Basilicata and Puglia, without also downloading the whole wikipedia, and the most exciting part integrating an offline map.

wget-ting Wikipedia

Downloading the wikipedia for offline viewing is not an easy task, due to its ramification and to the lack of any kind of URL-based structuring of its information. So, eventually you end up downloading much more information than you really want. There are some tricks that you can do to improve filtering of wikipedia pages, specifically, you can skip all “index.php?” pages and all “File:” pages; I found that the following wget command worked pretty well for me:

wget -R "*index.php*.*,*File*.*" -D "locahost,it.wikipedia.org,upload.wikimedia.org" --random-wait -E -r -p -e robots=off -U mozilla -l1 -p --convert-links -H -nd -nc http://...

it produced 3000 files, including pictures, perfectly browsable offline. You can see that I was interested just in the information available on the main portal pages and on its immediate offsprings. Also including the “File:” pages would have produced almost 20 thousands files.

Route Map

I found a very good guide about embedding an offline map into your iPhone app at this site.

Getting “downloadosmtiles.pl” to download a map from openstreetmap was a breeze, as well as converting the downloaded tiles by means of map2sqllite.

What came next, i.e., compiling route-me and linking it to my app, was also a snap, but due to the fact that the above page was a bit outdated, the process felt a bit clumsier. It happens anyway that things are easier than what you can read there, so in the end, I had no problem at all. It seems that the latest “route-me” from github does already include all the changes that you are asked to do on the gisnotes page, except for commenting out the assert in the “setTileSource” method in “RMMapContents.m” file.

Integrating the “WebMap” view is also very easy if you have a look at the RouteMeSampleMapDBOffline sample.


Copyright © Labs Ramblings

Built on Notes Blog by TDH
Powered by WordPress

That's it - back to the top of page!