logo separator

[mkgmap-dev] builtin-tag-list

From WanMil wmgcnfg at web.de on Wed Apr 24 18:12:26 BST 2013

> Hi programmers,

Hi Gerd,

>
> while looking at the name-tag-list option I wondered again why we have
> so many different ways to maintain the "usedTags" HashMap which is finally
> used to filter OSM data in class OsmHandler.
>
> 1)We have a list coded in /resources/styles/builtin-tag-list. The tags
> listed here
> can be found in the java sources, but not all tags used in the sources are
> listed.

This is historical. This was the initial list where all tags used in the 
sources must be configured. This has the impact that the tag list is 
static and does not reflect which options are used. So it's sometimes 
larger than required which has a performance impact.

>
> 2) Some sources use hard coded tag names and they have a method
> getUsedTags()
> to tell this fact to other routines.

These are the OsmReadingHook classes. They use a getUsedTags() method. 
These classes are called after reading the OSM file and before the style 
is applied.

>
> 3) Some hard coded tags are used in StyledConverter but they are added to
> the map
> in the RoutingHook, e.g. "access", "highway".

This is a workaround to remove the tags from the builtin-tag-list 
without modifying too much code. So if routing is enabled the routing 
hook adds the tags required for routing. But these tags are not 
evaluated by the RoutingHook itself but by the StyledConverter which has 
no getUsedTags() method.

Things are more complicate:
The LinkDestinationHook evaluates some tags like "destination" but it 
does not return any of them in the getUsedTags() method. The reason is 
that it must evaluate the tags only if they are used in the style file. 
If destination is not referenced by the style file it makes no sense to 
evaluate destination in the LinkDestinationHook so there is no need to 
read the tag from the OSM file.

>
> I'd prefer to have a common way to keep the map up to date, and I think that
> the best
> solution is to add the tag names in the source where they are used (and if
> they are used).

At the moment I know about three ways:
1. builtin-tag-list
2. the getUsedTags() method of the OsmReadingHooks classes
3. referencing in the style file

I think the most you can achieve is to get rid of the builtin-tag-list. 
In the past I have removed lots of tags here by implementing an 
OsmReadingHook. Maybe some code can be moved from the StyledConverter to 
a better place which also implements the getUsedTags() method.

>
> What was the idea behind the builtin-tag-list ?

See above. This was the first way to define tags that are used within 
the code.

>
> Gerd
>

WanMil



More information about the mkgmap-dev mailing list