Keeping OsmAnd maps current

OsmAnd has a set of controls for data management where you can search for maps, verify your maps are up to date, etc. But it seems to use the date on the downloads page. And, if you are using the free version, each update eats up one of your ten free downloads.

First Iteration

For a while I was simply going to the downloads page and if the date shown was newer than the last time I’d downloaded the files, I used my browser to download the new. The hassle with this is they don’t set the download file type or file name correctly (all the same name and all with a .php suffix instead of .zip). So I would rename them, unzip them and then copy the individual files to the phone.

Second Iteration

So a shell script was next: Coded into it was a list of desired map files. It would spawn multiple sub-processes to download the various files and unzip them. When all the files were downloaded, it would use adb to push the files to the phone. Much quicker and easier.

And when debugging this I noticed that the map files are updated much more often than the HTML table on the web page shows. So I would run my script every week or two.

Current Iteration

While chasing down something else of interest I noticed a thread on the OsmAnd discussion forum regarding using BTSync to keep maps current.

I’ve associated Bit Torrent with software piracy, and being in the software business for a lot of years had a bad opinion of that whole side of things even though the technology could have some good uses for legitimate software distribution. Because of my opinion, I hadn’t tracked what they were doing and missed the advent of Bit Torrent Sync or BTSync.

Basically, the person who started that thread has setup a script to check for new OsmAnd maps periodically. When there are new maps they are copied to a directory on his server, his server is setup with that directory being a read-only source directory for a BTSync and he has given out the key for setting up a mirror directory on your own machine. And the thread confirmed what I thought: Maps are updated more frequently than advertised. Apparently on or around the 1st, 11th and 21st of each month.

So if you setup BTSync with his key then the directory you designate will get a copy of all the new map files when his script detects new ones are released. So they might be a day late but that is not a big deal. Also on the thread people have posted BTSync ignore file samples so you can get only the files you are interested in.

Finally, there is now a Bit Torrent Sync app in Google’s play store, so the phone can sync itself too. There may be some limitations on this when the phone has KitKat and you have an external SD card but my Galaxy Nexus only simulates SD card storage and it works for me.

To be nice, I’ve setup a machine to have all the North America files and I try to have it online most of the time so it should help in distributing those maps. If I can free up a machine that can be online all the time that has at least 50 GB to dedicate to the cause I’d mirror the whole set of maps.

I don’t have space on the phone for even all of North America, so it is setup to only have the US state maps for states I am likely to be driving in.

This hasn’t been through a full cycle yet so I can’t say I have all the issue identified and but it seems to work.

Bit Torrent Sync

Bit Torrent Sync seems to be flexible enough to allow me to stop using DropBox for my computer to computer file synchronization needs. And it seems the privacy is a lot better. But Bit Torrent Sync is still proprietary and that is annoying.

Once my blinders were off about the existence of this program and what it can do, I decided to do a search for an open source replacement. I haven’t settled on one yet but Syncthing looks interesting. From what I read I am not sure it will work well for me keeping things synchronized when I am traveling after we drop the static IP address. But I’ll probably be playing round with it to see if I can live with its capabilities.

Leave a Reply