logo separator

[mkgmap-dev] Search addresses for latin countries (help on reg exp)

From Enrico Liboni eliboni at gmail.com on Mon Aug 5 14:17:48 BST 2013

Carlos, Bueno! Thanks for your reply. Actually I believe trying to find all
the combinations in the various languages would really be hard and I'm
concerned about having hard-codes in for languages.

The approach I'd like to follow to facilitate search is just to take the
last word of a street name and concatenate it as a suffix to the street
name itself, so the regex should do something like

1. get the string after the last occurrence of a blank in the full street
name
2. if it exists, rename the street using this string, plus comma, plus the
full street name

So, say, "Calle Doctor Maranon" will become "Maranon, Calle Doctor
Maranon": no matter how calle is spelled and if followed by a "de" or "de
el" it woudl make the research easy.

This would require a reg exp wizard but I'm sure here we can find someone ;)

Enrico

>From Carlos Dávila cdavilam at orangecorreo.es on Mon Aug 5 12:00:59 BST
2013
El 05/08/13 12:50, Enrico Liboni escribió:
>

>
> I'm working on that since a few weeks ago for Spanish and Catalan, but
> it takes quite a long time to find all combination possibilities and
> also to fix all errors in the names I'm finding in the OSM data. As an
> example, you can see the line
> highway=* & name ~ '[Aa]venida [Dd]e [Ee]l .*' { add
> streettype:movedend='${name|subst:Avenida De El |subst:Avenida De el
> |subst:Avenida de El |subst:Avenida de el |subst:avenida De El
> |subst:avenida De el |subst:avenida de El |subst:avenida de el },
> Avenida de El'}
> It would be great if we can build and share rules for several languages


On Mon, Aug 5, 2013 at 12:50 PM, Enrico Liboni   wrote:

> Folks, as you know – this comes up time to time –  address search is
> unpractical in most Latin countries where the street/square name usually
> starts with the type  (Via, Viale,Corso,  Piazza etc [IT];  Avenida, Calle,
> Plaza etc [ES];  Avenue, Boulevard, Rue, Place etc [FR] etc.) followed by
> the full name of  - usually - the person naming the street. Nevertheless
> the street names sometime appears abbreviated (V.le,  Av.da, Bld.  etc),
>  sometime the Middle name is skipped, sometime the work “of” is used
> (Avenue de Bobigny, Corso del Popolo etc)
>
> So what is a simple Mozartstrasse in Austria would look like “Via Wolfgang
> Amadeus Mozart” in Italy or “Rue Wolfgang Amadeus Mozart” in France but
> possibly also “Av.da de Mozart” etc.
>
> Now, everyone knows the street/square by its last name and it would be
> much more practical to search by it:  I’d like to have a style that just
> pick the last full word of the street/square name and put it as a suffix
> followed by a comma and the original name.
>
> This would really boost address search for Latin countries – so it might
> be a default style to add to IT, FR, ES, BR, MX… etc).
>
> Could you help me on making that regular expression for the style?
>
> “str1 str2… strN” -> “strN, str1 str2… strN”
>
>
>
> Thanks!
>
> Enrico
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20130805/7c59500c/attachment.html 


More information about the mkgmap-dev mailing list