Difference between revisions of "Configuration (old)"

From Navit's Wiki
Jump to: navigation, search
(A deeper look at the XML file: till default layout)
(attention, will do cleaning this weeks!)
Line 1: Line 1:
Line 111: Line 113:
* source="demo://" : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source.
* source="demo://" : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source.
Example of code for a Garmin GPS using gpsd on linux, and write track log. The profilename="car" is a choice between car, bike, pedestrian and horse in the standard navit.xml file
Example of code for a Garmin GPS using gpsd on linux, and write track log. The pro
  <vehicle name="Garmin GPS" profilename="car" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xj">
  <!-- Navit can write a tracklog in several formats (gpx, nmea or textfile): -->
  <log type="gpx" attr_types="position_time_iso8601,position_direction,position_speed,profilename,position_radius" data="track_%Y%m%d-%i.gpx" flush_size="1000" flush_time="30"/>
Example of code for using a GPS with an MTK chip on linux, and write track log.
  <vehicle name="MTK GPS" profilename="car" enabled="yes" active="1" source="file://dev/ttyACM0"  color="#0000ff">
  <!-- Navit can write a tracklog in several formats (gpx, nmea or textfile): -->
  <log type="gpx" attr_types="position_time_iso8601,position_direction,position_speed,profilename,position_radius" data="track_%Y%m%d-%i.gpx" flush_size="1000" flush_time="30"/>
Navit automatically starts gdb and displays a back-trace if Navit crashes. This might be useful if you want to get involved with Navit. You can change that behavior by setting this:
<debug name="segv" level="0" />
* level="0" : silence
* level="1" : let navit display a backtrace with gdb (default)
* level="2" : let navit enter an interactive gdb session
Further information can be obtained from the various modules by setting additional debug lines:
<debug name="osd_core" level="1" />
will provide the output from all dbg(1,....) statements in the osd_core module. If you need output from only a specific function in osd_core, then use:
<debug name="osd_core:osd_nav_next_turn_draw" level="1" />
The pattern is module or module:function, depending on how restrictive you want the output to be.
You can also set the debug level globally (for all modules):
<debug name="global" level="1" />
This is the same as using command line option "-d".
==Southern Hemisphere users==
The day/night auto changing layouts will be "reversed" for you. Please change the daylayout to nightlayout and vice versa.
=A deeper look at the XML file=
You can have a look at the navit.dtd file in the navit directory. The basic structure is:
  <plugins>... </plugins>
At the beginning, you will find the <plugins> section. This will be documented later. Leave it alone for now.
Next, you will have your navit instance.
An instance looks like the following :
*A gui definition :
<navit [options]>
*One or more vehicles to track (nmea data source, log file, etc)
<vehicle [options] />
* A mapset, with one or more maps :
<map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map" />
<map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map/smp2.smp" />
* And finally, one or more layouts.
Don't forget the </navit> at the end.
==The navit instance==
The default navit instance looks like this :
<navit center="5031.51 N 735.83 E" zoom="8192" >
<gui type="gtk" />
<graphics type="gtk_drawing_area" />
==The graphic driver (graphics)==
The graphic driver is the subsystem responsible for actually drawing everything on the display. There are several graphic drivers to choose from, however most platforms have a preferred graphic driver.
Commonly used graphic drivers:
* '''android''', only for the [[Android]] port
* '''cocoa''', only for the [[iOS]] port
* '''gtk_drawing_area''', default driver for desktop [[Linux]]. Can be used with the [[GTK GUI]] or the [[internal GUI]].
* '''sdl''', usable with the internal GUI. Can render inside an X window, or direct to the Linux framebuffer, with min [[dependencies]]
* '''win32''', default for the Windows port
Experimental/less maintained drivers:
* '''gd''', rendering using the GD Graphics Library
* '''gtk_gl_ext''', rendering via OpenGL using GtkGLExt (GTK+ OpenGL extension)
* '''opengl''', rendering via OpenGL
* '''qt_qpainter''', usable only with internal gui. Can render inside X window or on top of Qt Palmtop Environment.
<gui type="gtk" />
<graphics type="gtk_drawing_area" />
or for the [[Internal GUI]] (with gtk graphics):
<gui type="internal" />
<graphics type="gtk_drawing_area" />
or for the [[Internal GUI]] (with sdl graphics):
<gui type="internal" />
<graphics type="sdl" />
or for the [[Internal GUI]] (with Qt graphics):
<gui type="internal" />
<graphics type="qt_qpainter" />
or for the internal GUI on Windows:
<gui type="internal" />
<graphics type="win32" />
For the moment don't attempt other gui / graphics combinations.
===Window resolution===
On some graphic drivers the default resolution is 800x600 like sdl.
You may want to change that to the native resolution of your display:
<graphics type="sdl" w="1024" h="600"/>
==The default map view center (center)==
This defines where the map should be centered at startup. Use WGS-84 coordinates.
The form is
center="[D]DMM.xxx N/S [D][D]DMM.yyy E/W"
center="[-][D]D.x[x]... [-][D][D]D.x[x]"
center="[-]0xX [-]0xX"
D are degrees, M are minutes and xxx and yyy are the fractal parts of the minutes.
Use N or S for North / South and E or W for East / West.
For example
center="4744.123 N 913.876 E"
==The Zoom Level (zoom)==
<!-- what does the number represents? -->
It's a power of 2 indicating the starting zoom level.
1 is the lower value, closest to the ground.
You can use almost whatever power of two you want.
Of course, the zoom level can be adjusted at run time :)
You can use almost any value for the gtk gui, but the sdl gui will react better (and the drawings will look nicer) with a lower zoom value. 128 is often a good idea for sdl :
<navit center="5031.51 N 735.83 E" zoom="128" >
==Auto Zoom==
Navit has the ability to auto zoom the map for you based off of the current driving speed. To enable this feature specify in your <navit> tag auto zoom_active="1" to enable or auto zoom_active="0" to disable the feature. Note that by default this option is not in the navit.xml file so you will have to add it.
For example:
<navit center=4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10" autozoom_active="1" pitch="30">
The second to last item the tag auto zoom_active was set to a value of 1 which will enable auto zoom while driving. Note that when this value is specified attempting to use the zoom in and out buttons will not function correctly.
==The initial view (pitch)==
Navit has the capability to display either a 2D map (bird's eye perspective) or a 3D map (some amount of tilt looking to the horizon so more a 2.5D). Navit's default configuration is to startup in the 2D perspective but it is possible to specify that Navit start with a 3D perspective. The amount of tilt is specified by setting the value of pitch.
*0 is bird's eye perspective looking down
*90 is human perspective looking forward
Also note that values closer to 90 will slow down map drawing, because the line of sight gets longer and longer and more objects are seen.
To modify the perspective that Navit starts up with you must modify the <navit> tag that is located near the top of the navit.xml file. Note that in the default install the navit.xml file does not contain the pitch modifier in the navit tag so you might have to add it.
For example:
<navit center=4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="-1" recent_dest="10" autozoom_active="1" pitch="30">
The last item on the line aboves tells Navit to start with a pitch of 30 degrees. The default value of pitch is 20 degrees.
It is also possible to modify the value that Navit will pitch to using the Internal GUI menu option. To do this the <gui> tag must be modified by inserting the pitch value.
For example:
<gui type="internal" fullscreen="1" menubar="0" toolbar="0" statusbar="0" font_size="300" pitch="30"/>
Again, the last item on the line above tells Navit what value of pitch to use when the 3D option is activated through the Internal GUI settings menu.
==Full Screen==
Navit by default starts in a windowed mode. To change this setting add fullscreen="1" to the gui tag.
For example:
<gui type="internal" fullscreen="1" menubar="0" toolbar="0" statusbar="0" font_size="300" pitch="30"/>
The second item in the tag turns on the full screen option on startup. To disable this you can use fullscreen="0".
==The On Screen Display==
It offers you diffrent widgets that the GUI can display.
See [[On Screen Display]]. Some quick examples:
    <osd type="compass" />
    <osd type="eta" />
    <osd type="navigation" />
    <osd type="button" x="632" y="516" command="zoom_in" src="osd_plus.png" />
    <osd type="button" x="716" y="516" command="zoom_out" src="osd_minus.png" />
It is possible to bind keyboard keys to On Screen Display items. This is especially useful for those OSD items which include the <tt>command=</tt> attribute, so that a press of the key will perform that command. The advantage is that, for those devices which don't have a touchscreen, commands can be run (such as zooming in and out) without having to use the trackpad to move the mouse over the correct OSD item. For instructions on implementation, see [[On Screen Display#Keybindings]]
==The Vehicles Definitions==
You can have as many vehicles as you like! It's for example useful to track your friends, etc.
A vehicle definition looks like this:
<vehicle name="Meins" enabled="yes" source="gpsd://localhost" active="1"/>
<vehicle name="Deins" enabled="no" source="file://dev/ttyS0"/>
Here some of the available options:
* '''active''': If set to 1, makes the vehicle the default active one. Routing, view centering and map redraw would be applied to this one by default.
* '''animate''': If set to 1, the cursor will be animated as a moving dotted line, to make it easier to see.
* '''color'''/'''color2''': The color of the cursor is now specified within the cursor tag itself.
* '''enabled''': If set to yes, Navit connects to the vehicle data source and shows the vehicle on the map.
* '''follow''': Make the map follow="n" the vehicle after "n" gps updates (where n=0 means never, or more precise, only when the vehicle leaves the map)
* '''source''' (required): If you don't want to use gpsd you can use the second example which is for a serial gps device.
* '''profilename''': Sets the [[vehicleprofile]] for this vehicle.
Obsolete options:
* '''update''': This will force the map to be recentered at your main cursor's position.
By default, in the [[gtk gui]], the cursor moves onto the map until it reaches a border, then the map will be re-centered. This saves a lot of CPU time, by avoiding to always redraw the map (very useful for small devices like smart phones).
The 3d view of the SDL gui is meant to draw the road as YOU see it when driving, so you need to always recenter the map to your position. So, to get a good tracking, if you're using [[sdl]], you should use this kind of settings :
<vehicle name="My" enabled="no" source="gpsd://localhost" follow="1"/>
===Logging Trips===
To record your trip for Error Reporting or for tracking, you can add a sub-instance "log" to the vehicle. It is possible to add multiple logs.
<log type="nmea" data="track_%Y%m%d%i.nmea" flush_size="1048576" flush_time="900" />
This will give a [[nmea]] log file named YearMonthDaySequencenumber.nmea which will be kept in memory and flushed to disk when it is 1048576 bytes large or the oldest data is older than 900 seconds
<log type="gpx" data="track_%Y%m%d%i.gpx" flush_size="1048576" flush_time="900" />
You can configure what exactly is stored in the [[GPX]] log using the "attr_types" attribute. It contains a comma-separated list of values (make sure not to use any spaces after the commas as this will break parsing and the attribute after the space will be missing).
Values marked with a * denote values that are GPS device dependent and will only be stored if your GPS device actually reports it.
{| style="border-style:solid;border-width:1px;border-color:#aaa;background: #f9f9f9;border-collapse: collapse;font-size: 95%;" border="1" cellpadding="4"
|- align=left
! Attribute type !! Device-specific !! Meaning
| position_time_iso8601 || || Store the current time in ISO8601 format
| position_direction || * || Store the current direction
| position_speed || * || Store the current speed
| profilename || || Saves the ID of the active [[Configuring Navit#The Vehicle Profile|vehicle profile]] with the track points.
| position_radius || * || Stores the estimated position error radius
| position_height || ? || Elevation in meters
| position_sats_used || ? || Satellites used to determine position
| position_hdop || ? || Horizontal dilution of precision
With all options enabled, such as:
    <log type="gpx" data="track_%Y%m%d%i.gpx" flush_size="1048576" flush_time="900" attr_types="position_time_iso8601,position_direction,position_speed,profilename,position_radius,position_height,position_sats_used,position_hdop"/>
a gpx file which looks like the following will be created:
<?xml version='1.0' encoding='UTF-8'?>
<gpx version='1.1' creator='Navit http://navit.sourceforge.net'
    xsi:schemaLocation='http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd'>
<trkpt lat="52.207269" lon="-0.935199">
<trkpt lat="52.207269" lon="-0.935199">
<log type="textfile" data="track.txt" flush_size="0" overwrite="1" />
Will give you a tracklog usable as [[navit map]], which is immediately written to disk and overwritten on navit restart
<log type="binfile" data="track.bin" flush_size="0"/>
Will give you a tracklog usable as [[navit binfile map]], which is immediately written to disk and gets appended on restart. Useful if you want to display your track and your track is longer than an hour, since the binfile format is faster and there is a douglas peucker point reduction algorithm used for older data.
==The Vehicle Profile==
A vehicle profile basically defines the behaviour of the routing. Vehicleprofiles usually are linked to a vehicle section, so switching the "vehicle" (type of mobility) from within Navit, routing also will change its behaviour. This way, it is possible to include steps for pedestrian routing, but to exclude it for bike, horse or car routing. Within the vehicleprofile section, roadprofile sections are used to describe the routing behaviour of different roads. Here's a very basic example:
<vehicleprofile name="bike" flags="0x40000000" flags_forward_mask="0x40000000" flags_reverse_mask="0x40000000" maxspeed_handling="1" route_mode="0">
  <roadprofile item_types="path,track_ground" speed="12" route_weight="5">
  <roadprofile item_types="track_gravelled,track_paved,cycleway,street_service,street_parking_lane,street_0,street_1_city,living_street,street_2_city,street_1_land,street_2_land,street_3_city" speed="25" route_weight="15">
  <roadprofile item_types="roundabout" speed="20" route_weight="10"/>
  <roadprofile item_types="ferry" speed="40" route_weight="40"/>
The speeds are configured in km/h.
The vehicle profile names "car", "bike" and "pedestrian" get translated in the GUI. Others appear as-is from the XML configuration file.
==The mapset==
Navit can read various map formats, and can even show multiple maps the same time. This is done by defining a mapset. Each mapset can have one or more maps. Using the GTK GUI, you can enable or disable specific maps at runtime.
=== Reiseplaner Maps ===
The following example is for the Reiseplaner maps :
  <map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map" />
  <map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map/smp2.smp" />
Here's some more informations about the maps of Reiseplaner :
* DE.map is mandatory. This contains the towns and major roads of Europe
* DE.map/smp2.smp contains the smaller roads for France
* DE.map/smp3.smp contains the smaller roads for Germany
=== OpenStreetMap ===
See [[OpenStreetMap]] for details on how to create a map file that Navit can use from [http://www.openstreetmap.org OpenStreetMap] data. Once you have a suitable file, define a mapset using something like:
  <map type="binfile" enabled="yes" data="/var/navit/maps/uk.bin" />
  <map type="binfile" enabled="yes" data="/var/navit/maps/france.bin" />
Note that there are [[OpenStreetMap#Problems_with_OSM_and_navit_or_navigation_in_general|some limitations]] at present when using OSM data with Navit.
Valid map types:
==The layout==
A layout defines how to render a map. You can have multiple layouts within the <tt>layouts</tt> tag. At startup the first layout in navit.xml will be chosen. The GUI may allow you to change the layout on the fly.
===Custom layouts===
Layouts are fully customisable, from the road colours and widths to size and type of icons to display for specific POIs. The layout is also where the cursor (i.e. the shape which shows where you are) is defined. A number of user-generated layouts and cursor definitions are available from the [[Layout]] wiki page, which can be dropped straight into your navit.xml.
A layout consist of one or more layers which are each a set of rules on how and when to draw certain items. Those rules are called itemgra. The layers are rendered one by one '''in the order they appear in the navit.xml file''', as are the items in each layer. If you can't see an item make sure there is not another one hiding it. If your item is hidden, you can move your item further down in the layout section of the file. This will make navit draw the item on top of previously drawn items ("in front").
Defining an itemgra:
<itemgra item_types="water_poly" order="0-">
  <polygon color="#82c8ea" />
  <polyline color="#5096b8" />
Here the available options:
* item_types: Comma separated list of items
* order: Range for zoom levels.
* speed_range: Range for vehicle speed, useful for cursors.
* angle_range: Range for pitch angle.
* sequence_range: Useful for animated cursors.
Note: An always up to date list of items can be found in navit/item.h within the source code.
Note: A range for order is defined as: "lower_bound-upper_bound".
Possible values for a bound are between 0 and 32767 but not all of them make sense. "-5" is synonym to "0-5" as is "17" to "17-17". "0-" is synonym to "0-32767" and means to always draw the item or to not apply this range as a limiting factor and is the default for not specified options of type range.  "10-" is good for items visible at a zoom level showing an entire city; "17-" is good for items showing when zoomed onto a block.
Note: Meaningful values for order are between 0 and 18.
You can define an item multiple times. Example :
<itemgra item_types="street_route" order="17">
  <polyline color="#0000a0" width="268" />
<itemgra item_types="street_route" order="18">
  <polyline color="#0000a0" width="530" />
Here we define two different widths for the same item depending on the order. We could also have changed it's color.
The poly'''gon''' color defines the color with which the polygon will be filled. Of course, it applies only to polygons, such as water, towns, wood, etc.
The poly'''line''' color defines the color with which the lines will be drawn. If the item is a line, such as a street, it's its color. If the item is a polygon, then it is it's border color.
===Choosing a default layout for navit===
In case you want to make T@H the default layout for navit, used when Navit starts, just move the T@H <layout> tag/section above the other layout sections, e.g before "Car".
Since {{Revision|4342}} Navit supports the <tt>active</tt> attribute inside the layout tag - irrespective of where the layout appears in navit.xml, if <tt>active="1"</tt> that particular layout will become the default.
===Text Size===
Navit has the ability to adjust text sizes for items on the map like street names and town names (and just about everything else with a label) through the navit.xml file. At the moment there is no relative text size adjustment so each tag within the navit.xml file has to be adjusted manually. There is some discussion to add relative text size adjustment at some point in the future.
'''NOTE:''' Ensure you make a backup copy of your navit.xml file before using the method below just in case...
One method to increase text sizes is to open navit.xml in an a text editor and use the "replace" function finding each text_size="xx" and replacing with a new value. For example... to increase all text sizes by 5 do a search for all:
<text text_size="15"/>
and use the replace function inserting:
<text text_size="20"/>
Then, move to the next text size of:
<text text_size="14"/>
and replace it with:
<text text_size="19"/>
Do this in successive order until you reach the smallest text size which should be:
<text text_size="5"/>
which would become
<text text_size="10"/>
'''Remark:'' Note that if you want to enlarge the text size and use the ''find and replace method'' then you will want to start with the largest text size (currently 15) and work your way progressively to smaller text sizes. Do not start with the smaller text sizes and work your way up as you will start replacing text sizes you already changed. If you want to decrease the text size and use the ''find and replace method'' then you will want to start with the smallest text size.
Here is an example script, which is doing the work for you.
use it this way:
# copy the text below in a file called replace_size.py
# copy your working navit.xml to navit.xml.bak
# on command line do
  python replace_size.py /path/to/your/navit.xml.bak > /path/to/your/navit.xml
Now, in /path/to/your/navit.xml the text size is replace by a higher value, as specified below.
You can adjust the values and add some others as you want.
import re
import sys
replace_words = {
f = open(sys.argv[1])
while (line):
for key in replace_words:
if( re.search(key, line) ):
line = line.replace(key,replace_words[key])
sys.stdout.write( line )
line = f.readline()
Also note that there was a bug that did not allow for text sizes greater than 15 to be set. This bug was addressed around Navit SVN-2311 so if you are using an older version you will want to update.
===Font Types===
If you would like to change the default font used for text on the map (such as street names) you can do so by modifying the following tag in the navit.xml file:
<layout name="Car" color="#ffefb7" font="Liberation Sans">
It is important to pick a font that your OS actually supports. For Linux systems if you do not know what font types are supported you can type "fc-list" into a console to get the list. Note that when you do this you will get something like the following list (taken from a Nokia N810 tablet):
NewCourier:style=Bold Italic
Nokia Sans:style=Regular
When editing the layout tag in the navit.xml file you will want to ignore the "style=" tag and just use the font name. So to change to the NewCourier font the tag from above would change the layout tag as follows:
<layout name="Car" color="#ffefb7" font="NewCourier">
===Navit Map items===
For a list of the navit map items (types of POI, types of ways ...), see [[Configuring Navit/map items|map items]]
==Support for XInclude/XPath==
Navit has support for a small subset of XInclude/XPath. Supported is a tag like
<xi:include href="some_file" xpointer="xpointer_stuff" />
You can leave out either href (xi:include refers to the same file it is in then) or xpointer (xi:include then refers the complete file), but not both. The ''href'' attribute refers to a file relative to the current directory. It is suggested to use the complete path, such as ''/home/root/.navit/navit-vehicles.xml''.
href is expanded with wordexp internally, so you can do stuff like:
<xi:include href="$NAVIT_SHAREDIR/maps/*.xml" />
Some examples on the supported syntax:
<xi:include xpointer="xpointer(/config/navit/layout[@name='Car']/layer[@name='points'])" />
references to the XML-Tag "layer" with attribute "name" of value "points" within an XML-Tag "layout" with attribute "name" of value "Car" within an XML-Tag "navit" within an XML-Tag "config".
<config xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/*[name(.)!='navit'])"/>
<navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0">
<xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/navit/*[name(.)!='vehicle'])"/>
Use this as your $HOME/.navit/navit.xml and you will get everything under <config>..</config> except <navit>..</navit> (first xi:include), plus <navit> as specified plus everything from navit within config, except the vehicle definitions (second xi:include).
In addition to providing visual clues of the route to be taken, Navit can also use a variety of speech synthesis software to speak to you.
Essentially, Navit farms out the speech to software which you should have installed on your device. For example, if you have eSpeak installed, you would have the following line in your navit.xml:
    <speech type="cmdline" data="espeak -s 150 -v english_rp %s"/>
Obviously, that's for those who want Navit to speak to them in English, at 150 words per minute. The ''%s'' is filled in by Navit when sent to the speech synthesis software (with something like "Turn left" or whatever is appropriate at the time).
Navit since svn #4459 always attempt to make speech asynchronous and freezes the screen update only in the case it is going to make a new announcement before it end with previous one.  Also it's guaranteed that %s or -prefix%ssuffix is passed as a single argument to external command. Neither adding the &amp;amp; on the command line nor using pipes ("|") is not supported anymore. Quotes do not have any special meaning for speech_cmdline too and are passed to external program as is. If you still need to any of disappeared features, you should use an external wrapper script which can contain anything supported by your shell. A couple of useable wreapper script samples are at the [[Translations]] page.
You may prefer to use flite. The line would be:
    <speech type="cmdline" data="flite -t %s"/>
Also Navit is able to compose phrases if you give it a set of prerecorded samples. So say you have following line in navit.xml
    <speech type="cmdline" data="wavplay %s" sample_dir="/path/to/waves" sample_suffix=".wav" />
Directory /path/to/waves should contain audio files which names end with .wav. The names of the waves must give the complete sentence together. So for "turn right in 300 meters" you need turn.wav, right.wav, in.wav, 300.wav, meters.wav. If file turn_right.wav is present, it will be used even if you have turn.wav and right.wav.
Also you need a program, named in this example wavplay which should play a sequence of wave files given on its command line.
Note that if any file that is needed to compose the complete phrase is missing then Navit will be silent.
By default Navit is trying to announce street names. To disable this feature you can set vocabulary_name and vocabulary_name_systematic to 0 in the speech tag which will specify that the speech synthesizer isn't capable of speaking names. Also there is vocabulary_distances which you can set to 0 so only the minimum set of 1,2,3,4,5,10,25,50,75,100,150,200,250,300,400,500,750 as numbers is used. With these changes, last example will look like this:
    <speech type="cmdline" data="wavplay %s" sample_dir="/path/to/waves" sample_suffix=".wav"
          vocabulary_name="0" vocabulary_name_systematic="0" vocabulary_distances="0" />
See also [[Translations]] and [[FAQ#Navit_speaks.21_But_it.27s_all_English...]].
<!-- Old list of options kept here for quick revert if the new list is found to be inappropriate)-->
=Full List of Options=
This list of options was created based on the navit.dtd and the example navit.xml as of 14.08.08, with subsequent additions.
{|style="border-style:solid;border-width:1px;border-color:#aaa;background: #f9f9f9;border-collapse: collapse;font-size: 95%;" border="1" cellpadding="4"
|config || || required || ||
| || language || optional || locale || Enables manual setting of the locale. For example, <tt>language="en_US"</tt> will force Navit to consider the host device as being setup for USA English, and the town search will automatically revert to towns in the USA.
|navit || || required || || The main container for all configurations. Must contain at least one mapset and layout; exactly one appearance of gui, graphics, tracking, route, navigation and speech; May contain an arbitrary number of vehicle
| || center || required || Coordinates || The format is <tt>[D]DMM.SS[s][s] N/S [D][D]DMM.SS[s][s] E/W</tt> or <tt>[-][D]D.d[d]... [-][D][D]D.d[d]...</tt>
| || zoom || required || integer || Initial zoom level (1 is the closest, no upper limit)
| || tracking || required || 1/0 || Same as Settings -> Rules -> Lock on road
| || cursor || obsolete || 1/0 || Show cursor for current position
| || orientation || required || 0/-1 || Same as Settings -> Rules -> Northing. If orientation is 0, Northing is enabled (map is North oriented). If orientation is -1, Northing is disabled (map is oriented in the direction of travel). With orientation set to 1, you get unexpected results.
| || pitch || optional || 0-359 || Default pitch for 3D enabling the view
| || autozoom_active || optional || 1/0 || Enable Autozoom
| || autozoom_secs || optional || integer || Zoom level for Autozoom, in seconds: Zoom will be adjusted such that the next autozoom_secs seconds of the way ahead are visible, hence 1 is the closest.
| || map_border || optional || integer || To avoid the cursor moving towards the edge of the screen before re-centering, this value defines the number of pixels before any of the edges to trigger re-centering. Works together with ''radius''.
| || radius || optional || integer || Percentage of screen size to offset map from centre when moving. This causes the map to "lead" the vehicle, showing more of where you're going and less of where you've been.
| || recent_dest || ? || integer || It is the number of entries kept in destination.txt
| || timeout || optional || integer || When the user scrolls the map, it stays there. After "timeout" number of GPS updates the map jumps back to the current location of the active vehicle.
| || imperial || optional || 0/1 || When 1, forces Navit to use display and speak in imperial units (miles, feet and miles-per-hour)
|gui || || required || || Contains settings for the user interface. Element is empty
| ||type || required || name  || Selects the user interface: gtk / internal / cegui
| ||menubar || optional || 1/0 || Switches the menubar on/off
| ||menu_on_map_click || optional || 1/0 || Brings up the menu when clicking on the map
| ||toolbar || optional || 1/0 || Switches the toolbar on/off
| ||statusbar || optional || 1/0 || Switches the status bar on/off
| ||skin || optional || name || Selects the skin to use (default or Mineque)
| ||fullscreen || optional || 1/0 || Starts in fullscreen mode
| ||icon_xs || optional || Pixels || The size that extra-small style icons should be scaled to (e.g. coutry flag on town search).
| ||icon_s || optional || Pixels || The size that small style icons should be scaled to (e.g. icons of internal GUI toolbar).
| ||icon_l || optional || Pixels || The size that large style icons should be scaled to (e.g. icons of internal GUI menu).
| ||font_size || optional || Pt fractions || The base size to use for text (e.g. labels of internal GUI menu).
|graphics || || required ||  || Selects graphics
| || type || required || name || Type of graphics to use: gtk_drawing_area / sdl / opengl
|vehicle || || optional ||  || Vehicle definition. May contain a log tag for GPS logging but this is not required.
| ||name || required || name || Name of the vehicle
| ||source || required || device path || Source of gps data. e.g. file://dev/ttyS0 , gpsd://localhost, wince:com1: , ...
| ||baudrate || optional || value || baudrate of the com port of a wince device, e.g. baudrate="57600"
| ||gpsd_query || required || gpsd command || Command to send to gpsd
| ||color || obsolete || #000000 || Color of cursor
| ||color2 || obsolete ||  || Color of optional second cursor inside primary one
| ||animate || obsolete || 1/0  || Shows an animated cursor
| ||enabled || optional || yes/no  || Connect to the data source and show the vehicle on the map
| ||active || optional || 1/0  || Select this vehicle for routing, view centering and map redraw
| ||follow|| optional ||integer  || Specifies how many GPS updates to wait before map is refreshed. A value of zero means vehicle will leave the edge of the map (or the inner edge defined by the ''map_border'' parameter for navit) before the map is refreshed.
| || profilename || required || name  || The vehicle profile (see below) to use for routing and announcements.
|log || || optional ||  || Inside the vehicle tag: Settings for recording a tracklog
| ||enabled || optional || yes/no|| Enables or disables the entry (if set to no, this tag will not do anything)
| ||type || required || Log type || The data format for logging: nmea outputs data as NMEA messages (the data format used by most GPS receivers), gpx outputs GPX XML files (e.g. for upload to OpenStreetMap), textfile creates a text file that can be used as a map (map type=textfile), binfile creates a binary map file (map type=binfile)
| ||data || required || file name|| The name for the log file, with placeholder support: %Y, %m and %d will be replaced by the current year, month and date, respectively, %i will be replaced by a number that is increased to make the file name unique
| ||overwrite || optional || 0/1 || Specifies whether an existing tracklog of the same name will be overwritten or appended to
| ||flush_size || optional || integer || The file is kept in memory and will be committed to disk if the buffer size reaches the limit
| ||flush_time || optional || integer || The file is kept in memory and will be committed to disk at the specified time interval (in seconds)
| ||attr_types|| optional || Comma-delimited list|| For type=gpx: Determines what kind of information will be stored in the log file (if supported by the GPS receiver); available attribute types are position_time_iso8601, position_direction, position_speed, profilename, position_radius
|vehicleprofile || || optional || || Determines the routing and routing announcements
| ||name  || required || name || The name of the vehicle profile, referenced by profilename in the vehicle definition
| ||flags || required || hexadecimal value || The flags (as defined in AF_* in attr.h) which needs to be set to be able to pass this road (see [[vehicleprofileFlags]])
| ||flags_forward_mask||?|| hexadecimal value || The bits the flags_forward_mask has set in addition to flags, a way must not have set in order to be used in forward direction. More technically: the flags of a way are ANDed with this mask, if the route uses the way in forward direction. The result must match flags otherwise the way must not be used. E.g. flags_forward_mask="0x4000000" and flags_forward_mask="0x4000002" means a road may be used in forward direction if it is a ONEWAYREV
| ||flags_reverse_mask||?|| hexadecimal value || same as flags_forward_masks for ways in reverse direction
| ||maxspeed_handling ||?|| 0-2 || 0: Always handle the maxspeed attribute of a street, 1: Only if it restricts the speed, 2: Never. Reason behind this is that a pedestrian doesn't want to travel with 30 km/h when there is a speed limit
| ||route_mode        ||?|| 0-2 || 0: Automatically select between a road route and an offroad route (if the offroad route is shorter than the distance to the next street from the position plus the distance to the next street from the destination), 1: Always use a road route, 2: Always us a offroad route
| || static_speed      ||?|| integer || A speed larger than static_speed in km/h between two GPS updates is a sufficient condition to accept the new GPS position
| || static_distance        ||?|| integer || A distance larger than static_distance in m between two GPS updates is a sufficient condition to accept the new GPS position
|roadprofile ||
| ||item_types    ||?|| || Types for which this roadprofile is valid
| ||speed        ||?|| integer || The speed you actually travelling on that road (used for calculating ETA), in km/h.
| ||route_weight  ||?|| integer || The effective speed used for routing, increase to prefer this road types, decrease to avoid it
| itemgra ||
| ||item_types  ||street_route || text || Describes the street you're supposed to follow. The "order" key specifies zoom level. Width and colors in a polyline tag, see below.
| ||item_types ||selected_line || text || Describes the street you... (I don't know what this is for?). The "order" key specifies zoom level. Width and colors in a polyline tag, see below.
| ||item_types || street_0,street_1_city,street_1_land || text || Describes normal "residential" streets. The "order" key specifies zoom level. Width and colors in a polyline tag, see below.
| ||order ||required || integer || The zoom level this itemgra describes. Can be intervals like 3-5, or 0-, which means always. To make things NOT appear when zoomed out a lot, just remove some of the itemgra tagsets with order=10, order=11 and so on. Higher numbers=more zoom (closer to the ground).
| polyline ||
| || color || required || #nnnnnn || The color of the polyline
| || width || required || integer || The width of the polyline
| polygon ||
| || color || required || #nnnnnn || The color of the polygon '''fill'''. Does not work on roads, as they are not polygons. Great for lawns, lakes, parking lots...
|announcement ||
| ||level          ||?|| integer || The announcement level, 0: Announce "now", 1: Announce "in x meters", 2: Announce "soon"
| ||distance_metric ||?|| integer || The distance before the intersection when the announcement should be made, in meters.
|tracking || || ||  ||  ?
|route || || required ||  || Describes properties of differnt route types. Contains an arbitrary number of speed elements
|speed || || required ||  || Sets speed for a specific type of road
| ||type || required || road type  || Selects type of road
| ||speed || required || integer || Sets speed for this type of road
|navigation || || required ||  || Navigation related settings. Contains an arbitrary number of announce elements. Element is empty
|announce || || required ||  || Settings for navigation announcements
| ||type || required ||  || list of types of roads
| ||level0 || optional || integer || distance for announcement
| ||level1 || optional || integer || distance for announcement
| ||level2 || optional || integer || distance for announcement
| ||unit || required || unit || measurement unit for above values
|speech || || required ||  || Settings for speech output
| ||type || required ||  || how to start speech output, i.e. "cmdline"
| ||data || required ||  || command for speech output, e.g. "spd-say -l de '%s'" or "flite -t '%s'". Add &amp;amp; before the closing " to make speech asynchronous (i.e. not lock-up the GUI during speech)
| ||cps || optional ||  || characters per second. Takes an integer value in a string i.e. cps="15"
|mapset || || required ||  || Defines all maps. Must contain at least one map element.
| ||enabled || required || yes/no || Enable this set of maps. Only one mapset can be enabled (but with any number of maps).
|map || || required ||  || Defines a map. A mapset may contain multiple maps.
| ||type || required || maptype || type of map: binfile is a map converted from OpenStreetMap, garmin is a map file in Garmin format, mg is for Marco Polo Großer Reiseplaner maps, textfile is for POIs in text format (as produced by gpx2navit_txt)
| ||enabled || required ||1/0  || Show map in menu
| ||active || required ||1/0  || Activate this map on startup
| ||data || required || path || Path to mapfile
| ||debug || required ||1/0  || Load in debug mode
|osd || || ? || || OSD item, see [[OSD]]
To be continued.
If the default eSpeak voice sounds too much like an 80's robot to you, you may want to try a mbrola voice. Take a look at http://wiki.navit-project.org/index.php/Speech_output_with_espeak_and_mbrola
<speech type="android" cps="15"/>

Revision as of 19:19, 4 December 2012


Structure of the default navit.xml

Setting up Navit is done by editing a configuration file called "navit.xml".

Now editing this file in a text editor is simple, it's just a plain text XML file. Just remember to turn off 'save UTF8 byte mark' in Preferences or navit may complain very much on the first byte of the file... An xml editor also eases wrinting the file, as it will suggest tags and values as you write.

Navit comes preshipped with an navit.xml that can be stored at various locations (depending on your system):

  • in ~/.navit/navit.xml : e.g : /home/myusername/.navit/navit.xml (This is probably to best place to customize your settings!)
  • in /usr/share/navit or /etc/navit

Navit will look for it in the following order:

  • in the current directory (used on Windows)
  • location supplied as first argument on the command line, e.g.: navit /home/myusername/navittestconfig.xml (Used mainly for development)
  • in the current directory as navit.xml.local (Used mainly for development)

Full List of Options

For the power users, or those who've already read through this guide a few times, a full list of options is available.

Graphical User Interface

Navit provides various graphical user interfaces via its plugin mechanism. For instructions on how to setup each GUI please refer to the Graphics Driver section of this page.

Below are previews of the different guis as well as more information that can be accessed for each GUI.


Example of Internal GUI with OSD

The internal GUI is the most recent GUI and is aimed for touchscreen devices. This GUI is still in heavy development but should be fully functional for most day to day uses of Navit.

  • For a detailed look at how the Internal GUI looks and operates please refer to the Internal GUI guide.
  • For further information on how to modify the OSD elements of the internal GUI please refer to the On Screen Display guide.
  • For a list of Internal GUI layouts that can be applied please refer to the OSD Layouts guide.

To enable this GUI please refer to the Graphics Driver section of this page.

Internal-specific configuration items:

  • menu_on_map_click - "1"-single click on map will switch to gui,"0"-Gui could be switched only by command (see OSD item gui.menu() )
  • a nice way to enable and disable menu_on_map_click interactively is to define an OSD command like

<osd enabled="yes" type="button" x="-70" y="290" command="gui.menu_on_map_click=!gui.menu_on_map_click" src="gui_active.png"/>


Example of GTK GUI

At this point the documentation for the GTK GUI is minimal. More documentation will be placed at the Custom GTK GUI Tutorial.

While being the default GUI in the past, the GTK GUI is still good for desktop use.

  • menubar="0" will disable the menu bar. Useful on devices with small screens
  • toolbar="0" will disable the tool bar. Useful on devices with small screens
  • statusbar="0" will disable the status bar. Useful on devices with small screens

To enable this GUI please refer to the Graphics Driver section of this page.

Settings you might need to change

Starting position

You might want to change the starting position of navit, especially if you are using Navit without a GPS. You can get your coordinates here: http://itouchmap.com/latlong.html

You can change the starting position in navit.xml, here :

<navit gui="..." graphics="..." center="4808 N 1134 E" zoom="128" >

The latitude and longitude are written as multiplied by 100, i.e. you won't see the decimal point. For example, instead of 48.08, enter 4808.


Navit only delivers a default map of Munich (Germany).
At this time Navit has the ability to utilize many different map providers. There are features and limitations for each map so please refer to the list below for more information on these maps and how to apply them.


This is where you will define your gps data source. In genereal NAVIT supports:

  • NMEA plain text GPS (baud rate should be 4800 in most cases)

You can use one of the following:


  • source="serial:COM[:port] baud=115200 parity=N data=8 stop=1" (>build 3650)

Windows Mobile:

  • source="wince:GPD1:" internal GPS driver (configured from WinCE [Remote] GPS Settings)
  • source="wince:COM1:" baudrate="4800" - using the GPS data from the COM port directly, you need to know the actual COM port your GPS unit is connected to.
    • To discover on which port your GPS is, use SirfTECH Tool. It can automatically scan existing serial ports trying different baudrates to detect GPS source.
    • To use a BT GPS it must be configured as outgoing com port and paired, then selected as hardware port in GPS Settings.
    • To start bluetooth on navit startup add bluetooth="yes". When exiting navit, the previous bluetooth state is recovered.


  • source="file:/dev/ttyS0" - /dev/ttyS0 for serial GPS connected to the first serial port
  • source="file:/dev/rfcomm0" - BlueTooth GPS, /dev/rfcomm0 must be configured in /etc/bluetooth/rfcomm.conf
  • source="gpsd://host[:port]" - gpsd://localhost, the default one, will try to connect to gpsd on localhost
  • source="socket:ipaddr:2947:r=1" - connect to gpsd in nmea mode (gpsd versions 2.39 or older)
  • source='socket:ipaddr:2947:?WATCH={"enable":true,"nmea":true};' - connect to gpsd in nmea mode (gpsd versions newer than 2.39)


  • source="socket:ipaddr:post" - socket connection (expects nmea stream)
  • source="gypsy://connectstring" - gypsy
  • source="file:/home/myhome/mynmea.log"  : replay the nmea logfile mynmea.log (Windows it is currently not possible!)
  • source="pipe:/usr/bin/gpspipe -r" - any executable that produces NMEA output - gpsbabel, gpspipe, ...
  • source="demo://" : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source.

Example of code for a Garmin GPS using gpsd on linux, and write track log. The pro