Apart from the various maps format it can read, NavIt also supports its own map format. This is useful for converting some datas sources (gpx, OSM) into something NavIt can read without too much work. A Example is given there Other maps
You can define polygons/polylines and points.
Polygons/Polylines are specified as follows:
type=<any type from item_def.h> attr1=xxx attr2="ab cd" coordinate1 coordinate2 coordinate3
coordinate might be in the following formats:
DDMM.MMMM N/S DDMM.MMMM E/W 0xXXX 0xXXX (for M&G mercator projection) [-]dd.dddd [-]dd.dddd
Others may be implemented by expanding coord_parse in coord.c If you want to have points after polylines/polygons, you have to add an empty line after the polys Then:
coordinate type=<any type from item_def.h> attr1=xxx attr2="ab cd"
and so on, every line a point
You can also mix polys and points:
type=<any type from item_def.h> attr1=xxx attr2="ab cd" coordinate1 type=<any type from item_def.h> attr1=xxx attr2="ab cd" coordinate2 type=<any type from item_def.h> attr1=xxx attr2="ab cd" coordinate3 type=<any type from item_def.h> attr1=xxx attr2="ab cd"
Confusing? Here's a sample :)
type=rail debug="way_id=2953991 railway='rail' " 4821.199248 N 1056.437366 E 4821.194591 N 1056.596736 E type=rail debug="way_id=2953991 railway='rail' " 4821.194591 N 1056.596736 E 4821.173691 N 1056.880243 E
Or here an example with decimal coordinates :
type=image label=/image/raster001.jpg debug="raster001" 0.02527076695 47.22659264 0.09127025553 47.22659264 0.02527076695 47.27285604
The following sample define two segments used for a railway. You will notice that the second coordinates of the first item and the first coordinate of the second items are the same, to ensure a good overlapping. This is not necessary, but that way it ensures a consistent drawing.
For a list of usable types see Item_def.h
Creating it out of an osm map
You can create a textfile map from the sample map with the following command:
bzcat maps/osm_bbox_11.3,47.9,11.7,48.2.osm.bz2 | maptool -D >maps/munich.txt
Be warned that it will be quite slow.
Creating a binfile Map out of it
A textfile will get slow soon, because of the unstructured data and the big parsing overhead. But one could create a binfile map out of it:
osm2navit -p /path/to/libmap_textfile.so -m textfile.txt binfile.bin
Creates a binfile map (binfile.bin) out of a textfile map (textfile.txt). You have to specify the correct path to libmap_textfile.so with -p of course.