[mkgmap-dev] Use both addr:city and admin_level as city for address search
From Gerd Petermann gpetermann_muenchen at hotmail.com on Sat May 12 17:15:47 BST 2018
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 at lists.mkgmap.org.uk> im Auftrag von Lorenzo Mastrogiacomi <lomastrolo at gmail.com> Gesendet: Samstag, 12. Mai 2018 15:00:56 An: mkgmap-dev at 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
- Previous message: [mkgmap-dev] Use both addr:city and admin_level as city for address search
- Next message: [mkgmap-dev] Use both addr:city and admin_level as city for address search
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list