I am processing a dataset of rainfall values. For each feature, I have 365 values in a list. I am using BulkAttributeRenamer to convert the list values to 365 attribute columns. The result is badly ordered. I was expecting the new columns to be ordered numerically, but they are scrambled up. It will take me a very long time to correct the order by hand.
Best answer by takashi
Got it, it's just annoying indeed.
It could be a workaround if you have exposed the list elements under the RasterCellCoercer and set All Attributes to the Rename parameter in the BulkAttributeRenamer with the Regular Expression Replace action.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
It's fairly easy to do this in Python, where the order is guaranteed. For example something like:
def FeatureProcessor(feature): list_values = feature.getAttribute('_list{}.item') for n, value in enumerate(list_values): feature.setAttribute('item_%0.3d' % n, value)
Could you please explain the situation more specifically?
How did you configure the transformer parameters?
Where/How do the attributes appear scrambled up?
and so on.
[Addition] What version of FME are you using?
The original dataset is a NetCDF file of rainfall in Australia.There are 365 bands, representing the rainfall on each day of the year. Spatially, the data is a 5km grid over Australia.
I use RasterCellCoercer to convert each grid pixel into a square polygon, each feature has a list, _band{}.value
I use BulkAttributeRenamer to convert the list values into attribute values. This is where the problem occurs.
Attributes to Rename, I choose Selected Attributes
I tick _band{}.value
I am then prompted to select the list elements, and I enter 0-364
It could be a workaround if you have exposed the list elements under the RasterCellCoercer and set All Attributes to the Rename parameter in the BulkAttributeRenamer with the Regular Expression Replace action.
It could be a workaround if you have exposed the list elements under the RasterCellCoercer and set All Attributes to the Rename parameter in the BulkAttributeRenamer with the Regular Expression Replace action.
It could be a workaround if you have exposed the list elements under the RasterCellCoercer and set All Attributes to the Rename parameter in the BulkAttributeRenamer with the Regular Expression Replace action.