Question

Read in feature class from output of a transformer


Hi,

 

I am trying to read in a feature class, the name of this feature class depends on the output of another reader/transformer.  I may be missing something simple (like schemas) but I can't seem to find this.  

 

 

More specifically I am reading in feature classes from a database, I want to compare the names to a diffTable in the database to see if there are new feature classes or edits that have been made.  I am stuck at the part where I have say 2 new feature class (names) and I want to read those and write them out to another database (just as they are, in 2 seperate feature classes).  I have access to desktop and server.  I was thinking of chaining or using server to run them. 

 

Thanks for any advice.

5 replies

Badge
FeatureReader transformer should allow you to do what you want. You will probably need to hardcode it within the transformer to start with (because it doesn't like dynamic variables through the wizard) but you can set the dynamic values under the transformer in the Navigator window (e.g. in the left window). For example, feature types to read may be @Value(attribute1).....attribute1 might contain "Layer1 Layer2"
Badge +3
Hi,

 

 

You can indeed use a feture reader.

 

And you can parametrise it.

 

 

 

Insert a FeatureReader. Fill it out for the type you wish*.

 

In the navigator make everything you think uyou need a parameter (easist way is to right click and create user parameter while accepting standard).

 

Do not refill the FeatureReader (leve it as it is with a "blank" format).

 

Save this.

 

This workspace now can only be run using a workspacerunner.

 

 

In new wrokspace use a WorkSpaceRunner to call created workspace.

 

Now u see alll the public parameters are accesable.

 

 

 

*i have not managed ( it seems impossible) to make "FORMAT" a parameter and "Feature Types to Read" parameter is limited by "FORMAT" as well.

 

So dynamic thing works for 1 type.

 

If you need more types, you must make several dynamic featuretype readers and use tester to select one.

 

 

Thank you for the replys.

 

 

The thing is that I dont know what type (or in my case a postgis feature class) will need to be read in.  I wanted to have the feature class name parameters be sent in from the other workspace.  I have 200 fc or tables to choose from and only selected ones need to be read in.  So I suppose there isn't a way to do this? 

 

 

When I add a feature reader it asks for the input parameters (postgis), then while connecting it asks for the constraints(table list) where I am forced to pick a table.  This is the point where I was hoping I could pass this bit of information in dynamically.  

 

 

Badge
The "constraints" table list manifests itself as the "Feature Types to Read" parameter on the reader. If you are going to call another workspace to do the processing then you need a string parameter that you will set to the names of the tables to read:

 

  1. Add the PostGIS reader and choose an existing table in your database for the tables constraint
  2. Make sure the option "Single Merged Feature Type" is selected
  3. Press OK to add the reader to the workspace
  4. Look in the "Advanced" parameters for the newly added reader and notice the "Feature Types to Read" has been automatically turned into a published parameter (defaults to FEATURE_TYPES)
  5. When you run the workspace set the value of FEATURE_TYPES to the tables you want to have read - for multiple tables separate them with a space
So from your main workspace you can build a list of tables you want to read in the other workspace, then use ListConcatenator with space as the separator to create the string you need to pass as the value for FEATURE_TYPE then use WorkspaceRunner. The great thing about this approach is that it will work for 1 feature class or many.
Badge +3
I thpughtk the problem was that he wants to not have to constrain it to a type at all.

 

 

Like when i make it dynamically read csv's it cant be used to do say shapefiles or whatever.

 

Then i need to make another for that type, or can i?

Reply