0

I can very easily deal whole TAB or DWG files directories (for example) using the "Single Merged Feature Type" option in the respective Reader. It takes all geometries encountered and allows me to use the GeometryFilter to deal with each geometry separately after reading files.

"Allowed geometries : All" is displayed in the reader

Surprisingly, I can't do this with shapefiles as easily. Every time I give FME a whole directory with different types of geometry shapefiles, FME takes the first feature he encounters and ignores the others or generates empty features.

"Allowed geometries : shape_pointz" is displayed in the reader (the first layer encountered was points). I guess it does "Schema from first feature '*.shp [SHAPE]'"

The only way to deal with my respectives layers is to check "Individual Feature Types" but it generates as many readers as different layers, which is not at all what i'd like to do (the same workflow as described here by Mark Ireland) : FME Workbench: Merging Multiple Shapefiles into One Database Table)

Question : How can I manage easily a directory of mixed geometries shapefiles to deal with them depending on their geometry ? It doesn't seem as easy as with other readers.

Please feel free to add comments if I'm not clear enough.

FME version : 2015

  • 1
    Related gis.stackexchange.com/questions/93806/… – Mapperz Aug 8 '16 at 15:50
  • Thanks Mapperz for the link. However, I tried the Generic Reader (safe-software.gitbooks.io/fme-desktop-advanced-training-2016/…) but I come back to my first problem (fme_point geometry type) :( Maybe i missed something... and choosing Single Geometry type creates a reader/layer (~1000 in my case...) – gisnside Aug 8 '16 at 16:22
  • 1
    I have to admit the dialog is confusing in what it states is "allowed", but that doesn't affect what is read by the Shape reader. If you choose multiple shapefiles, each of which has different geometry, they will still be read into the workspace. Or at least they should be and that's how it works on my machine (2015.1/2016.1). What happens on the Writer side depends on the format you're writing to and if the different source Shapefiles have different attributes. You might need to use a dynamic writer. You might not. I'd suggest taking this up with safe.com/support if it's still an issue. – Mark Ireland Aug 8 '16 at 19:55
  • Thanks for all those precision. I'm now able to deal with multiple geometry shapes in my workflow . It's still a bit confusing but I'll review this particular aspect of FME to feel more confortable, as I learn how to use it "on-the-fly" :) – gisnside Aug 9 '16 at 14:28
2

I finally solved my problem by using a Dynamic Reader + a Dynamic Writer at the same time by choosing Table Definition "Dynamic (Advanced)"

Create a Dynamic Writer

The trick is that FME displays an disturbing indication when one clicks on the Feature Type Properties of the Reader, so I thought it would create the wrong type of features geometry. In fact it displays only the first file it found in the feature types.

Overview Feature Type Properties

You can see in the previous dialog of the properties of the Reader "Allowed Geometries" is "Shape_pointz" but the GeometryFilter transformer says different : area, points and lines have been produced :

WorkSpace Overview

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.