Files
Introduction
To create an empty Esri shapefile with no data but a set schema, you only need a Creator transformer and an Esri Shapefile writer. You can also use this method for other single-geometry-type formats.
For formats that use template files, such as Esri geodatabase or AutoCAD. For information regarding a Geodatabase template file, please see Esri Geodatabase Writer Parameters and Converting to Geodatabase Format. For AutoCAD template files, see Autodesk Writer Parameters.
Step-By-Step Instructions
1. Add a Creator Transformer
In a blank FME Workbench canvas, add a Creator transformer. Open up the Creator and ensure that the Geometry Object is set to Null. If you are using an older version of FME and the Null option is not available, set the Geometry Object to a different geometry type than what you want the shapefile to contain. For example, if you are creating polylines, you would set the Creator to points.
2. Add an Esri Shapefile Writer
Next, add an Esri Shapefile writer to the canvas. Select where you want to save the file, then change the Shapefile Definition to Manual. Click OK to add the writer.
In the Feature Type dialog that appears, set the Shapefile Name to the name you want for the file, then change the Geometry to the geometry output type you want.
3. Set Schema
Still in the Feature Type dialog, change to the User Attributes tab. Double-check that the Attribute Definition is set to Manual. Then, under Name, create the attribute schema you want to write to the shapefile. In this example, we created the attributes: Name, Date, and Area. You can also set the attribute types. In this example, the attribute types are char, date, and long, respectively.
4. Connect Writer and Run the Workspace
Once you set up the attribute schema, click OK to close the dialog, then connect the writer to the Creator.
Run the workspace and view the output to confirm that the schema was created correctly.