Tunnel Extrapolation

From Navit's Wiki
Revision as of 16:46, 5 July 2011 by Antenna (talk | contribs) (how to use)
Jump to: navigation, search

description

Tunnel extrapolation is an extrapolation function which calculates with the last available speed information once the gps signal is lost and if a tunnel flag is set within your openstreetmaps map.

how to use

To use tunnel extrapolation you need to patch osm.c by copying the three highlighted lines at the right place:

	  if (! strcmp(k,"hazmat")) {
	   	 flags[access_value(v)] |= AF_DANGEROUS_GOODS;
		 level=5;
 	  }
          if (! strcmp(k,"tunnel") && ! strcmp(v,"1")) {
                  flags[0] |= AF_UNDERGROUND;
          }
	  if (! strcmp(k,"note"))
		  level=5;
	  if (! strcmp(k,"name")) {
		  attr_strings_save(attr_string_label, v); 
		  level=5;


Also, you need to add "tunnel_extrapolation="12"" to <tracking ...>. You may need to lower this value, if the cursor runs ahead your position or vice versa, if it lags behind you. 12 stands for 1.2s extrapolation per gps rate.

Note, that this will only work if you processed your own maps with maptool and the tunnel is yet marked as one in openstreetmap as well (it's not? Well, go ahead!)! This article is going to help you to get your own map: http://wiki.navit-project.org/index.php/OpenStreetMap#From_.bz2


This feature will be added to svn if it has been tested with success.