Skip to main content
Question

How to use WorkspaceRunner with multiple multiple input files?

  • October 25, 2020
  • 3 replies
  • 81 views

Hi!

 

I have a workspace which reads 2 tif files and 1 shape file and writes a kml file. I have about 100 pairs of tif and shape files that I want to process in an automatic way. I am trying with Workspacerunner but can not make it work. Any tips on how to proceed?

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

Forum|alt.badge.img+2

You can assign a unique value to the shapefile and then assign the same unique value to each of the separate tiff files. Then use the "Group by" functions in the transformer(s) and then use the fanout by the same attribute to create the kml(s).

 

A way to do this would be;

 

If the filenames contain a common name per set you can extract them by exposing the fme_basename attribute on the reader(s) and then use a substring extractor to grab the portion you need.

 

Example;

shapefile 1 = Kitty_cat.shp

tiff 1 = Kitty_cat1.tif

tiff 2 - Kitty_cat2.tif

Extract Kitty_cat and use that as the group by.

 

If this doesn't work, post the file names of two pairs so we can see what the structure looks like for additional ideas.

 

 


  • Author
  • October 25, 2020

You can assign a unique value to the shapefile and then assign the same unique value to each of the separate tiff files. Then use the "Group by" functions in the transformer(s) and then use the fanout by the same attribute to create the kml(s).

 

A way to do this would be;

 

If the filenames contain a common name per set you can extract them by exposing the fme_basename attribute on the reader(s) and then use a substring extractor to grab the portion you need.

 

Example;

shapefile 1 = Kitty_cat.shp

tiff 1 = Kitty_cat1.tif

tiff 2 - Kitty_cat2.tif

Extract Kitty_cat and use that as the group by.

 

If this doesn't work, post the file names of two pairs so we can see what the structure looks like for additional ideas.

 

 

That sound like a good approach. So in my case I would use SubstringExtraxtor to create a new attribute with the first 19 characters, then use "Group By" in all transformers and dataset fanout by the same attribute?File_namesThanks for the help!

 


Forum|alt.badge.img+2

That sound like a good approach. So in my case I would use SubstringExtraxtor to create a new attribute with the first 19 characters, then use "Group By" in all transformers and dataset fanout by the same attribute?File_namesThanks for the help!

 

Exactly. The group by function processes feature sets independently and at the end use the fanout feature on the KML writer to fan out by that same name. This works on any number of combinations. If some have 1 shapefile and 10 tiffs it will treat them the same as it will with 1 shapefile and 2 tiffs.