Skip to main content
Solved

FeatureReader outputs only schema feature for first initiator.


nielsgerrits
VIP
Forum|alt.badge.img+54

Something I encountered recently: When I send multiple features into a FeatureReader, I only get one SchemaFeature. I expected one SchemaFeature per initiator feature.

As I needed a SchemaFeature per Initiator, I merged them using a FeatureMerger after the FeatureReader. But I keep wondering if this is how it is supposed to work?

Thanks!

Best answer by david_r

This is expected behavior, you only get one schema feature for each unique output schema. Is there any particular reason for needing one schema feature per input feature?

You do not need to use the FeatureMerger, just send the schema feature directly to the FeatureWriter. As long as the schema feature comes before the data features (default behavior), there is an implicit "FeatureMerger" inside the FeatureWriter, so no need to do it yourself.

View original
Did this help you find an answer to your question?

3 replies

ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • March 15, 2019

I would expect only one schema feature, if only one feature type is being read in the FeatureReader, irrespective of the number of initiators.


david_r
Celebrity
  • Best Answer
  • March 15, 2019

This is expected behavior, you only get one schema feature for each unique output schema. Is there any particular reason for needing one schema feature per input feature?

You do not need to use the FeatureMerger, just send the schema feature directly to the FeatureWriter. As long as the schema feature comes before the data features (default behavior), there is an implicit "FeatureMerger" inside the FeatureWriter, so no need to do it yourself.


nielsgerrits
VIP
Forum|alt.badge.img+54
david_r wrote:

This is expected behavior, you only get one schema feature for each unique output schema. Is there any particular reason for needing one schema feature per input feature?

You do not need to use the FeatureMerger, just send the schema feature directly to the FeatureWriter. As long as the schema feature comes before the data features (default behavior), there is an implicit "FeatureMerger" inside the FeatureWriter, so no need to do it yourself.

It is OK with me if this is the way it should work, I just wanted to make sure this is how it should work. Otherwise it would be a possible improvement.

My case: I have File GeodataBases where I want to remove records from different FeatureClasses, but not all FeatureClasses, where ID = 1 or 2 or 3. As the Schema is not fixed I am looking for a way to do this dynamic. So my current workflow is:

- Get the SchemaFeatures (FeatureClasses) of the to be cleaned up .gdb.

- Filter specific SchemaFeatures out of the stream.

- Merge the Features (suppliers) with the unfiltered Schema Features (requestors), create lists.

- Explode the lists.

- Send the Feature / Schema combinations to a FeatureWriter, writer mode delete, delete key field ID.

The big downside for me is that I get warnings when no features are found in a FeatureClass, but it works well enough.

I admit this is a bit sluggish, I would prefer to do this like in SQL (delete from FeatureClassA where ID in (1,2,3) ), but I don't know how and this is the best I found now. My limits are FME Server 2016.1.1, poor Python skills and gdb.


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