Hi
How about using the BoundsExtractor?
David
It's not particularly elegant, but create an attribute called JOIN with a value of 1 on each line in the above, then use a featuremerger, merging with the JOIN attribute with the attributes going into the requestor and your feature containing the coordinates into the supplier port
Hi @lavairye, you can use the FeatureMerger to merge the attributes which store the coordinates to every feature unconditionally. Send the original features to the Requestor port, send the feature from the CenterPointExtractor to the Supplier port. Then, set an identical constant value (e.g. 1) to the "Join On" parameter for both Requestor and Supplier.
Hi @lavairye, you can use the FeatureMerger to merge the attributes which store the coordinates to every feature unconditionally. Send the original features to the Requestor port, send the feature from the CenterPointExtractor to the Supplier port. Then, set an identical constant value (e.g. 1) to the "Join On" parameter for both Requestor and Supplier.
my answer is completely the same as egomm's :)
Another approach.
- Once aggregate all the original features by the Aggregator. Set "No" to the "Keep Input Attributes" parameter, and specify a list name with the "List Name" parameter.
- Extract the center coordinates of the aggregate feature with the CenterPointExtractor.
- Restore the original features by the Deaggregator. Set the list name to the "List Attribute to Explode".
Thanks for all. Using featuremerger with a constant value for "join" work well, and thanks to takashi for his second approach which is quite elegant !
Create a line from an arbitrary point within your dataset. (2 vertexcreators, one replace the other add).
Extract lenght and angle of this line.
Unconditionaly merge this to all objects in the set. (or aggregate the set and link data tot the aggregate wich is 2 transformers more...)
Then use an affiner
1,0,Lenght*@cos(Angle/180)*$(Pi))
0,1,Length*@sin(Angle/180)*$(Pi))