Skip to main content
Solved

How do you batch translate from Shapefile to GeoPackage

  • May 28, 2021
  • 2 replies
  • 229 views

wolters
Contributor
Forum|alt.badge.img+6

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.

 

Best answer by rahulsharma

hi @wolters​ 

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

Please see attached workflow using Dynamic Workflow as an example.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

rahulsharma
Safer
Forum|alt.badge.img+10
  • Safer
  • Best Answer
  • May 28, 2021

hi @wolters​ 

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

Please see attached workflow using Dynamic Workflow as an example.


wolters
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • May 28, 2021

@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.