Solved

OSM - Extracting Specific Key Value Pairs from Two Lists

  • 7 April 2016
  • 3 replies
  • 12 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!

icon

Best answer by todd_davis 8 April 2016, 00:28

View original

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."

Userlevel 1
Badge +12

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.

Reply