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

Mark Ireland
13.3k3 gold badges35 silver badges69 bronze badges
asked Aug 12, 2018 at 21:27
3
  • have you tried a schema reader and then a feature reader? Commented Aug 12, 2018 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? Commented Aug 12, 2018 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. Commented Aug 13, 2018 at 14:30

2 Answers 2

5

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.

answered Aug 15, 2018 at 20:41
1
  • 1
    In addition to Mark's tip, there is a Tutorial at knowledge.safe.com/articles/1050/… that walks through the process in more detail. Commented Aug 15, 2018 at 5:13
0

You are using FME (Feature Manipulation Engine) to batch-transform multiple shapefiles stored in different folders. However, you are encountering issues with the attributes of the shapefiles, specifically with the "feature types to read" being bound to the shapefile used to insert the shapefile reader. You want to transform the shapefiles with the correct attributes and without any additional FME-specific attributes.

To address this issue, you can follow these steps:

1: Open your FME Workbench and ensure that the "Recreate source folder structure" option is enabled in the batch deployment settings. This will ensure that the output folder structure matches the input.

2: Add a Shapefile Reader to your workspace. Set the reader's parameters to read the shapefiles and their attributes. Make sure to set the "Feature Types to Read" parameter to "Read from Dataset" instead of selecting a specific shapefile. This allows FME to dynamically read the feature types from each input shapefile.

3: Connect the Shapefile Reader to the desired transformation or reprojector transformer (e.g., CSMapReprojector) in your workspace.

4: Add a Shapefile Writer to your workspace. Set the writer's parameters to write the transformed shapefiles. Ensure that you enable the "Don't write FME-specific attributes" option in the writer's parameters. This will prevent any additional FME-specific attributes from being written to the output shapefiles.

5: Connect the transformation or reprojector transformer to the Shapefile Writer.

6: Save your workspace and run the batch transformation process. FME will now read each input shapefile dynamically, preserving their attributes, perform the desired transformation, and writing the output shapefiles without any additional FME-specific attributes.

By following these steps, you should be able to batch-transform your shapefiles while maintaining the correct attributes and excluding any unwanted FME-specific characteristics in the output.and in addition you can check this https://www.kychub.com/dynamic-workflows/ and you can use this tool.

Vince
20.5k16 gold badges49 silver badges65 bronze badges
answered Jun 30, 2023 at 10:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.