To display maps on Rana, you will need to copy a set of binary map files onto the device, and unzip them into the rana/data/tiledata directory
Maps that you can download
- Maps of the UK available at http://dev.openstreetmap.org/~ojw/tiledata/v2/
- Maps of Germany at http://db0smg.afug.uni-goettingen.de/~mkleider/tiledata2/
Generating your own maps
To generate a set of maps from an OSM file, download the tiledata2 program:
Create the necessary folders if they do not exist
python initialParse.py < yourOsmFile.osm
bzcat yourOsmFile.osm.bz2 | python initialParse.py
For proper UTF-8 handling the patch posted at Talk:Rana works. The important part is
- string = str(string) + string = string.encode('utf-8')
You may need to rm data/nodes.dat after unsuccessful runs.
FIXME: how are places.txt generated? initialParse.py does not seem to generate them.
Once you have generated maps (or especially if you regularly generate maps), please share them by posting them on a website somewhere and adding a URL to this page.
Map file format
Files are numbered according to the zoom-14 tile they contain, e.g. rana/data/tiledata/127_84/8185_5448.bin would contain the area around Buckingham Palace
For details of the binary file format, see tiledata2/binary file format
Customising the rendering
Currently there is only one map style available, and it's coded into:
Look for the setupStyles() function
Why vector maps?
Vector maps are currently used in preference to downloading map images from the web, for various reasons:
- Can render lots of zoom levels from one dataset
- Can use same data for routing
- Can change the rendering on-the-fly (e.g. to make your current mode of transport the most highlighted)
- Different needs on mobile devices to PCs:
- Need higher contrast than web-maps
- Higher resolution screen, and viewed when moving, both mean wider lines needed
- Useful to have yellow-on-black and similar for viewing in sunlight
See Rana/User guide for running the program once it's installed