You could agreggate your features into just one and build a list with name and value using the Agreggator transformer.
Then you could put a Tester to check the condition. If "Passed" add a FeatureReader to read again the original input data and store it into a file.
@oscard,
Thanks. Conceptually, I think that might work except that these features all are ready created and aggregated from multiple sources, so rereading and reprocessing them could be a bit of an issue. I do have a Tester set up for the conditions, but I can't figure out how to write all of the features if one of the conditions passes.
I'm presuming you have something that identifies the 6 features as being related to each other?
In which case you can send all the features to the sampler to get just one per group, then send all the data to a featuremerger as requestor and the sampled passes to the supplier, joining on whatever attribute identifies the 6 features as being the same group
Hi @billybob,
Alternatively you could transpose the table using the method outlined by Takashi in this post. Now you will have a single Feature containing all the names/values so you can then use the Tester with OR logic and connect the Writer to the Passed port only.
If you need to revert the feature back into it's original state before the writer you can use an AttributeExploder to get name/value pairs again.
@oscard,
Thanks. Conceptually, I think that might work except that these features all are ready created and aggregated from multiple sources, so rereading and reprocessing them could be a bit of an issue. I do have a Tester set up for the conditions, but I can't figure out how to write all of the features if one of the conditions passes.
OK. This is not going to be a pretty solution, but ii could work:
Let's call your processed data (the one from your screenshot) Point A.
From Point A, you could do what I have said in my previous post. Adding at the end an AttributeCreator to create an Attribute whose value would be Passed or Failed depending on the result of the Tester. The output of this AttributeCreator would be Point B.
Add a FeatureMerger after Point A.
- Requestor: data from Point A
- Supplier: data from Point B
The join condition would be 1 = 1, so all of the data of the Point A would have the value of the attribute created in Point B that contains "Passed" or "Failed".
The Merge output would be Point C. Add a Tester to test Point C data checking if the attribute created contains Passed or Failed. If Passed, you store the data. If Falied, you don't do anything.
Too messy?
A cleaner way would be a PythonCaller with a Python script to check the conditions, but that could be more complex depending on your Python skills.
@billybob Just adding to @oscard 's thoughts. Aggregator with lists should do the trick (followed by ListExploder after your test) - provided you have some way (a key) to uniquely join the records. Use this 'key' in the Group By of the Aggregator.
Geometry: If several of the features have geometries, then you need to preserve those somehow. the easiest is to use the GeometryExtractor to save the geometry as an attribute. before you write those records use GeometryReplacer.
So in summary you'd have something like:
GeometryExtractor (those features that have a geometry)
Aggregator (or FeatureMerger or ListBulider)
TestFilter
ListExploder
GeometryReplacer (those that have a geometry)
I appreciate everyone's help and input! I took a little bit from everyone's suggestions and came up with a solution. Maybe not as elegant, but it works. I did aggregate my features, and then I created an attribute, burnbanPassed, to bet set to either "passed" or "failed" for each feature as it was tested. As @oscard suggested, I opted to use a PythonCaller to test if any of the feature had "passed", and if one or more did, then all the features were set to "passed". I don't think I made clear that it was an all or none proposition.
Thanks again for the assistance!!
Test clauses in the AttributeManager.