logo separator

More flexibility in style files - style changes required!

22
Dec

Since r2906 there are some important changes in the style processing which gives the style developer more control about converting OSM elements into the Garmin map elements. As a benefit the routing network is up to 25% smaller which results in faster route calculation and slightly smaller img files.

Changes in the style system:

  • Styles can now have a <finalize> block. This block is executed for each element if an element style definition matches. The finalize block must contain actions only. This is sometimes useful for general rules and to assign the numerous mkgmap:* tags.
  • The four labels to pois/lines/roads/polygons are no longer assigned automatically. They must be assigned using the name and addlabel function. This also means that ref tags are no longer used as labels automatically.
  • Access restrictions of roads are now defined by setting special mkgmap:* access tags (mkgmap:car, mkgmap:foot, mkgmap:bicycle, mkgmap:truck, mkgmap:bus, mkgmap:taxi, mkgmap:emergency, mkgmap:delivery). Roads are blocked for a specific vehicle type if the mkgmap:<type> is set to the value no. The new addaccess and setaccess actions help to assign all values at once.
     Example:
     highway=motorway { set mkgmap:foot=no }
     This rule blocks access of pedestrians to motorways.
    
  • mkgmap:carpool does no longer automatically set all access restrictions. In the trunk mkgmap:carpool=yes lead to set all access restrictions to no except emergency, bus and carpool. It is not fully clear if the bit toggled by mkgmap really controls if a road has a carpool lane or not. So use it with caution.
  • The road speed is no longer automatically calculated using the maxspeed tag. New style functions maxspeedkmh() and maxspeedmph() allow to perform the same by setting the mkgmap:road-speed-class tag. Due to this change the --ignore-maxspeeds option is superfluous and has been removed.

The changes listed above require a change of all style files. But there are three new include files (inc/compat_points, inc/compat_lines, inc/compat_polygons) which ensure compatibility to pre-r2906 releases. They need to be added to the new finalize section.

Example lines file:

 ...
 boundary=political [0x1c resolution 19]
 
 include 'inc/water_lines';
 include 'inc/contour_lines';
 
 # add the following lines to your lines file
 <finalize>
 include 'inc/compat_lines'; 

Please refer also to the style manual.

Posted by wanmil on 22 Dec 2013

Latest commits

  • mkgmap-r4286 mdr5.patch by Ticker Berkin:.
    16 apr 2019
  • mkgmap-r4285 add tag mkgmap:way-length for each POI generated from a line when option --add-pois-to-lines is used. It gives the way length ....
    07 apr 2019
  • mkgmap-r4284 let test-map:all-elements set the transparent flag, use 0x1b instead of 0x51 for background.
    27 mar 2019
  • mkgmap-r4283 document special case with relative path for option input-file given in a config file like template.args.
    08 mar 2019
  • mkgmap-r4282 fix problem introduced with r4278: --remove-ovm-work-files stopped to work when --output-dir option is used to specify a different directory.
    04 mar 2019
See more...