wiki:NameTemplate

Version 1 (modified by jttt, 13 years ago) ( diff )

--

Name templates can be used to define custom formatting for gpx waypoints or osm primitives (for example in Relation or Selection list).

Syntax

  • {var} - use value of variable var
  • ?{condition1 'value1' | condition2 'value2 | 'value3'} - use value1 if condition1 is satisfied, value3 is no condition is satisfied. Condition can be either explicit - the same expression as in search or filters is used or implicit - value is used when all variables used inside exists

Samples

Template Tags Result
House number {addr:housenumber} addr:housenumber=10 House number 10
?{ 'House number {addr:housenumber} at {addr:street}' | 'House number {addr:housenumber}' } addr:housenumber=10 House number 10
addr:housenumber=10, addr:street=Abbey road House number 10 at Abbey road
?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' | admin_level = 6 'NUTS 3' | 'Admin level {admin_level}'} admin_level=4 NUTS 2
admin_level=5 Admin level 5

Available values

For osm primitives formating, value of any tag can be used, use {special:everything} to see what values are available for you gpx waypoints. Few additional variables are available via special prefix:

  • {special:everything} prints all available values, available for both primitive and waypoint formatting.
  • {special:id} prints id of osm primitive
  • {special:localName} prints localized name, that is value of name:lang for your language if the tag exists or just value of name tag.
Note: See TracWiki for help on using the wiki.