From Navit's Wiki
Revision as of 13:45, 7 January 2011 by Korrosa (talk | contribs)
Jump to: navigation, search

OSM Layout

Mapnik-style rendering

OSD: Speed Camera

Currently a patch at #702.

  • Provides visual and audible warnings of approaching speed cameras.
  • Uses speed camera data from an external file in IGO8 format: files available from Example IGO8 format shown below:
  • Plans to also use speed camera data in OSM


To use the speed_cam OSD type, the following OSD item must be added to navit.xml. This of course assumes that you have patched navit with the patch at #702:

    <osd enabled="yes" type="speed_cam" w="500" h="40"  x="30" y="350" font_size="450" text_color="#FF0000" announce_on="0" label=" ${distance} | ${camera_type} | ${camera_dir} | ${direction} | ${speed_limit}" path="speed_cam_data.txt" />


Most parts are self explanatory:

  • announce_on is set by default to 1 (i.e. this osd item will announce upcoming cameras with a "Look out! Camera!" warning) if this attribute is not set.
  • label can display the following variables. The values in ${STRING} are replaced with the appropriate number or word when running Navit:
    • distance to the camera - ${distance}
    • type of camera - ${camera_type}. See User:Korrosa#Camera Types for possible types:
    • direction in which the camera operates - ${camera_dir}
      • all
      • single direction
      • both directions
    • direction which the camera is facing, in degrees (0-360, i.e. north, east, south, west etc) - ${direction}
    • the active speed limit which the camera may be enforcing - ${speed_limit}

Data Sources

Currently, the speed_cam OSD looks in the following locations for speed camera data, in the following order. Note that the speed_cam OSD will only use the first data source:

  • IGO8 file defined by the path= attribute in the <osd /> tag
  • speedcam.txt IGO8 file in your default navit directory (usually ~/.navit)
  • Speed camera bin mapfile (see User:Korrosa#Creating camera bin mapfiles) defined in the currently active mapset.

Note that if you use one of the first two options, the cameras will not actually appear on the map, but will still be announced. Only by using a binfile will the cameras appear on the map.

Creating camera bin mapfiles

The following steps will enable you to convert an IGO8 speed camera textfile into a Navit bin mapfile. The advantage is reduced resource usage when using a binfile, and that the cameras will appear on the map.

  • Using, convert the IGO8 file into a standard navit textfile. The script reads its input on standard input and outputs navit textfile on stdout. Use in the following manner:
    perl  < speedcam.txt  > speedcam_navit.txt
  • Copy the resulting speedcam_navit.txt to the /navit/maps folder in the source tree.
  • Issue the following command in the maps folder:
    make speedcam_navit.bin
  • Add the just-created speedcam_navit.bin to your active mapset in navit.xml. For example, having moved the binfile to ~/navit/maps:
    <map type="binfile" enabled="yes" data="~/.navit/maps/speedcam_navit.bin"/>

Next time you start Navit the cameras should appear on the map. If they don't try changing the zoom settings of the tec_common item type in your map layout in navit.xml.

Camera Types

  • None
  • Fix
    • Type: Fixed speed enforcement camera
    • Enforces: Speed
    • Description: Probably the most common type of traffic enforcement camera. Usually located on the side of the road, and uses radar to detect vehicle speed. Can take photos from either the front or the rear. Front facing cameras tend to use IR flash guns, instead of traditional bulb flashes, to ensure that the driver does not get blinded.
    • Suggested English name: Fixed.
  • Traffic lamp
    • Type: Traffic light enforcement camera
    • Enforces: Speed and/or red light (unsure)
    • Description: These cameras seem to be located inside (?) traffic lights. It is unknown whether these are for speed, red light or both.
    • Suggested English name: Traffic light.
  • Red detect
    • Type: Red light enforcement camera
    • Enforces: Red light
    • Description: Located close to traffic light controlled junctions, these cameras will detect if a car has run a red light. Usually, these cameras will face down the flow of traffic, thus take a picture from the rear.
    • Suggested English name: Red light.
  • Section
    • Type: Average speed check camera
    • Enforces: Speed
    • Description: In the UK at least, these cameras are used a lot on motorway roadwork sections. CCTV ANPR cameras are located at strategic locations along the works, and take average speed readings of vehicles by reading their number plates. Nightime use is facilitated through the use of IR lamps.
    • Suggested English name: Avg speed
  • Mobile
    • Type: Mobile speed enforcement camera
    • Enforces: Speed
    • Description: There are many types of mobile cameras: common ones are hand-held cameras, either held by an officer from the police car window, or mounted on a tripod. Other types include those mounted on the police car dashboard or rear parcel shelf, or those which point through windows of special speed camera vans (common in the UK)
    • Suggested English name: Mobile
  • Rail
    • Type: Railway level crossing enforcement camera
    • Enforces: barriers/access
    • Description: Used at railway level crossings, to enforce any barriers or warning lights. It's usually an offence to enter the level crossing once you've been warned not to (however far away the train is), hence the cameras.
    • Suggested English name: Level crossing
  • Traffipax(non persistent)
    • Type: Mobile speed enforcement camera
    • Enforces: Speed (?)
    • Description: Note: this is conjecture at the moment. This seems to be a specific type of mobile speed camera.
    • Suggested English name: Mobile


  • Tags shown in order of appearance in the navit.xml shipped with Navit.
  • Bold values denote default values if attributes are not explicitly specified.
  • Value types:
    • int = integer
    • bool = boolean 1 or 0
    • dbl = double
Navit configuration options
Tag Attribute Units Values Notes Example
center coords DD.dd or Map will be centred at these coordinates on startup. Coordinates are either in decimal degrees (with sign in front to denote N/S or E/W) or decimal minutes with trailing N/S or E/W where appropriate.
Default: 53.13 11.70
center="4808 N 1134 E"
orientation 0 / -1 orientation="0": Map oriented North.
orientation="-1": Map oriented in direction of travel.
This is equivalent to selecting Settings -> Rules -> Northing in the internal gui.
tracking 0 / 1 tracking="1": Vehicle cursor will lock to the roads on the map.
This is equivalent to selecting Settings -> Rules -> Lock on road in the internal gui.
zoom 1 - ∞
zoom="1": Most zoomed in. Upper limit is actually 2097152.
Map will be zoomed in at this level on startup.
autozoom_active 0 / 1 autozoom_active="0": Autozoom disabled.
autozoom_active="1": Autozoom enabled.
autozoom_secs seconds 1 - ∞
Number of seconds of the way ahead to leave visible during autozoom.
In effect, this specifies the zoom level when autozoom is enabled.
autozoom_secs="1" is closest zoom.
This attribute has no effect without autozoom_active="1".
pitch degrees 1 - 359 pitch="0": Bird's-eye view of map.
pitch="20": Map tilted by 20 degrees to give 3D view.
radius percent 1 - 100
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 1 - ∞
Number of entries kept in destination.txt. This text file stores the most recent destinations set by the user in Navit.
Default: ∞
timeout gps updates 1 - ∞
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. (see #653) timeout="5"
graphics Insert inbetween <navit> ... </navit> tags
type gtk_drawing_area
Type of graphics to use for display. graphics="gtk_drawing_area"
gui Insert inbetween <navit> ... </navit> tags
type gtk
Type of user interface to use type="internal"
enabled yes / no Enable this user interface. This attribute enables you to define multiple user interfaces within navit.xml (i.e. multiple <gui> ... </gui> tags), and quickly switch between them by changing the enabled status. enabled="yes"
font_size Pt fractions 1 - ∞ The base text size to use for text and labels in the menus. This only applies when type="internal" font_size="350"
icon_xs pixels 1 - ∞ The size that extra-small style icons should be scaled to (e.g. country flag on town search). This only applies when type="internal" icon_xs="32"
icon_s pixels 1 - ∞ The size that small style icons should be scaled to (e.g. icons of internal GUI toolbar). This only applies when type="internal" icon_s="96"
icon_l pixels 1 - ∞ The size that large style icons should be scaled to (e.g. icons of internal GUI menu). This only applies when type="internal" icon_l="96"
fullscreen 0 / 1 fullscreen="1": Start Navit in fullscreen mode fullscreen="1"
menubar 0 / 1 Toggle display of the menu bar. This only applies when type="gtk" menubar="1"
menu_on_map_click 0 / 1 Toggles the ability to bring up the menu screen when clicking on the map. When using menu_on_map_click="0" it is recommended to use an OSD button with the command, or else you can't get to the menu screen! This only applies when type="internal" menu_on_map_click="0"
toolbar 0 / 1 Toggle display of the toolbar. This only applies when type="gtk" toolbar="1"
statusbar 0 / 1 Toggle display of the status bar. This only applies when type="gtk" statusbar="1"
log Insert inbetween <navit> ... </navit> tags for type="textfile_debug".
Insert inbetween <vehicle> ... </vehicle> tags for all other types.
type nmea
Type of log to output.
type="nmea": outputs data as NMEA messages (the data format used by most GPS receivers).
type="gpx": outputs GPX XML files (e.g. for upload to OpenStreetMap).
type="textfile": creates a text file that can be used as a map within Navit
type="binfile": outputs a binary map file for use within Navit
type="textfile_debug": outputs a debug text file.
enabled yes / no Enable logging. This attribute enables you to define multiple log types within navit.xml (i.e. multiple <log> ... </log> tags), and quickly switch between them by changing the enabled status. enabled="yes"
data filename The name for the logfile. There is support for date and time placeholders:
%Y: Current year
%m: Current month
%d: Current day
%i: Next sequential logfile number (to make the filename unique)
overwrite 0 / 1 Toggle to choose whether an existing tracklog of the same name gets:
overwrite="0": Appended to, or
overwrite="1": overwritten
flush_size bytes 0 - ∞ The file is kept in memory and will be committed to disk if the size reaches the flush_size limit.
flush_size="0": Writes the tracklog to disk immediately.
When used in combination with flush_time, whichever limit is reached first triggers a disk write.
flush_time seconds 0 - ∞ The file is kept in memory and will be committed to disk after flush_time seconds.
flush_time="0": Writes the tracklog to disk immediately.
When used in combination with flush_size, whichever limit is reached first triggers a disk write.
attr_types position_time_iso8601
Comma-separated list which determines what information will be stored in the log file (in addition to the position, and only if supported by the GPS receiver). This only applies when type="gpx"
See Configuring_Navit#Logging_Trips for descriptions of each type.
osd Insert inbetween <navit> ... </navit> tags.
See OSD for comprehensive information on on-screen display settings.
vehicle Insert inbetween <navit> ... </navit> tags.
name vehiclename Name of the vehicle being defined. This can be any name you like, but it's usually best to provide descriptive names, perhaps depending on the gps source, or the type of vehicle. name="Car gpsd"
profilename profilename The name of the vehicle profile (see below) to use for routing and announcements for this vehicle. profilename="car"
source Source of GPS data. See Configuring_Navit#Vehicle for the available options. source="gpsd://localhost"
active 0 / 1 Makes the vehicle the active vehicle in Navit - i.e. all its options are used for routing, view centering and map redraws. Note that a vehicle must be enabled="yes" before it can be made active="1". active="1"
baudrate baud rate 0 - ∞ Baudrate of the com port of a WinCE device. Required if source="wince:COMx:" (where x is the COM port of the gps device). The baud rate should be 4800 in most cases. baudrate="4800"
enabled yes / no Enable the vehicle. This attribute enables you to define multiple vehicles within navit.xml (i.e. multiple <vehicle> ... </vehicle> tags), and quickly switch between them by changing the enabled status or by using the menu options within Navit.
If there is no enabled= tag, the vehicle is automatically enabled.
follow 0 - ∞ Specifies how many GPS updates to wait before map is refreshed. A value of zero means vehicle will leave the edge of the map before the map is refreshed. follow="1"
gpsd_query gpsd query Command to send to gpsd. Required if source="gpsd://localhost", otherwise this is not used.
The string used in the example is sufficient for use in Navit.
tracking Insert inbetween <navit> ... </navit> tags.
cdf_histsize metres 0 - ∞ Cumulative displacement filter. Currently not used by Navit. See [1] for what it would do. cdf_histsize="4"
vehicleprofile Insert inbetween <navit> ... </navit> tags.
name profilename The name of the vehicle profile. This name is used by the profilename attribute inside the vehicle tag. name="car"
flags hex value The flags (as defined in AF_* in attr.h) which needs to be set to be able to pass this road. See VehicleprofileFlags for a comprehensive list of bit values. flags="0x4000000"
flags_forward_mask hex 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 (See VehicleprofileFlags). flags_forward_mask="0x40000000"
flags_reverse_mask hex value Identical to flags_forward_mask for ways in the reverse direction. flags_reverse_mask="0x40000000"
maxspeed_handling 0 - 2 maxspeed_handling="0": Always handle the maxspeed attribute of a street.
maxspeed_handling="1": Only handle the maxspeed attribute of a street if it restricts the speed.
maxspeed_handling="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 route_mode="0": Automatically select between an on-road route and an off-road route (if the off-0road route is shorter than the distance to the next street from the current position plus the distance to the next street from the destination).
route_mode="1": Always use an on-road route.
route_mode="2":: Always us an off-road route
static_speed km/h 0 - ∞ If the speed between positions from two gps updates is larger than static_speed Navit will accept the new position. static_speed="5"
static_distance metres 0 - ∞ If the distance between positions from two gps updates is larger than static_distance Navit will accept the new position. static_distance="25"
roadprofile Insert inbetween <vehicleprofile> ... </vehicleprofile> tags.
item_types Types of ways for which this roadprofile is valid. Way types can be found in FIXME. item_types="steps"
route_weight km/h 0 - ∞ The weighting which the routing algorithm should give this road type. A large route_weight will force the routing algorithm to choose that road type over others when calculating a route. This value is also used to calculate the route time remaining IF maxspeed_handling="2". route_weight="150"
speed km/h 0 - ∞ ns. speed="50"
maxspeed km/h 0 - ∞ When driving, Navit will use the maxspeed of the road type to inform the driver of the current speed limit using the speed_warner. maxspeed will only be used if there is no OSM speed data for that road. This data is not used for routing calculations. maxspeed="50"
announcement Insert inbetween <roadprofile> ... </roadprofile> tags.
level 0, 1, 2 Type of oral announcement to make. For example, level="2" means an announcement such as "Turn left soon" will be made. level="0"
distance_metric metres 0 - ∞ Distance from the upcoming manoeuvre to perform the announcement. distance_metric="25"


Drafting complete re-write of the OpenStreetMap page


Wiki Index

Attempting to create a sorted/obvious wiki index, or wiki map