logo separator

[mkgmap-dev] Address (street) search for latin countries in plain gmapsupp.img

From Enrico Liboni eliboni at gmail.com on Mon Jan 6 21:52:07 GMT 2014

Hi, this is an old thread... until this is properly fixed in the index I'd
like to share a trick I'm using to generate a gmapsupp.img file where it's
convenient to search for a street name in latin countries (I'm a linux
user, no mapsource/basecamp).

The issue is, in most latin countries streets are named after real people
and in OSM are entered with their full name, i.e. something like "Via
Wolfgang Amadeus Mozart" (Via means Street): when looking for the street
one need to type "Via Wol..."  and the issue is usually one knows the most
meaningful name of the street - Mozart in this case - rather than the full
name. And it is boring to type always "Via..."

The below  does  the job:  the most meanigful street word (the last one) is
set as first one just in the labels used for address search, i.e.: 'Via
Wolfgang Amadeus Mozart' becomes 'Mozart, Via Wolfgang Amadeus' when doing
address search while the label displayed on the map remains unchanged:

# Add this in inc/address (just after mkgmap:country has been set)
# Get the last full word if a \s (whitespace) exist in name
( mkgmap:country=ITA  | mkgmap:country=FRA | mkgmap:country=CHE) &
highway=* & name ~ '.*\s.*' { set  last:word='${name|part: :-1}' }
# if the last full word is a roman number - i.e. if a street has been named
after a King or a Pope - get the last two words
last:word ~ '(I|II|III|IV|V|VI.*|IX|X|XI.*|XV.*|XX.*)'  {set
last:word='${name|part: >-3}' }
# set 3rd and 4th labels (used for address search only) with the last:word
as 1st word
last:word=*  { set mkgmap:label:3='${last:word}, ${name|part: <-1}';set
mkgmap:label:4='${last:word}, ${name|part: <-1}' }

Hope it helps!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20140106/cb2dff5e/attachment.html>

More information about the mkgmap-dev mailing list