I need to get from an Excel configuration file a parameter for the Buffer distance of a Bufferer transformer.
What’s the best way to do this in order for the parameter to be accessible by the Bufferer transformer ?
I have tried the VariableSetter and VariableRetriever transformers but what I don’t like about it is that I give the value to every feature that passes through VariableRetriever.
Plus the VariableSetter/Retriever method doesn’t work well with cache.
Page 1 / 1
Hey Thimotee,
You can simply use an Excel Reader to read your configuration file, filter out the value you need, and then use a FeatureMerger to attach that value to all the features going into the Bufferer.
For ease, configure the FeatureMerger like this:
Treat your Excel row as the Supplier
Treat your dataset as the Requestor
Use a constant key (like “1=1”) to join everything
That way, you add the buffer distance from your config to every feature.
Note 1: You do need to give each feature the buffer value as an attribute. That’s just how the Bufferer works.
Note 2: I’d stay away from VariableSetter/VariableRetriever. It’s kind of like spaghetti code—harder to debug and doesn’t play nice with caching.
If you don’t wan’t the buffer value on your features, you could a use a workbench runner
Parent workbench would read the excel file, apply any filter and then the workbench runner would trigger the child workbench and pass the buffer distance to a published parameter for the buffer distance in the child workbench.