Version 1708 was commited by steve on 2010-09-28 09:56:18 +0100 (Tue, 28 Sep 
2010) 

This can be used to extract substrings from values.
If the "name" tag on an object was equal to "abcdef":

'${name|substring:2}' => 'cdef'
'${name|substring:2:4}' => 'cd'

As an example, it can be used to clean up the "ref" element on route relations:

type=route & route=road & network=US:I & ref ~ 'I\d+' { apply { set 
route_network='US:I'; set route_ref='${ref|substring:1}'; } }
type=route & route=road & network=US:I & ref ~ 'I \d+' { apply { set 
route_network='US:I'; set route_ref='${ref|substring:2}'; } }
type=route & route=road & network=US:I & ref ~ 'I-\d+' { apply { set 
route_network='US:I'; set route_ref='${ref|substring:2}'; } }
type=route & route=road & network=US:I & ref ~ '\d+' { apply { set 
route_network='US:I'; set route_ref='${ref}'; } }

-Jeffrey Ollie
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to