Skip to main content
Solved

OSM - Extracting Specific Key Value Pairs from Two Lists


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

View original
Did this help you find an answer to your question?

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+22
  • 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


todd_davis wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings