Note to readers: this post is primarily intended for people with good knowledge of the Garmin map requirements and tools.
One of my goals with OSM is to provide a userfriendly way for people to create their own Garmin maps. The garmin.openstreetmap.nl website is the first version of this idea but it has drawbacks, amoung which a few big ones:
- Unable to install more than one map from this same website (without using 3rd party tools)
- Precompiled tiles don’t allow redically different end-usage (e.g. my generic routing tiles cannot serve as source for the specialist cycle maps from user Ligfietser)
- A few sponsored servers need to host every personalized map in every flavour.
Now I’m trying to work around these key issues and this is what I have in mind:
In short
The user selects the tiles of interest through an OpenLayers interface similar as now. The user also provides the preferred product ID, mapname, stylesheet, TYP and all the other relevant Garmin specific options. After that the tiles are downloaded from a server in raw OSM format, processed on the user pc into a map and installed.
A bit longer
Because most users are still Windows users I figured that an NSIS installer might do the job good enough (I previously thought about developing a Java application that would do all of the above, but it’s much more work I reckon). I haven’t found a browser plugin for NSIS so the user has to use the pc’s browser to select the tiles and download a metalink and feed it to NSIS, but everything else can be handled in NSIS itself (afaik). NSIS accepts the Garmin map options, a list of tiles to download from one of the servers, proceeds to download the files, then use Mkgmap to process the tiles into the requested map and add the registry keys for MapSource.
The metalink for a map containing two tiles would look something like this:
<?xml version="1.0" encoding="UTF-8" ?>
<metalink version="3.0" xmlns="http://metalinker.org">
<files>
<file name="63240004.osm.7z">
<verification>
<hash type="md5">f6a0e19d81311b8916e0413c551603b2</hash>
<hash type="sha1">780c6d79d78f4546c765f2e11b03287bad8cdd1a</hash>
</verification>
<resources>
<url type="http" location="nl" preference="50">http://planetosm.oxilion.nl/garmin/routable/01-04-2012/63240004.osm.7z</url>
<url type="http" location="de" preference="50">http://osm.pleiades.uni-wuppertal.de/garmin/routable/01-04-2012/63240004.osm.7z</url>
</resources>
</file>
<file name="63240032.osm.7z">
<verification>
<hash type="md5">faacb525068bfd6bdc382263f4a9213c</hash>
<hash type="sha1">3ea6b486aba5e7ef1510bde12b30a8a6612c9518</hash>
</verification>
<resources>
<url type="http" location="nl" preference="50">http://planetosm.oxilion.nl/garmin/routable/01-04-2012/63240032.osm.7z</url>
<url type="http" location="de" preference="50">http://osm.pleiades.uni-wuppertal.de/garmin/routable/01-04-2012/63240032.osm.7z</url>
</resources>
</file>
</files>
</metalink>
(In this example the OSM files are compressed with 7z which gives a great compression ratio).
With a bit of careful implementing I think this installer could be used by many map providers (not only mine). In this case, all one has to do is providing a definition of the tiles in OSM format (sha1/md5 sums, tilename, download location) and stylesheet and/or TYP file.
NSIS is able to contain Mkgmap, to detect if Java is installed and even install Java when it’s missing (after asking permission ofcourse).
So, how about the benefits?
- Using raw OSM source files allows users to generate specialty maps using (and learning to use) one installer.
- Have many different specialty maps installed simultaneously.
- Reduce the CPU expensive combining and compressing and require much less storage on the server by offloading these to the end-user.
- Instant map download and install procedure, instead of having to wait for the server and the email to arrive.
One obvious drawback: I still need to upload the precompiled tiles to the server and create custom maps there for Mac OSX, Linux etc. users because the NSIS installer doesn’t work on non-Windows operating systems. This means I have to upload the precompiled tils in img format as well as the OSM source files.
What do you think?
Before I spend a lot of time on this, I would like to hear what you think of this. Will it work? Did I miss something? Ideas? Tips? Is it a stupid idea?