logo separator

[mkgmap-dev] Support place polygons in preprocessed bounds

From "Maxim Düster" maxc at gmx.de on Tue Jan 20 11:15:25 GMT 2015

Hello everybody!
 
>From time to time I use mkgmap for producing Garmin maps for myself. Recently I needed to have a possibility for an entity to get the name of the place where the entity resides, just like it's the case with boundaries and admin levels.
The purpose for me was to have easier address search and displaying in Russia where we have one particular region type with admin_level=6, that is named "городской округ" (city district). It's often the case that it contains only one city but the cities themselves are not being mapped as admin_level=x. So in my style, to fill mkgmap:city in these cases, I only can use the value of mkgmap:admin_leve6. But that official name can be quite long and unhandy, and the "normal" name of the city cannot be figured out automatically.
 
For example:
городской округ Жуковский => Жуковский
Челябинский городской округ => Челябинск
Зиминское городское муниципальное образование => Зима
 
Somehow I overlooked WanMil's message from 2013 (http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2013q2/018003.html) and so I did the change myself in a local branch. Now I can write in my address style include something like this:
 
# Russia
mkgmap:country=RUS & mkgmap:city!=* & mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8}' }
mkgmap:country=RUS & mkgmap:city!=* & (mkgmap:place=city | mkgmap:place=town) { set mkgmap:city='${mkgmap:place_name}' }
mkgmap:country=RUS & mkgmap:city!=* & mkgmap:admin_level6=* { set mkgmap:city='${mkgmap:admin_level6}' }
 
and get the proper city name in my map. Of course, to get this working, I had to create my own set of precompiled bounds with additional rule "type=multipolygon and place= and name=" for osmfilter and a run of BoundaryPreprocessor to set the variables mkgmap:place (attribute 'place' from the multipolygon) and mkgmap:place_name (attribute 'name' from the multipolygon).
 
I don't know if it's a highly desirable feature, but probably someone else will find it useful and it could be added to a new release of mkgmap.
 
Cheers!
Max


More information about the mkgmap-dev mailing list