logo separator

[mkgmap-dev] location-autofill=bounds uses a boundary not surrounding the POI

From Bernhard Moser bernhard.moser at speed.at on Mon Aug 13 07:09:55 BST 2012

Hi WanMil,
Hi Steve,

Thank you for your efforts.

Now I know that mkgmap is working very well in terms of the 
location-autofill process, as long as the desired address information is 
available in the OSM data :-)

 From my point of view you do not have to change mkgmap's behaviour if 
no city name is found.
Instead, I've tried to improve the rule set for the location tag 
assignment and it is working well in Austria, Germany, Italy and parts 
of Swizzerland.

I've introduced a tag for districts for myself and I use it to fill the 
city tag if no city name is found using the administrative boundaries.
For example, like in Innsbruck, the address is city=district and 
region=region

	..., Innsbruck-Stadt, Tirol, AUT

On the other hand if a city name is present I concatenate the district 
tag with the region tag like 'district, region', which provides detailed 
adress information.
For example, with city name

	..., Livigno, Sondrio, Lombardia, ITA

Thanks and greetings,
Bernhard


Here is my current rule set, still work in progress...

#------------------------------------------------------------------------------
# location

# country code
mkgmap:country!=* & mkgmap:admin_level2=* { set 
mkgmap:country='${mkgmap:admin_level2}' }
mkgmap:country!=* & addr:country=* { set mkgmap:country='${addr:country}' }
mkgmap:country!=* & is_in:country=* { set 
mkgmap:country='${is_in:country}' }

# federal state, region
mkgmap:region!=* & mkgmap:admin_level3=* { set 
mkgmap:region='${mkgmap:admin_level3}' }
mkgmap:region!=* & mkgmap:admin_level4=* { set 
mkgmap:region='${mkgmap:admin_level4}' }
mkgmap:region!=* & mkgmap:admin_level5=* { set 
mkgmap:region='${mkgmap:admin_level5}' }
mkgmap:region!=* & addr:state=* { set mkgmap:region='${addr:state}' }
mkgmap:region!=* & is_in:state=* { set mkgmap:region='${is_in:state}' }
mkgmap:region!=* & addr:province=* { set mkgmap:region='${addr:province}' }
mkgmap:region!=* & is_in:province=* { set 
mkgmap:region='${is_in:province}' }
mkgmap:region!=* & is_in:region=* { set mkgmap:region='${is_in:region}' }

# district, county
mkgmap:district!=* & mkgmap:admin_level6=* { set 
mkgmap:district='${mkgmap:admin_level6}' }
mkgmap:district!=* & mkgmap:admin_level7=* { set 
mkgmap:district='${mkgmap:admin_level7}' }
mkgmap:district!=* & addr:district=* { set 
mkgmap:district='${addr:district}' }
mkgmap:district!=* & is_in:district=* { set 
mkgmap:district='${is_in:district}' }
mkgmap:district!=* & is_in:county=* { set 
mkgmap:district='${is_in:county}' }

# city
mkgmap:country=AUT & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=BEL & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=CZE & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=CZE & mkgmap:city!=* & mkgmap:admin_level7=* { set 
mkgmap:city='${mkgmap:admin_level7}' }
mkgmap:country=DEU & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=DNK & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=DNK & mkgmap:city!=* & mkgmap:admin_level7=* { set 
mkgmap:city='${mkgmap:admin_level7}' }
mkgmap:country=DNK & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=FIN & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=FIN & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=FRA & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=FRA & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=ISL & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=ITA & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=LUX & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=NOR & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=POL & mkgmap:city!=* & mkgmap:admin_level10=* { set 
mkgmap:city='${mkgmap:admin_level10}' }
mkgmap:country=POL & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=PRT & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=PRT & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=SVN & mkgmap:city!=* & mkgmap:admin_level10=* { set 
mkgmap:city='${mkgmap:admin_level10}' }
mkgmap:country=ESP & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=SWE & mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:country=SWE & mkgmap:city!=* & mkgmap:admin_level7=* { set 
mkgmap:city='${mkgmap:admin_level7}' }
mkgmap:country=CHE & mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }

mkgmap:city!=* & mkgmap:admin_level8=* { set 
mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:city!=* & mkgmap:admin_level7=* { set 
mkgmap:city='${mkgmap:admin_level7}' }
mkgmap:city!=* & mkgmap:admin_level9=* { set 
mkgmap:city='${mkgmap:admin_level9}' }
mkgmap:city!=* & mkgmap:admin_level10=* { set 
mkgmap:city='${mkgmap:admin_level10}' }
mkgmap:city!=* & addr:city=* { set mkgmap:city='${addr:city}' }
mkgmap:city!=* & is_in:municipality=* { set 
mkgmap:city='${is_in:municipality}' }
mkgmap:city!=* & is_in:city=* { set mkgmap:city='${is_in:city}' }
mkgmap:city!=* & is_in:town=* { set mkgmap:city='${is_in:town}' }
mkgmap:city!=* & is_in:village=* { set mkgmap:city='${is_in:village}' }
mkgmap:city!=* & is_in:hamlet=* { set mkgmap:city='${is_in:hamlet}' }

# remove prefixes
mkgmap:country=AUT & mkgmap:district=* { set 
mkgmap:district='${mkgmap:district|subst:Bezirk |subst:Gemeinde }' }
mkgmap:country=CHE & mkgmap:district=* { set 
mkgmap:district='${mkgmap:district|subst:Bezirk |subst:Verwaltungskreis }' }
mkgmap:country=DEU & mkgmap:district=* { set 
mkgmap:district='${mkgmap:district|subst:Verwaltungskreis 
|subst:Landkreis }' }
mkgmap:country=AUT & mkgmap:city=* { set 
mkgmap:city='${mkgmap:city|subst:Stadt }' }

# concatenate region and district
mkgmap:city!=* & mkgmap:district=* { set 
mkgmap:city='${mkgmap:district}'; delete mkgmap:district; }
mkgmap:region=* | mkgmap:district=* { set 
mkgmap:region='${mkgmap:district}, 
${mkgmap:region}'|'${mkgmap:region}'|'${mkgmap:district}' }

# postal code
mkgmap:postal_code!=* & openGeoDB:postal_codes=* { set 
mkgmap:postal_code='${openGeoDB:postal_codes}' }
mkgmap:postal_code!=* & mkgmap:postcode=* { set 
mkgmap:postal_code='${mkgmap:postcode}' }
mkgmap:postal_code!=* & addr:postcode=* { set 
mkgmap:postal_code='${addr:postcode}' }

# address
mkgmap:street!=* & addr:street=* { set mkgmap:street='${addr:street}' }
mkgmap:street!=* & addr:place=* { set mkgmap:street='${addr:place}' }
mkgmap:street!=* & addr:housename=* { set 
mkgmap:street='${addr:housename}' }

mkgmap:housenumber!=* & addr:housenumber=* { set 
mkgmap:housenumber='${addr:housenumber}' }

mkgmap:phone!=* & phone=* { set mkgmap:phone='${phone}' }

mkgmap:is_in!=* & is_in=* { set mkgmap:is_in='${is_in}' }




More information about the mkgmap-dev mailing list