Hi Alexandre, I use an Excel spreadsheet (enclosed) to do this kind of transformation for Dutch-language street names. There's a macro (Alt-f11) which writes a file "fix_names" (the path is hard-coded in the macro code, sorry about that - please edit to suit). There's a tab for prefixes, one for suffixes, and one for the matching rules. You need to "include" this "fix_names" from an appropriate place in the "lines" file.
I hope it's useful - please let me know if you have any questions!
--colin
On 2016-06-12 23:42, Alexandre de Menezes wrote:
> Hi everyone,
>
> I want to do some transformations on the names of all the Ways, is there a
> standard way to do that? For example, I want to replace all occurrences of
> "Avenida" for "Av.".
>
> I tried adding this to my lines file:
>
> highway=* & name ~ '(?i)avenida\s+.*' { add
> streettype:movedend='${name|subst:(?i)avenida\s+~>}, Av.'} #
>
> But There was no effect.
>
> Thanks in advance,
>
> Alexandre
> _______________________________________________
> mkgmap-dev mailing list
> [email protected]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
NlStreetNames.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12
name=* & highway=* & (name ~ '.* .*') & (mkgmap:country=NLD |
mkgmap:country=BEL) {set
name2='${name|subst:Burgemeester\b~>Burg|subst:^Admiraal\b~>Adm|subst:"^(Doctor|Dokter)\b~>Dr"|subst:^Doctorandus\b~>Drs|subst:^Dominee\b~>Ds|subst:Ingenieur\b~>Ir|subst:^Prins(es)?\b~>Pr|subst:^Koning(in)?\b~>Kon|subst:^Sint\b~>St|subst:President\b~>Pres|subst:Monseigneur\b~>Mgr|subst:Minister\b~>Min|subst:Mevrouw\b~>Mevr|subst:Kardinaal\b~>Kard|subst:Jonkheer\b~>Jhr|subst:Kolonel\b~>Kol|subst:Meester\b~>Mr|subst:Professor\b~>Prof|subst:Luitenant\b~>Lt|subst:Generaal\b~>Gen|subst:Graaf\b~>Gr|subst:^Baron\b~>Bn|subst:Bisschop\b~>Bis|subst:Broeder\b~>Br|subst:Adjutant\b~>Adj|subst:Architect\b~>Arch|subst:Jonkvrouw\b~>Jkvr|subst:Directeur\b~>Dir}'}
addr:street=* & (addr:street ~ '.* .*') & (mkgmap:country=NLD |
mkgmap:country=BEL) {set
addr:street2='${addr:street|subst:Burgemeester\b~>Burg|subst:^Admiraal\b~>Adm|subst:"^(Doctor|Dokter)\b~>Dr"|subst:^Doctorandus\b~>Drs|subst:^Dominee\b~>Ds|subst:Ingenieur\b~>Ir|subst:^Prins(es)?\b~>Pr|subst:^Koning(in)?\b~>Kon|subst:^Sint\b~>St|subst:President\b~>Pres|subst:Monseigneur\b~>Mgr|subst:Minister\b~>Min|subst:Mevrouw\b~>Mevr|subst:Kardinaal\b~>Kard|subst:Jonkheer\b~>Jhr|subst:Kolonel\b~>Kol|subst:Meester\b~>Mr|subst:Professor\b~>Prof|subst:Luitenant\b~>Lt|subst:Generaal\b~>Gen|subst:Graaf\b~>Gr|subst:^Baron\b~>Bn|subst:Bisschop\b~>Bis|subst:Broeder\b~>Br|subst:Adjutant\b~>Adj|subst:Architect\b~>Arch|subst:Jonkvrouw\b~>Jkvr|subst:Directeur\b~>Dir}'}
mkgmap:street=* & (mkgmap:street ~ '.* .*') & (mkgmap:country=NLD |
mkgmap:country=BEL) {set
mkgmap:street2='${mkgmap:street|subst:Burgemeester\b~>Burg|subst:^Admiraal\b~>Adm|subst:"^(Doctor|Dokter)\b~>Dr"|subst:^Doctorandus\b~>Drs|subst:^Dominee\b~>Ds|subst:Ingenieur\b~>Ir|subst:^Prins(es)?\b~>Pr|subst:^Koning(in)?\b~>Kon|subst:^Sint\b~>St|subst:President\b~>Pres|subst:Monseigneur\b~>Mgr|subst:Minister\b~>Min|subst:Mevrouw\b~>Mevr|subst:Kardinaal\b~>Kard|subst:Jonkheer\b~>Jhr|subst:Kolonel\b~>Kol|subst:Meester\b~>Mr|subst:Professor\b~>Prof|subst:Luitenant\b~>Lt|subst:Generaal\b~>Gen|subst:Graaf\b~>Gr|subst:^Baron\b~>Bn|subst:Bisschop\b~>Bis|subst:Broeder\b~>Br|subst:Adjutant\b~>Adj|subst:Architect\b~>Arch|subst:Jonkvrouw\b~>Jkvr|subst:Directeur\b~>Dir}'}
name2=* & name2!=$name {echo "Name ${name} changed to ${name2}"; set
name='${name2}'; delete name2;}
addr:street2=* & addr:street2!=$addr:street {echo "Addr:street ${addr:street}
changed to ${addr:street2}"; set addr:street='${addr:street2}'; delete
addr:street2;}
mkgmap:street2=* & mkgmap:street2!=$mkgmap:street {echo "Mkgmap:street
${mkgmap:street} changed to ${mkgmap:street2}"; set
mkgmap:street='${mkgmap:street2}'; delete mkgmap:street2;}
_______________________________________________ mkgmap-dev mailing list [email protected] http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
