2

I would like to batch-transform multiple shapefiles which are stores in several different folders.

I used the batch deploy with the option "recreate source folder structure" which works well for creating the folder structure.

What's messed up are the attributes of the shapefiles. The "feature types to read" seem to be bound to the shapefile I used to insert the shapefile-reader.

Is there something I can do to transform the shapefiles with the correct attributes (and without additional FME-specific attributes)?

( I used a workbench with shapefile reader-->csmap-reprojector --> shapefile writer but tested also a version with a creator, feature-reader, csmapreprojector and feature-writer).

  • have you tried a schema reader and then a feature reader? – JimT Aug 12 '18 at 21:36
  • Have you Checked on the "Merge Feature Type" box in the Reader with "Merge Filter set to * ? Have you also set the Reader with the "Dynamic Schema Definition" box checked on? – Alex P Aug 12 '18 at 22:42
  • 2
    It would need a dynamic writer too. Better to recreate the workspace at this point, using the dynamic option in the generate dialog. That should solve the issues. – Mark Ireland Aug 13 '18 at 14:30
  • Apologies for not replying with a better response the first time. I was off sick for a while. But there is now a full answer below that should help. – Mark Ireland Aug 15 '18 at 20:42
3

So the method to do this is fairly straightforward. I created a quick demo video here: https://www.screencast.com/t/7FIU8u4o

Written down the steps are:

  1. Generate a workspace. Use Select Multiple Folders/Files to pick a source folder and choose the subfolders option. Make sure the Workflow is set to Dynamic:

enter image description here

  1. Add any transformers you want to the workspace, eg you had a CSMapReprojector. Preferably you don't use any that change/use attributes, since they will vary per file.

  2. Save the workspace and choose Run > Batch Deploy. In the Batch Deploy wizard be sure to set the Recreate Source Folder Structure option:

enter image description here

FME now runs and translates your data. Because it's a dynamic translation, the output has the correct attributes and not the attributes of just one of the files.

Again, see the above video for a demo/proof of success.

2

In addition to Mark's tip, there is a Tutorial at https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html that walks through the process in more detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.