Skip to main content
Question

Create a new file geodatabase for each translation


tsphelele
Contributor
Forum|alt.badge.img+1

Hi guys,

I am trying to automate a process which requires to write into a new file-geodatabase everytime I run a translastion. Essentially I am reading data from 1 database trying to stage it in a new geodatabase and then moving it to its final destination. I am using FeatureWriter to continue the translation but i am getting a geodatabase is locked error. That is why I am trying to create a new file geodatabase for the staging part of the process as this is where the error keeps on occurring. Is there a way that FME workbench can create a new file geodatabase for my feature classes in a same workbench?

Thanks!

4 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

I’m not sure what you’re requirements are for naming, however, you can configure the filename of the geodatabase from attribtues, for example an id ur uuid. 

 

In the case above I’ve created an attribute called “id”, this will be used to build the filename.

I’m not sure if this answers your question here though.

Another option could be to create a temporary location, there is a transformer called “TempPathnameCreator”. This creates a folder in your system temp folder, you can output your temp data there. The geodatabase will automatically get deleted when the workspace finishes running. 


tsphelele
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • July 12, 2024

Hi virtualcitymatt

I'm moving about 13 feature classes so I'm not sure where you have created this attribute called “id”. 


nielsgerrits
VIP
Forum|alt.badge.img+54

When I need this I use a scripted parameter (Navigator, User Parameters) to generate a datetimestamp which I use for the filename of the featureclass.

import datetime return datetime.datetime.now().strftime("%Y_%m_%d__%H_%M_%S")


virtualcitymatt
Celebrity
Forum|alt.badge.img+35
tsphelele wrote:

Hi virtualcitymatt

I'm moving about 13 feature classes so I'm not sure where you have created this attribute called “id”. 

In this case I just used an AttributeCreator transformer just to show the example for the screenshot. You need to figure out a method you like. I think using the scripted parameter that @nielsgerrits suggested could is nice because it will just always create a new geodatabase with the timestamp on it. 
You just need to use the Parameter in the file path instead of an attribute.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings