Best answer by erik_jan
View originalConvert multiple ESRI shape files into SQL Server Geography
Two ways of doing this:
1) Point the Shape reader to <your folder>\\*.shp to read all Shape files in one go
2) Create a workspace to process 1 Shape file and a "runner" workspace using a "Directory and File Path" reader. This reader gets the file names (shp files) and not the contents. Follow the reader by a WorkspaceRunner transformer to call the workspace for processing a Shape file and pass the attribute containing the file name to the parameter in the WorkspaceRunner. This will create a loop to run the same workspace for each Shape file in the folder.
Option 1 is the easier, option 2 more flexible.
Hope this helps.
Hi @chapmans1982, As erik_jan mentioned both the above-mentioned steps would work, but just want to clarify the following
Incoming shapefiles have identical SCHEMA
Or else, the schema will be taken from the 1st incoming features and geometry and attributes will be written to same SQL table.
Under MSSQL Spatial Writer --> Parameters --> SpatialType > Set Value to Geography
Please find attached Template using FME tutorial data esrishape2mssql_spatial.fmwt
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.