Skip to main content
Solved

"Feature reader - dynamic" question

  • July 6, 2021
  • 6 replies
  • 75 views

I have a py script. It takes in 3 parameter,

  1. Input file gdb
  2. FeatureClass name
  3. Output file gdb

What it does, is to copy the contends of the featureclass to the outputfile gdb and I would like to convert it to FME

 

Can some help me with this conversion? Please remember it may be configured for any filegdb and any featureclass name so a static linking won't work. My initial findings is the use of "Generic" option of FeatureReader

Best answer by jkr_wrk

Here it is:

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.

6 replies

david_r
Celebrity
  • 8392 replies
  • July 6, 2021

I would avoid using the Generic reader. Starting with an empty workspace:

  • Add a File Geodatabase reader and make sure to specify "single merged feature type" to enable dynamic schema.
  • Add a File Geodatabase writer and make sure to specify "Feature class or table definition" = "Dynamic (advanced)"
  • Connect the reader to the writer

You now have a workspace with three published parameters, which should do what you want:

  1. Input file gdb ("SourceDataset_GEODATABASE_FILE")
  2. Feature class name ("FEATURE_TYPES"). This can also be a list of several feature class names.
  3. Output file gdb ("DestDataset_GEODATABASE_FILE")

jkr_wrk
Influencer
Forum|alt.badge.img+35
  • 424 replies
  • Best Answer
  • July 6, 2021

Here it is:


  • Author
  • 15 replies
  • July 16, 2021

Oh damn. I broke my head trying to get this. Thanks David and jkr


  • Author
  • 15 replies
  • July 16, 2021

One more question, suppose I have to do a transalation say filter certain records, what are the options?

 

 


david_r
Celebrity
  • 8392 replies
  • July 16, 2021

One more question, suppose I have to do a transalation say filter certain records, what are the options?

 

 

You can insert a Tester or a TestFilter between the reader and the writer. If you want to filter by feature class, make sure you expose fme_feature_type on the reader, it will contain the feature class name.


  • Author
  • 15 replies
  • July 17, 2021

You can insert a Tester or a TestFilter between the reader and the writer. If you want to filter by feature class, make sure you expose fme_feature_type on the reader, it will contain the feature class name.

I am looking at the workspace by jkr_da. if you downloaded that, I feel you can get the problem I am facing.

He is using a featureReader and exposes the schema and data. How do I handle that situation? Does FME have an InMemory-Table transformer?