My situation: I have connected lines with a attribute lengh each lines: _length.
I need to get this attribute _length and break in two anothers one: att_begin and att_end for each lines.
For example line 1: has the attribute _length = 39.7. I would like to take this and generate att_begin=0 and att_end = 39.7.
The line 2 has the attribute _length = 84. Is necessary to generate att_begin=39.8 ( in sequence number before ) and att_end=123.8 ( 39.8 + 84 ).
Attached my Source data.
Thanks :)
Best answer by takashi
Hi @danilo_inovacao, if you are looking for a way to sort the line features based on their connecting order, the LineJoiner and PathSplitter might help you.
LineJoiner: Set 'Yes' to the 'Preserve Lines as Path Segments' parameter, and specify a list name to store attributes of the input features.
PathSplitter: Specify the list name to the 'List Attribute' parameter.
The lines will be output from the PathSplitter in their connecting order. I think you can then calculate desired values with the StatisticsCalculator (use Cumulative port) or the AttributeCreator (Enable Adjacent Feature Attributes option).
Hi @danilo_inovacao, if you are looking for a way to sort the line features based on their connecting order, the LineJoiner and PathSplitter might help you.
LineJoiner: Set 'Yes' to the 'Preserve Lines as Path Segments' parameter, and specify a list name to store attributes of the input features.
PathSplitter: Specify the list name to the 'List Attribute' parameter.
The lines will be output from the PathSplitter in their connecting order. I think you can then calculate desired values with the StatisticsCalculator (use Cumulative port) or the AttributeCreator (Enable Adjacent Feature Attributes option).
Hi @danilo_inovacao, if you are looking for a way to sort the line features based on their connecting order, the LineJoiner and PathSplitter might help you.
LineJoiner: Set 'Yes' to the 'Preserve Lines as Path Segments' parameter, and specify a list name to store attributes of the input features.
PathSplitter: Specify the list name to the 'List Attribute' parameter.
The lines will be output from the PathSplitter in their connecting order. I think you can then calculate desired values with the StatisticsCalculator (use Cumulative port) or the AttributeCreator (Enable Adjacent Feature Attributes option).
+1 for the use of the StatisticsCalculator cumulative port. I would never have thought of that!
Hello @takahi and @Mark2AtSafe thanks yours answer.
I did put the these transformers on workspace and in the Transformer StatisticsCalculator the Attribute to Analyse is _length, correct?
Thanks
I think so. Then the _sum value in the features output through the Cumulative port will return the accumulated distance up to that point. That will be the final length and (_sum - length) will be the start point.
ps - hope you're enjoying the Olympics! Pity the soccer semis went the wrong way and the final couldn't be Brazil vs Canada. But I suppose there are plenty of Germans and Swedes here who would disagree!
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.