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 convert OSM xml files to Navit textfiles using maptool. This is only recommended for small OSM areas, as rendering a large textfile will slow Navit down. To convert, execute something similar to the following:
bzcat my_downloaded_map.osm.bz2 | maptool -D > navit_textfile_map.txt
Creating a binfile Map out of it
TODO: osm2navit could do this (using -p /path/to/libmap_textfile.so); find out if there's a way using maptool as well.