I want to write a script to construct an IMG map set of the entire planet that I can use with map source, and that can update any subset of tiles when needed. I would like to get some feedback about the feasibility or limitations of my approach, or a pointer if someone has already done this. The functional specification for the script is:
An initial run of the script would create the IMG tiles for the entire planet. I am considering two approaches:
a) Least preferred but known to work. Download the planet OSM file, split it into tiles, and convert the tiles to IMG in a single run of mkgmap.
b) Most preferred but I don’t know if it works or what routing consequences it would have. It consists of iterating through the tile areas. This could be done using a grid of fixed-sized tiles or using the areas.list file from a previous run of splitter. Each iteration would process a single tile independently of the others, downloading the an OSM file for the individual tile, converting it to IMG using mkgmap, and finally deleting the OSM file for the tile. I do not know if in order to support routing it is absolutely necessary to convert all OSM tiles together or if each OSM tile can be converted individually as I am iterating through the tile areas.
Subsequent runs would take as argument an area to be updated. The script would update all the existing tiles that intersect with the area provided by the user. This stage does not use the planet OSM file or the OSM tiles downloaded in the previous stage. In this stage, the script would iterate through the tile areas that need to be updated. Each iteration would process a single tile independently of the others, downloading the an OSM file for the individual tile, converting it to IMG using mkgmap, and finally deleting the OSM file for the tile.
Avoid the long process of downloading planet OSM
Avoid the long process of splitting the planet OSM
No need to keep huge amount of OSM data around.
Update only the tiles that you are interested in
Will routing across tiles work on individually constructed tiles ?
Possible MapSource issues with this?
Problems when a new way has been updated on adjacent tiles but only one is downloaded ? (I am willing to live with this limitation as long as it doesn’t cause a catastrophic effect such as crashing MapSource or freezing the GPS unit.)
Yep, that works. Could be done in about 24h on a reasonable machine.
Difficult because the inter-tile routing depends on special edge nodes where border crossing ways are. If a way is only slightly moved the inter-tile routing does not work if you don’t update both tiles.
This method that you’re proposing is useful if the user decides which tiles the update. If you want to update individual tiles based on OSM changes in that area, then I thinkk you’re going to find out that you mostly need to update most of the tiles everytime, thus loose the benefits as you described earlier.
Alternatively, why not just download the country extract for your area of interest (which will almost certainly be generated on a daily basis and available from multiple sources), run that through Splitter and generate the Garmin maps with Mkgmap? This is almost or equally fast as updating a few tiles as per your proposal and much simpler to script.
If you need a predefined list of Garmin image areas then you can download them from http://garmin.na1400.info/routable.php (almost at the bottom of that page are links to two KML files, they are updated after each planet split).
Thanks so much for all your help. I’ll take a look at the country extracts. What’s a good source ?
One advantage of my approach is that whenever I add a trail to any of the many parks I visit, I can update the associated tiles in my mapset in just a few minutes. Last night I worked on the script and it seems to fit the purpose. If a way is only slightly moved and inter-tile routing does not work then I think I can leave with that. Usually, I would always download the tiles that cover the entire trail. I am adding a few neat features such as the ability to recompute only tiles that are older than a certain amount of days. This speeds things up even more. I keep a list of the bounding boxes of the areas I visit or update frequently to make the invocation painless.