logo separator

[mkgmap-dev] Again on address search in latin countries

From Enrico Liboni eliboni at gmail.com on Sun Sep 18 08:33:36 BST 2016

Folks the index branch has been merged with main since sometime and the
experimental --x-split-name-index works for me as documented but I still
don't get an optimal user experience.

Example, there might be multiple streets named with the same word (example
in Padova, Italy: Via Dietro Duomo, Piazza del Duomo, Galleria Duomo): if
you type "Duomo" the expected behaviour is to have the gps to show the list
of available matches, while in the current implementation three lines with
just the word "Duomo" appears and you don't know which one to pick.

Without the --x-split-name-index option, adding the below to "inc/address"
produces imho a better result overall for latin countries. Please evaluate
if to embed some of the logic in "--x-split-name-index" option to set the
appropriate labels with the full name of the street,  which if I understood
correctly is what the navigator shows.


Thanks!

Enrico


# Add in inc/address
# Step 1: in latin countries the last word of a street name is the
meaningful one, so get it and
# consider the exception when the last two words are the meaningful ones
(like "Via Vittorio Emanuele XI").
#
# Get the last full word if a \s (whitespace) exist in name
( mkgmap:country=ITA  | mkgmap:country=FRA | mkgmap:country=CHE |
mkgmap:country=ESP) & 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}' }
#
# Step 2: set the labels used for address search (3&4):
#  the 3rd label  is set with the last:word as 1st word followed by comma
and the remaining words
#     i.e. 'Via Wolfgang Amadeus Mozart' becomes 'Mozart, Via Wolfgang
Amadeus'
#  the 4th label is set  the 1st word (that is usually Via, Rue, Avenida
etc, so not really useful in search)
#     i.e. 'Via Wolfgang Amadeus Mozart' becomes 'Wolfgang Amadeus Mozart'
last:word=*  { set mkgmap:label:3='${last:word}, ${name|part: <-1}';set
mkgmap:label:4='${name|part: >1}' }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20160918/f609d580/attachment.html>


More information about the mkgmap-dev mailing list