Skip to main content

I receive an empty shapefile from our client and if I don't add any features, have to rename it.

Since FME is feature based it won't write to a new shapefile if empty.

 

The shapefile can also not contain a null feature so the NoFeatureTester or a null Creator is not an option.

I'm currently on FME version 2019.2.1

 

How can I write empty shapefiles?

I think if the empty shapefile already exists, you can use a FileCopyWriter to rename it


You can also create an empty shapefile by passing a feature with no geometry and no attributes. See the lowest branch in the illustration below.

FME Hub contains several transformers that can test for the absence of features.

QGIS will open this shapefile, as will FME Data Inspector (but with a warning).

Create_empty_shapefile_workflow


I think if the empty shapefile already exists, you can use a FileCopyWriter to rename it

The filecopy writer did the trick indeed, using the NoFeaturesTester I check for empty shapefiles and if so, copy the base to my results folder.imageGood to know: the filecopy_source_dataset & filecopy_dest_filename have to be set using an attributecreator


Reply