Skip to main content
Hi there,

 

 

I've created a workspace you can point at any folder containing multiple shape files, and outputs an access mdb files that simply summarizes the counts and present attributes for each shape. The problem is however, FME seems to ignore “Empty” shape files. This is somewhat understandable, but is there any way I can bypass it? The nature of the tasks this workbench has to perform dictates that it also needs to list the empty features. The count will be zero for these specific layers, but I still need them to be added to the output file.

 

 

I’ve done several tests, and it doesn’t seem like the empty layers get thrown away at any of the specific transformers, so I’m guessing that it’s an inherent feature of FME it self? Or am I missing something?

 

 

 

Thanks in advance,
Hi,

 

 

Have you tried the Schema (Any Format) reader ?
Hi there,

 

 

I just tried it, and it still skips the empty shape files...
Hi,

 

 

Feature type name of a shape data is same as its file name.

 

Can the Directory and File Pathnames reader help you?

 

 

Takashi

 

 


Hi,

 

 

unfortunately, copying empty tables isn't something FME is very good at.

 

 

There is a NoFeaturesTester custom transformer in the FME Store (which will work fine for small to medium sized datasets), but it will not copy the schema of your empty features, only detect them. Depending on your skills and the formats involved, it might be possible to handle these feature types manually, but I've yet to find an easy solution for this that didn't come out very "hack-ish" in the end.

 

 

I recommend you contact Safe to get added to the list of those interested in an improvement in this area. You'll have, at the very least, the company of my name on that list ;-)

 

 

David
Ahh I see.

 

 

Thanks a lot David, I think I'll do exactly that 🙂
I would try using the Directory/Files Reader to get a list of files (as a separate part of your existing workspace). Then match up that list to the list of features with the FeatureMerger.

 

 

Any directory/file feature without a match you can assume to have zero features in that file.

 

 

The other thing I remember about this sort of task, is maybe set the advanced parameter "Ignore Failed Readers" to Yes. Then if a file meant to be read is missing altogether, the translation won't fail. Don't know if that helps here but I thought I'd mention it.

 

 

Hope this helps - and yes, please do contact support (safe.com/support) if you need further assistance or have an idea for a product enhancement,

 

 

Regards

 

 

Mark

 

 

Product Evangelist

 

Safe Software Inc.

Reply