I have some external data which I've converted into .osm format, resulting in the following:

          <tag k="Mode" v="highway" />
          <tag k="Type" v="primary" />

which I'd like to turn into:

          <tag k="highway" v="primary" />

(Before anyone asks, this is not for data that will result in any kind of importing into OSM! Am merely using the OSM toolchain, but with data coming from a shapefile.)

I can't work out from the Osmosis Tag transform documentation how to do this, if it is even possible.

I suppose I am thinking something along these lines, but this doesn't work:

        <name>Convert from Shapefile headings to OSM key-value pairs</name>
        <match type="way">
          <tag k="Mode" v="(.+)" match_id="kv" />
          <tag k="Type" v="(.+)" match_id="kv" />
          <copy-unmatched />
          <tag from_match="kv" k="{1}" v="{2}" />

asked 20 Jul '16, 16:25

fooquency's gravatar image

accept rate: 0%

edited 20 Jul '16, 16:32

I've no idea what you want to do with it after osmosis, but if the answer was "load it into a rendering database" note that osm2pgsql can do what you want via a lua script:


(20 Jul '16, 16:56) SomeoneElse ♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 20 Jul '16, 16:25

question was seen: 1,048 times

last updated: 20 Jul '16, 16:56

powered by OSQA