OSM Tools
dutch german en francais spanish spanish polish russian

Naming

 

In basic:

  name$= ref$+":"+operator$

 

In mkgmap styles :

 

a) check if ref$ or operator$ exists

b) if so then set name to ref , add ":" and operator

 

ref=* { set name='${ref):${operator}'}

Left$

 

name="1234567"

 

Basic: name=left$(name,3) - ie 123

 

mkgmap: name=* { set name='${name|substring:0:3}'}

 

This can be very useful if you decide to base the colour of your hiking/cycling route on the first letter of the reference.

 

Hiking routes often have 2-5 letters

so , ref="LANDS"

In lines add

initlet="L" {set ORANGE=yes}

then add 'orange' lines

 

In relations add

set initlet='${ref|substring:0:1}'

Mid$

 

name="abcdefg"

 

Basic: name=Mid$(name,3) , ie cdefg

 

mkgmap: name=* { set name='${name|substring:2}'}

 

name="abcdefg"

 

Basic: name=Mid$(name,3,3) , ie cde

 

mkgmap: name=* { set name='${name|substring:2:5}'}

 

Explanation :

 

first number sets 'start' of string , second number 'end' of string

 

substring:2:5 means from 3rd letter to letter before 6th letter - very confusing ; 0 is used as the first letter.

 

You can see the effect if you replace

 

name=* { name '${name}' } (found in default lines style file)

 

with

 

name=* { name '${name|substring:2:5}'} # 3,4,5