logo separator

[mkgmap-dev] [locator] Separate boundary files

From WanMil wmgcnfg at web.de on Mon Apr 25 18:21:54 BST 2011

I have committed changes to the locator branch which implements the 
usage of separate precompiled splitted boundary files.

How does it work?

* 1st step: Extract the boundary data
Download an osm dump (e.g. the europe extract from geobfabrik).
Extract the boundary data using osmosis:
osmosis --rb europe.osm.pbf -tf accept-ways boundary=admistrative -tf 
accept-relations boundary=administrative --used-node -wx 
europe-boundaries.osm

(Maybe the osmosis parameters must be tuned to get *all* boundary data 
but I haven't investigated very long. Please send proposals how to 
improve it)

* 2nd step: Start mkgmap with additional --createboundsfile option
e.g.
java -jar mkgmap.jar --createboundsfile=europe-boundaries.osm <... your 
other options ...>

Before compiling the common tiles mkgmap reads the europe-boundaries.osm 
file, performs the multipolygon processing on it and saves special 
precompiled boundary tiles to the subdirectory bounds. The subdirectory 
can be changed by adding the new option --boundsdirectory=<directory>

It is possible to precompile whole europe with less then 3GB main 
memory. The europe boundary tiles need around 330MB (bzip2 compressed 
~120MB).

* 3rd step: Use the precompiled boundary files
After precompiling the bounds directory contains several 
"bounds_<lat>_<lon>.bnd" tile files. These are loaded and used 
automatically by the LocationHook. You need to compile the boundary 
tiles once only.
Important: The LocationHook does no longer use the boundary information 
from the tiles. You need the precompiled boundary tiles.


I have decided to go this way because I do not expect that splitter will 
be able to save tiles with complete multipolygons within a foreseeable 
period of time.

WanMil



More information about the mkgmap-dev mailing list