OK, here comes the first part of the howto:
How To Use OSM Tiles Offline with uNav
The app for UbuntuTouch "uNav" works only with Internet connection when presenting maps and locations. Sometimes Internet is not reliable or over data mobile even expensive and the idea to workaround is having the maps' tiles prefetched and stored in the Ubuntu phone. Here is the tool chain so solve this.
- Prefetching OSM tiles for a given area of interest and
There is a C-written tool 'osmtiles' to be fetched an compiled
on your Linux or FreeBSD workstation: http://www.millions.ca/~stacy/osmtiles.tgz
Compilation is simple (see its README):
tar xzf osmtiles.tgz
cc -o osmtiles osmtiles.c -lm
The tool 'osmtiles' allows to make a list of all OSM tiles of a given GPS coordinates of an area, for example:
osmtiles -z 9 -Z 18 \
23.178555 -82.462692 \
23.050039 -82.288628 \
-z 9 and
-Z 18 give the nivel of the tiles, from 9 to 18. The above region
(23.178555 -82.462692) x
(23.050039 -82.288628) are the GPS coordinates of a rectangle of the capital of Cuba, Havana. The output of the tool is a list file like this:
Some ~18.000 lines, i.e. tiles to fetch. This list is stored for fetch (and later updates) in a file, let's say havana.txt. I have a bunch of such files for the places I visit.
Based on this list I have a shell script which in principle does for any of the files in the list:
while read name ; do
fetch the MD5 sum from the server for the file http://tile.openstreetmap.org/$name
if the MD5 is different from what I have
fetch the file http://tile.openstreetmap.org/$name
done < havana.txt
This way, later on updates, only modified tiles will be fetched.
I can share this script, no problem, if you promise not to blame
me, but send patches for it.
Next step is making, again based on the file of the place to visit, a tar archive:
tar --files-from=../Havana.lst -czf ../Havana.tgz
ls -lh ../Havana.tgz
-rw-r--r-- 1 guru wheel 93M 24 may. 16:58 ../Havana.tgz
i.e. such a file is around 100 MByte in size.
Move these file(s) to the phone with SCP or ADB and unpack them on the SD card to some directory which will later be served by a small Python web server.
- The modifications in the phone
(TO BE CONTINUED)