Use both addr:city and admin_level as city for address search

Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead. I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*). I use the default style with little modifications and added this rules in the points file. On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city. addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions] Then set mkgmap:city with the addr:city value to have this as city for the following matches. addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' } I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map. !(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) & name=* { name '${name}' } This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts? These are my options: --style-file=$style_reg \ --latin1 \ --country-name=Italia \ --country-abbr="$abbr" \ --region-name="$nome_reg" \ --area-name="$nome_reg" \ --family-name="OpenStreetMap: Mappe regionali ital.img" \ --description="$nome_reg" \ --series-name="$serie" \ --precomp-sea=${MYPATH}/sea/ \ --generate-sea \ --bounds=${MYPATH}/bounds/ \ --max-jobs \ --route \ --drive-on=detect,right \ --process-destination \ --process-exits \ --location-autofill=is_in,nearest \ --index \ --split-name-index \ --housenumbers \ --add-pois-to-areas \ --link-pois-to-ways \ --preserve-element-order \ --verbose \ --name-tag-list=name,name:it,loc_name,reg_name,nat_name \ --draw-priority=$priority \ --reduce-point-density=3.2 \ --make-opposite-cycleways \ --gmapsupp Lorenzo

Hi Lorenzo, the term 'addr:city'!='mkgmap:admin_level8' is always true because you compare two strings. Maybe you want to compare the values of the tags instead? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com> Gesendet: Samstag, 12. Mai 2018 15:00:56 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use both addr:city and admin_level as city for address search Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead. I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*). I use the default style with little modifications and added this rules in the points file. On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city. addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions] Then set mkgmap:city with the addr:city value to have this as city for the following matches. addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' } I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map. !(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) & name=* { name '${name}' } This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts? These are my options: --style-file=$style_reg \ --latin1 \ --country-name=Italia \ --country-abbr="$abbr" \ --region-name="$nome_reg" \ --area-name="$nome_reg" \ --family-name="OpenStreetMap: Mappe regionali ital.img" \ --description="$nome_reg" \ --series-name="$serie" \ --precomp-sea=${MYPATH}/sea/ \ --generate-sea \ --bounds=${MYPATH}/bounds/ \ --max-jobs \ --route \ --drive-on=detect,right \ --process-destination \ --process-exits \ --location-autofill=is_in,nearest \ --index \ --split-name-index \ --housenumbers \ --add-pois-to-areas \ --link-pois-to-ways \ --preserve-element-order \ --verbose \ --name-tag-list=name,name:it,loc_name,reg_name,nat_name \ --draw-priority=$priority \ --reduce-point-density=3.2 \ --make-opposite-cycleways \ --gmapsupp Lorenzo

Yes, this is good :) : addr:city!=$mkgmap:admin_level8 Can I make this check case insensitive? Lorenzo Il giorno sab, 12/05/2018 alle 16.15 +0000, Gerd Petermann ha scritto:
Hi Lorenzo,
the term 'addr:city'!='mkgmap:admin_level8' is always true because you compare two strings. Maybe you want to compare the values of the tags instead?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com> Gesendet: Samstag, 12. Mai 2018 15:00:56 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use both addr:city and admin_level as city for address search
Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead. I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*). I use the default style with little modifications and added this rules in the points file.
On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city. addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions]
Then set mkgmap:city with the addr:city value to have this as city for the following matches. addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' }
I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map. !(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) & name=* { name '${name}' }
This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts?
These are my options: --style-file=$style_reg \ --latin1 \ --country-name=Italia \ --country-abbr="$abbr" \ --region-name="$nome_reg" \ --area-name="$nome_reg" \ --family-name="OpenStreetMap: Mappe regionali ital.img" \ --description="$nome_reg" \ --series-name="$serie" \ --precomp-sea=${MYPATH}/sea/ \ --generate-sea \ --bounds=${MYPATH}/bounds/ \ --max-jobs \ --route \ --drive-on=detect,right \ --process-destination \ --process-exits \ --location-autofill=is_in,nearest \ --index \ --split-name-index \ --housenumbers \ --add-pois-to-areas \ --link-pois-to-ways \ --preserve-element-order \ --verbose \ --name-tag-list=name,name:it,loc_name,reg_name,nat_name \ --draw-priority=$priority \ --reduce-point-density=3.2 \ --make-opposite-cycleways \ --gmapsupp
Lorenzo _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Lorenzo, I found no solution for a case insensitive compare of two tags. Maybe someone else has an idea ? Maybe we can implement a new operator for that, maybe a new filter or style function. Any suggestions? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com> Gesendet: Samstag, 12. Mai 2018 19:25:18 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Use both addr:city and admin_level as city for address search Yes, this is good :) : addr:city!=$mkgmap:admin_level8 Can I make this check case insensitive? Lorenzo Il giorno sab, 12/05/2018 alle 16.15 +0000, Gerd Petermann ha scritto: Hi Lorenzo, the term 'addr:city'!='mkgmap:admin_level8' is always true because you compare two strings. Maybe you want to compare the values of the tags instead? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk<mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk>> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com<mailto:lomastrolo@gmail.com>> Gesendet: Samstag, 12. Mai 2018 15:00:56 An: mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk> Betreff: [mkgmap-dev] Use both addr:city and admin_level as city for address search Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead. I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*). I use the default style with little modifications and added this rules in the points file. On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city. addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions] Then set mkgmap:city with the addr:city value to have this as city for the following matches. addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' } I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map. !(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) & name=* { name '${name}' } This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts? These are my options: --style-file=$style_reg \ --latin1 \ --country-name=Italia \ --country-abbr="$abbr" \ --region-name="$nome_reg" \ --area-name="$nome_reg" \ --family-name="OpenStreetMap: Mappe regionali ital.img" \ --description="$nome_reg" \ --series-name="$serie" \ --precomp-sea=${MYPATH}/sea/ \ --generate-sea \ --bounds=${MYPATH}/bounds/ \ --max-jobs \ --route \ --drive-on=detect,right \ --process-destination \ --process-exits \ --location-autofill=is_in,nearest \ --index \ --split-name-index \ --housenumbers \ --add-pois-to-areas \ --link-pois-to-ways \ --preserve-element-order \ --verbose \ --name-tag-list=name,name:it,loc_name,reg_name,nat_name \ --draw-priority=$priority \ --reduce-point-density=3.2 \ --make-opposite-cycleways \ --gmapsupp Lorenzo _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Not a big problem Gerd, maybe all of them are tagging errors. Thanks Lorenzo Il giorno dom, 13/05/2018 alle 08.52 +0000, Gerd Petermann ha scritto:
Hi Lorenzo,
I found no solution for a case insensitive compare of two tags. Maybe someone else has an idea ? Maybe we can implement a new operator for that, maybe a new filter or style function. Any suggestions?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com> Gesendet: Samstag, 12. Mai 2018 19:25:18 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Use both addr:city and admin_level as city for address search
Yes, this is good :) : addr:city!=$mkgmap:admin_level8
Can I make this check case insensitive?
Lorenzo
Il giorno sab, 12/05/2018 alle 16.15 +0000, Gerd Petermann ha scritto:
Hi Lorenzo,
the term 'addr:city'!='mkgmap:admin_level8' is always true because you compare two strings. Maybe you want to compare the values
of the tags instead?
Gerd
________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk<mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk>> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com<mailto:lomastrolo@gmail.com>>
Gesendet: Samstag, 12. Mai 2018 15:00:56
An: mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk>
Betreff: [mkgmap-dev] Use both addr:city and admin_level as city for address search
Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead.
I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*).
I use the default style with little modifications and added this rules in the points file.
On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city.
addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions]
Then set mkgmap:city with the addr:city value to have this as city for the following matches.
addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' }
I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map.
!(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) &
name=* { name '${name}' }
This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts?
These are my options:
--style-file=$style_reg \
--latin1 \
--country-name=Italia \
--country-abbr="$abbr" \
--region-name="$nome_reg" \
--area-name="$nome_reg" \
--family-name="OpenStreetMap: Mappe regionali ital.img" \
--description="$nome_reg" \
--series-name="$serie" \
--precomp-sea=${MYPATH}/sea/ \
--generate-sea \
--bounds=${MYPATH}/bounds/ \
--max-jobs \
--route \
--drive-on=detect,right \
--process-destination \
--process-exits \
--location-autofill=is_in,nearest \
--index \
--split-name-index \
--housenumbers \
--add-pois-to-areas \
--link-pois-to-ways \
--preserve-element-order \
--verbose \
--name-tag-list=name,name:it,loc_name,reg_name,nat_name \
--draw-priority=$priority \
--reduce-point-density=3.2 \
--make-opposite-cycleways \
--gmapsupp
Lorenzo
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk>
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hello, Maybe a function which can both lowercase/uppercase/propercase left and right side of the compare Something like this? lcase('$addr:city') != lcase('$mkgmap:admin_level8') highway = service {set addr:street = lcase('$name')} gr Joris ________________________________ Van: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> namens Gerd Petermann <gpetermann_muenchen@hotmail.com> Verzonden: zondag 13 mei 2018 10:52:52 Aan: Development list for mkgmap Onderwerp: Re: [mkgmap-dev] Use both addr:city and admin_level as city for address search Hi Lorenzo, I found no solution for a case insensitive compare of two tags. Maybe someone else has an idea ? Maybe we can implement a new operator for that, maybe a new filter or style function. Any suggestions? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com> Gesendet: Samstag, 12. Mai 2018 19:25:18 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Use both addr:city and admin_level as city for address search Yes, this is good :) : addr:city!=$mkgmap:admin_level8 Can I make this check case insensitive? Lorenzo Il giorno sab, 12/05/2018 alle 16.15 +0000, Gerd Petermann ha scritto: Hi Lorenzo, the term 'addr:city'!='mkgmap:admin_level8' is always true because you compare two strings. Maybe you want to compare the values of the tags instead? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk<mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk>> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo@gmail.com<mailto:lomastrolo@gmail.com>> Gesendet: Samstag, 12. Mai 2018 15:00:56 An: mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk> Betreff: [mkgmap-dev] Use both addr:city and admin_level as city for address search Usually (in Italy) the municipality name is used as city in composing the address but it often happens that within the municipality there are other main towns which names are used instead. I want this addresses to be searchable with both the municipality name (admin_level=8) and the city name when it differs (tagged with addr:city=*). I use the default style with little modifications and added this rules in the points file. On top, first create a "fake" object only for searching, which will be matched by default rules in address file, so these will have admin_level8 as mkgmap:city. addr:city=* & 'addr:city'!='mkgmap:admin_level8' [0x3200 continue with_actions] Then set mkgmap:city with the addr:city value to have this as city for the following matches. addr:city=* & 'addr:city'!='mkgmap:admin_level8' { set mkgmap:city='${addr:city}' } I also added modified the rule at the bottom to avoid "fake" objects to get a name and show on the map. !(addr:city=* & 'addr:city'!='mkgmap:admin_level8' & mkgmap:city!=*) & name=* { name '${name}' } This seems to work pretty well but it looks rather complicated. I wonder if there is a better way to do this. Any thoughts? These are my options: --style-file=$style_reg \ --latin1 \ --country-name=Italia \ --country-abbr="$abbr" \ --region-name="$nome_reg" \ --area-name="$nome_reg" \ --family-name="OpenStreetMap: Mappe regionali ital.img" \ --description="$nome_reg" \ --series-name="$serie" \ --precomp-sea=${MYPATH}/sea/ \ --generate-sea \ --bounds=${MYPATH}/bounds/ \ --max-jobs \ --route \ --drive-on=detect,right \ --process-destination \ --process-exits \ --location-autofill=is_in,nearest \ --index \ --split-name-index \ --housenumbers \ --add-pois-to-areas \ --link-pois-to-ways \ --preserve-element-order \ --verbose \ --name-tag-list=name,name:it,loc_name,reg_name,nat_name \ --draw-priority=$priority \ --reduce-point-density=3.2 \ --make-opposite-cycleways \ --gmapsupp Lorenzo _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk<mailto:mkgmap-dev@lists.mkgmap.org.uk> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
Gerd Petermann
-
Joris Bo
-
Lorenzo Mastrogiacomi