Try the ListExploder transformer - that gives you a feature for every list member of every element
thanks. ListExploder will give me the same numbers of geometry before doing aggregate. Example : if I have 10 lines in the same position, then I want to have one line with all attributes of the 10 lines (without doing concatenate).
@miladahmad
Your requirement only needs indeed a listexploder, it gives u a _element_index after exploding.You can concatenate on that.
Be careful extracting listelements or exploding lists after aggregating if sorting the list is involved. (at least up to 2016 version something)
If u sort the list, elements can end up on the wrong geomtry. Sorting should be done prior to aggregating.
Best to use part extractor or deaggregator.
Hi @miladahmad, you can rename list elements to attribute names with a common format containing corresponding index using the BulkAttributeRenamer. Also, if you have exposed the list elements in a transformer interface beforehand, the new names will also be exposed.
thanks for all.
@gio : ListExploder give me many geometries which I do not want. ListAttributEexploder give me a strange things. Also, I do not want to use concatenate (if I want to concatenate then I can do it directly with the aggregator). What I need is one line with many fields of all the lines example : index_1_attribute1,
index_2_attribute1, index_3_attribute1, etc.
I thought it should be easier with python or loop (but I'm not good enough to do it)
I will try the solution of @takashi and then I will write again.
Hi @miladahmad, you can rename list elements to attribute names with a common format containing corresponding index using the BulkAttributeRenamer. Also, if you have exposed the list elements in a transformer interface beforehand, the new names will also be exposed.
thanks a lot for your help. It's works and It's exactly what i need.
ah, you want to merge the attributes of the overlaps to one record (1 line)
problem is dynamicaly exposing the creted attribute.
Bulkattribute renamer does not rename a existing attribute in @takashi 's example. Just adding listelement index to a string.
You would need a attribute exploder to get the actual attribute name.
And there is the problem, you cant use them (attributes) in the replacer.
ah, you want to merge the attributes of the overlaps to one record (1 line)
problem is dynamicaly exposing the creted attribute.
Bulkattribute renamer does not rename a existing attribute in @takashi 's example. Just adding listelement index to a string.
You would need a attribute exploder to get the actual attribute name.
And there is the problem, you cant use them (attributes) in the replacer.
it works. it give me x0_ActualAttribute1, x1_ActualAttribute1, x2_ActualAttribute1, etc. the bulkAttributeRenamer parameter from Takashi is the secret :)
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
How did you configure the destination schema for the Shapefile writer feature type?
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
I just exported the result from the inspector. And Now I tried to copy attribute from BulkAtttributeRenamer but it does not work. How should i configure the destination (shape or gdb)? thanks
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
A possible reason is that the attribute names are longer than 10 bytes (characters). According to the Shapefile format specification, the length of field names should be up to 10 bytes
If a field name was longer than 10 bytes, it would not be mapped to the writer feature type schema automatically when you copied it from the BulkAttributeRenamer. You will have to make each field name 10 bytes or less, or map them manually like the second writer feature type in this screenshot.
Additionally, in the File Geodatabse specification, the length of field names is limit to 64 characters.
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
it did not work even with gdb. I hope that there is no misunderstanding
(sorry). So the Feature information give the good result but the table
view is not what I want. Actually I do not want to separate information
like shape1 and shape2. Lets say we have 3 lines with id, color, type
and cod. What I'm doing is aggregate and generate a list to have only one line. I want to have x0_color, x0_type, x0_cod, x1_color, x1_type, x1_cod, x2_color, x2_type, x2_cod.
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
Since you can see desired attributes in the Feature Information window of Data Inspector, those could be written into the destination dataset if you configured user attributes in the writer feature type appropriately.
How did you configure the destination schema for the writer feature type? Do the writer feature type have those attribute definitions?
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
but why I do not see the same information in the table view (inspector)? I think in the feature information we can see them because we change the word _list{} to x but it still a list.
but why I do not see the same information in the table view (inspector)? I think in the feature information we can see them because we change the word _list{} to x but it still a list.
The Table View shows exposed attributes only. If you haven't exposed the attributes in the workflow on the Canvas, naturally they don't appear on the Table View.
@takashi:
I can see
the attributes in feature information (inspector) but when I export the result
to shapes I do not see them!!
ok. then If I have 5 attribute then I should expose them one by one (it should work now because I exposed _list{} without specifying the attribute (that what I hoped to have with my question from the begining :)).
I'm thankfull for your time and your help.
Hi @miladahmad, you can rename list elements to attribute names with a common format containing corresponding index using the BulkAttributeRenamer. Also, if you have exposed the list elements in a transformer interface beforehand, the new names will also be exposed.
Thanks Takashi!