:language: mkgmap

== mkgmap internal tags ==
There are lots of tags prefixed with +mkgmap:+. Some of them need to be set in the
style file to set specific attributes of the Garmin map elements, e.g.  
access restrictions, labels, attributes required for address search etc.
Others are added to the OSM elements by mkgmap so that they can be evaluted in
the style files to change the processing. 
 
=== Tags evaluated by mkgmap ===
These tags need to be set within the style file to set specific attributes of 
the Garmin map elements.

[source]
----
  highway=* & (bicycle=no | bicycle=private) { set mkgmap:bicycle='no' }
----
This rule defines that the road cannot be used by bicycles.

// see [[Mkgmap/help/Tags]]

.Tags for routable roads
[cols="4,6,3,7",options="header"]
|=========================================================
| Attribute   | mkgmap tag     | Example | Notes
| Labels      | +mkgmap:label:1+ + 
+mkgmap:label:2+ + 
+mkgmap:label:3+ + 
+mkgmap:label:4+ | Eastern Avenue +
A112 | Usually only the first label is displayed. On some units the second label of roads is displayed as routing instruction. All labels are used for address search. 
| Country     | +mkgmap:country+ | GBR | Three letter ISO code, e.g. for GBR United Kingdom
| Region      | +mkgmap:region+  | London Borough of Waltham Forest | The regions name. Useful if there are multiple cities with the same name.
| City        | +mkgmap:city+    | London |
| Street      | +mkgmap:street+  | High Road Leyton | This value is used by house number search to match the +addr:street+ tag of an OSM element with house number to the corresponding road. It must be set so that house number search is working.
| Zipcode     | +mkgmap:postal_code+ |  E10 5NA |
| Access restrictions | +mkgmap:foot+ +
+mkgmap:bicycle+ +
+mkgmap:car+ +
+mkgmap:taxi+ +
+mkgmap:truck+ +
+mkgmap:bus+ +
+mkgmap:emergency+ +
+mkgmap:delivery+  | no | These tags are evaluated for routable lines (roads) only. By default access for a specific vehicle type is allowed. Only in case the value of the tag is _no_ access is blocked for the given type.  
| Throughroute | +mkgmap:throughroute+   | no | If this tag is set to _no_ routing is allowed on this road only if the start or end point lies on the road.
| Carpool lane | +mkgmap:carpool+   | yes | If this tag is set to _yes_ the road is marked to have a carpool lane. This does not seem to work on all units.
| Toll road | +mkgmap:toll+   | yes | If this tag is set to _yes_ the road can be used only when paying a specific toll.
| Unpaved | +mkgmap:unpaved+   | yes | If this tag is set to _yes_ the road is marked to be unpaved. Some units can avoid unpaved roads.
| Ferry | +mkgmap:ferry+   | yes | If this tag is set to _yes_ the line is marked to be a ferry line. Some units can avoid ferry lines.
| Road speed | +mkgmap:road-speed-class+   | 2 | A value between 0 and 7. Overrides the +road_speed+ definition in the element type definition if this tag is set.
| Road speed modifier | +mkgmap:road-speed+   | +1 | Modifies the road speed class by the given value. In case the value is prefixed with + or - the road speed class is modified. In case the value does not start with + or - the road speed class value of the element type definition is overriden. 
| Road speed limiters | +mkgmap:road-speed-min+ +
 +mkgmap:road-speed-max+  | 5 | Defines the minimum/maximum road speed class. This can be used to limit the modification of the road speed class (+mkgmap:road-speed+). 
| Road class | +mkgmap:road-class+   | -1 | Modifies the road class defined in the element type definition. In case the value is prefixed with + or - the road class is modified. In case the value does not start with + or - the road class value of the element type definition is overriden. 
| Road class limiters | +mkgmap:road-class-min+ +
 +mkgmap:road-class-max+  | 2 | Defines the minimum/maximum road class. This can be used to limit the modification of the road class (+mkgmap:road-class+). 
|=========================================================

.Tags that control the treatment of roads
[cols="8,7,5",options="header"]
|=========================================================
| Tag | Description     | Required mkgmap option
| +mkgmap:way-has-pois+  | +true+ for ways that have at least one point with a tag +access=\*+, +barrier=\*+, or +highway=*+ | 'link-pois-to-ways'
| +mkgmap:dead-end-check+  | Set to +false+ to disable the dead end check for a specific way | 'report-dead-ends'
| +mkgmap:flare-check+  | Set to +true+ to force the flare check for a specific way, set to +false+ to disable it | 'check-roundabout-flares'
| +mkgmap:dir-check+  | Set to +false+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
| +mkgmap:no-dir-check+  | Set to +true+ to tell mkgmap to ignore the way when checking roundabouts for direction | 'check-roundabouts'
| +mkgmap:synthesised+  | Set to +true+ to tell mkgmap that this is an additional way created using the continue statement in an action block and that it should be excluded from checks | 'check-roundabouts', 'check-roundabout-flares'
| +mkgmap:set_unconnected_type+  | Set to +none+ to remove unconected roads from the map once that all roads are known, or to a valid line type if you want a normal line instead of a road. Works also with overlay lines for the same way. |
| +mkgmap:set_semi_connected_type+  | Like mkgmap:set_unconnected_type, but matches for roads with exactly one connection to other roads |


|=========================================================

 
.POI address tags
[options="header"]
|=========================================================
| Attribute   | mkgmap tag     | Example | Notes
| Name        | +mkgmap:label:1+ +
+mkgmap:label:2+ +
+mkgmap:label:3+ +
+mkgmap:label:4+ | Pizza Express | Names of the POI
| Country     | +mkgmap:country+ | GBR | Three letter ISO code, e.g. for GBR United Kingdom
| Region      | +mkgmap:region+  | Nottinghamshire | The regions name. Useful if there are multiple cities with the same name.
| City        | +mkgmap:city+    | Nottingham |
| Street      | +mkgmap:street+  | King Street |
| Housenumber | +mkgmap:housenumber+ | 20 |
| Zipcode     | +mkgmap:postal_code+ | NG1 2AS |
| Phone       | +mkgmap:phone+   | +44 115 999999 | Phone number in any format
|=========================================================

TIP: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3[Wikipedia] has a list of all ISO 3166-1 alpha 3 codes
 
=== Tags added by mkgmap ===
Some tags are added by mkgmap to indicate some property calculated by mkgmap.

[source]
----
 mkgmap:admin_level2=* { add mkgmap:country='${mkgmap:admin_level2}' }
---- 
The tag +mkgmap:admin_level2+ is added to each OSM element if the 'bounds' option is set. In the rule above it 
is used to assign the country location.

.Tags added by mkgmap
[options="header"]
|=========================================================
| Tag | Description     | Required mkgmap option
| +mkgmap:admin_level2+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=2+ the element is located in | 'bounds'    
| +mkgmap:admin_level3+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=3+ the element is located in | 'bounds'    
| +mkgmap:admin_level4+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=4+ the element is located in | 'bounds'    
| +mkgmap:admin_level5+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=5+ the element is located in | 'bounds'    
| +mkgmap:admin_level6+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=6+ the element is located in | 'bounds'    
| +mkgmap:admin_level7+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=7+ the element is located in | 'bounds'    
| +mkgmap:admin_level8+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=8+ the element is located in | 'bounds'    
| +mkgmap:admin_level9+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=9+ the element is located in | 'bounds'    
| +mkgmap:admin_level10+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=10+ the element is located in | 'bounds'    
| +mkgmap:admin_level11+  | Name of the +boundary=administrative+ relation/polygon with +admin_level=11+ the element is located in | 'bounds'    
| +mkgmap:postcode+  | Name of the postal code relation/polygon the element is located in | 'bounds'
| +mkgmap:residential+  | Name of the residential relation/polygon the element is located in or 'yes' if unnamed | none         
| +mkgmap:area2poi+  | The value is +true+ if the POI is derived from a polygon | 'add-pois-to-areas'    
| +mkgmap:line2poi+  | The value is +true+ if the POI is derived from a line | 'add-pois-to-lines'    
| +mkgmap:line2poitype+  | The tag is set for each POI generated from a line. Possible values are: +start+, +end+, +mid+, +inner+. | 'add-pois-to-lines'    
| +mkgmap:from-node:attname+  | The attribute is set for each POI generated from a line. These are the original attributes of the node (part of the line) from which the point was generated | 'add-pois-to-lines'    
| +mkgmap:way-length+  | The tag is set for each POI generated from a line. It gives the way length rounded to meters. | 'add-pois-to-lines'
| +mkgmap:exit_hint+  | +true+ for the part on link roads that should contain information about the exit | 'process-exits'    
| +mkgmap:exit_hint_name+  | The +name+ tag value of the links exit node | 'process-exits'    
| +mkgmap:exit_hint_ref+  | The +ref+ tag value of the links exit node | 'process-exits'    
| +mkgmap:exit_hint_exit_to+  | The +exit_to+ tag value of the links exit node | 'process-exits'    
| +mkgmap:dest_hint+  | The tag is set to a reasonable destination value for the part on link roads that should contain destination information about the link | 'process-destination'    
| +mkgmap:synthesised+  | The value is +yes+ if the way was added by the make-opposite-cycleways option | 'make-opposite-cycleways'
| +mkgmap:mp_created+  | The value is +true+ if the way was created by the internal multi-polygon-relation handling | none
| +mkgmap:option:<key>+  | Tag generated by the --style-option option | 'style-option' 
|=========================================================

.Other internal tags
[options="header"]
|=========================================================
| Tag | Description     
| +mkgmap:skipSizeFilter+  | If set to +true+ the line or polygon will pass the size filter, no matter what size it has    
| +mkgmap:highest-resolution-only+  | If set to +true+ the object will only be added for the highest resolution configured in the element type definition.
| +mkgmap:execute_finalize_rules+  | If set to +true+ mkgmap will execute the finalize rules even if no object is created fot the element.
| +mkgmap:numbers+  | If set to +false+ for a node or way mkgmap will ignore the object in the calculations for the --housenumber option   
| +mkgmap:drawLevel+  | Set to a number from 1 to 100. Overrides the polygon area that is used by --order-by-decreasing-area. 1..50 are larger than typical polygons and be overwritten by them, 51..100 are smaller and will show. Higher drawLevels will show over lower values.
| +mkgmap:stylefilter+  | Set to either polyline or polygon for ways which have mkgmap:mp-created=true. Is used to decide which rules should be used. Should not be set or modified in the relations style.  
|=========================================================
