Solved

How do you batch translate from Shapefile to GeoPackage


Badge

I have a number of shapefiles which I want to translate to Geopackage.

However I want the original shapefile name intact. So just a one on one batch shapefile to geopackage translation

 

I thought that the FME Quicktranslator app would be handy in this situation, however, it asks me to specify a database connection, even though I want all the individually translated shapefiles as separate .GPKG files in a destination folder.

 

In FME Workbench, a specific filename is also required to translate shapefiles into, and there is no way (as far as I can tell) to let this be a dynamic name based on the fme_basename attribute. Note that I do not want to have a single geopackage file with all the shapefiles combined in it.

 

How do I do this?

 

Thanks for your time.

 

icon

Best answer by rahulsharma 28 May 2021, 23:56

View original

2 replies

Badge +8

hi @wolters​ 

you can use Data Fanout (see article) for this workflow.

Please see attached workflow using Dynamic Workflow as an example.

Badge

@rahulsharma​ 

Ah, great. I looked and tried your workflow using batch commands, but it does not do exactly what I want as it still combines everything in one dataset but then under multiple tables, but after looking at the article I did adjust it in a way to make it do what I want.

  • Add 'FME Basename'  to the exposed attribute of the input shapefile
  • Click Fanout Dataset under the writer on the menu on the left, and add the following as the fanout expression
@Value(fme_basename).gpkg

Still not quite sure how to do it in FME Quick Translator as there does not seem to be an option to fanout datasets, it all gets merged instead, or a database connection is required. But using the above in FME Workbench is a good workaround, I guess. 

Reply