Variable tag values in MapWriter's Custom Tag Mapping

144 views
Skip to first unread message

Mario Pavlic

unread,
Apr 27, 2021, 8:50:44 AM4/27/21
to Mapsforge & VTM
Hello, hopefully this is one of the last things I need currently and you guys have been very helpful so thank you very much.

I can't quite get variable tag values to map correctly. In the Tag mapping schema it says that you can use "%f" for numeric values and "%s" for string values, but in my case none of the tags with values set to "%f" are being mapped.

For example, if I have the following tag mapping in my Custom Tag Mapping XML:
<osm-tag key="towerId" value="%f" zoom-appear="1" />
This tag doesn't get mapped by MapWriter (its not generated in .map file).
If I use some of the actual towerId values like such:
<osm-tag key="towerId" value="551" zoom-appear="1" />
<osm-tag key="towerId" value="552" zoom-appear="1" />
It works fine.

What could be the problem here?
Message has been deleted

Emux

unread,
Apr 27, 2021, 8:56:18 AM4/27/21
to mapsfo...@googlegroups.com
Have you used the tag-values parameter as described in map-writer documentation?

You can check the default tag-mapping and see how the variable tag values are used.


--
Emux

Mario Pavlic

unread,
Apr 27, 2021, 9:13:52 AM4/27/21
to Mapsforge & VTM
I forgot to add the tag-values parameter. Should this parameter be added only as "tag-values" like such:
osmosis --rx file=input-data.xml --mw file=output-data.map tag-conf-file=customTagMapping.xml bbox=20,20,21,21 tag-values
I tried this and it still doesn't generate tags with variable values.

Emux

unread,
Apr 27, 2021, 9:16:35 AM4/27/21
to mapsfo...@googlegroups.com
Have you looked in map-writer documentation?

It is a boolean option: tag-values=true

--
Emux

Mario Pavlic

unread,
Apr 27, 2021, 9:18:05 AM4/27/21
to Mapsforge & VTM
Yes, tried using it like that also, but I get an error saying "Argument tag-values for task 2-mw was not recognized."

Emux

unread,
Apr 27, 2021, 9:23:43 AM4/27/21
to mapsfo...@googlegroups.com
You should debug your code and commands.

And make sure using the latest map-writer jar.

--
Emux

Mario Pavlic

unread,
Apr 27, 2021, 9:35:26 AM4/27/21
to Mapsforge & VTM
Using latest Osmosis and latest map-writer jar gives me "java.lang.NoClassDefFoundError: gnu/trove/procedure/TShortIntProcedure" error. Is there a trove jar to download and put into plugins folder?

Emux

unread,
Apr 27, 2021, 9:36:57 AM4/27/21
to mapsfo...@googlegroups.com
Do you follow map-writer documentation?

(download the jar-with-dependencies)

--
Emux

Mario Pavlic

unread,
Apr 27, 2021, 9:41:18 AM4/27/21
to Mapsforge & VTM
Oh, works like a charm! Thanks :)
Reply all
Reply to author
Forward
0 new messages