Skip to main content
Solved

OSM - Extracting Specific Key Value Pairs from Two Lists

  • April 7, 2016
  • 3 replies
  • 90 views

Hi!

I am reading OSM data in the .osm format and trying to write out selected key-value pairs based on the key name.

The key value pairs are in two lists: tag().k and tag(),v. I would like to extract all the keys which equal "name" from tag().k and write the associated values from tag().v to a name attribute.

I am having difficulty figuring out the best (or any) way to do this. I would like to accomplish this task just using the existing transformers if possible.

Thank you!

Best answer by todd_davis

While the tag().k and tag().v exist, you will also find the "name" attribute exist anyway. So you don't need to work with the list of key and values. For example the tag{3}.k = name tag{3}.v = Malibu State Creek Park

but FME also creates attribute name = Malibu State Creek Park

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

Just a little clarification. The tags that I am looking for are not always in the same index position. Also, I would like to leave the "name" attribute blank if there is not key for "name."


todd_davis
Influencer
Forum|alt.badge.img+23
  • Influencer
  • Best Answer
  • April 7, 2016

While the tag().k and tag().v exist, you will also find the "name" attribute exist anyway. So you don't need to work with the list of key and values. For example the tag{3}.k = name tag{3}.v = Malibu State Creek Park

but FME also creates attribute name = Malibu State Creek Park


While the tag().k and tag().v exist, you will also find the "name" attribute exist anyway. So you don't need to work with the list of key and values. For example the tag{3}.k = name tag{3}.v = Malibu State Creek Park

but FME also creates attribute name = Malibu State Creek Park

Thank you!! Should have seen this.