This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

copying relation tag to its member ways

1

At least MapsForge (vector rendering lib) cannot handle relations and requires tags on roads. The OSM data should be transformed as selected relations have their selected tags copied to its members, like route=hiking.

I am looking for a public tool to do that. Osmosis does have a tag-transform engine which should be able to do this but does not seem to, its relation matching is not even in the testing suite of the distribution.

Example: copy 'osmc:symbol', 'name', 'network', 'symbol' from every relation tagged route=hiking to its member ways, using command line tools and country extracts.

asked 20 Feb '15, 10:59

grin's gravatar image

grin
158127
accept rate: 0%

3

Keep in mind that ways (and other elements) can belong to multiple relations. Simply moving tags from relations to their members won't work in all cases.

(20 Feb '15, 12:15) scai ♦

@scai true, but that's a secondary problem since it could be handled by tag-transform. Still a good point, thanks.

(20 Feb '15, 15:09) grin

Maybe that's capability MapsForge needs to add? This is the definition of "tagging for the renderer"

(20 Feb '15, 15:16) neuhausr
2

@neuhausr I don't think that anyone's suggesting doing it within OSM; it's after extracting the data and before throwing it at MapsForge that's the question.

(20 Feb '15, 15:19) SomeoneElse ♦

@someoneelse misunderstood, my bad!

(20 Feb '15, 15:35) neuhausr

I have created the script, I'll try to prettify and publish it soon. Right now it's processing Hungary.osm in 7 minutes on a desktop pc which is quite acceptable. I try to look around in neighbouring countries how they could be represented in some standardised fashion; feeling kind of reinventing warm water, hmm.

(23 Feb '15, 09:57) grin
showing 5 of 6 show 1 more comments

Source code available on GitHub .