[GIS] FME Workbench: Merging Multiple Shapefiles into One Database Table

fmeshapefile

I'm new to FME Workbench, but have used Quick Translator for a while. What I have is a directory: C:\Mexico\Maps\Rural where I’ve extracted the Shapefiles for multiple states. Nothing else is in that directory, just 4 files per state (.prj, .shp, .shx, .dbf). In SSMS, I have a new database name MexicoRural. I would like to use FME to load all files from the directory into one table.

I've tried creating multiple workspaces and the best I can get is that it will load the first Shapefile, but not the others. Any ideas how to do this?

UPDATE: I modified the [FEATURE_TYPES] in Published Parameters and was able to get it to read all files, but it wrote each file as a separate table to SSMS. Below are my writer settings.

Here are my writer settings:

Best Answer

You seem to be using a dynamic workspace, which I don't think is right here.

Assuming you want FME to create the new table, the following steps should be what you need to do:

1) Open the Generate Workspace dialog (Ctrl+G)

2) Enter Shape as the source format

3) Use the browse button and select ALL of the shape files to be converted

4) Set the output format and parameters

5) Ensure Workflow Option is set to Static Schema and click OK.

6) In the newly generated workspace there are shape files on the left and tables on the right. You only want one table, so delete the others.

7) Draw connections from each input shape file to the remaining table

8) Open that table parameters and change the table name

If you want to write to an existing table, then you would delete all the Writer objects in step 6 (i.e. not leave one) then use Writers > Import Feature Type to import that table's definition.

I created a brief movie demonstrating these techniques. You can find it at: http://screencast.com/t/p7EeWAdJ

Related Question