Skip to main content
Solved

Generate sequence attributes along lines


danilo_fme
Evangelist
Forum|alt.badge.img+45

Hello Users,

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).

View original
Did this help you find an answer to your question?

6 replies

takashi
Evangelist
  • Best Answer
  • August 16, 2016

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).


mark2atsafe
Safer
Forum|alt.badge.img+45
  • Safer
  • August 16, 2016
takashi wrote:

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!

 

 


danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Author
  • Evangelist
  • August 16, 2016

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


mark2atsafe
Safer
Forum|alt.badge.img+45
  • Safer
  • August 16, 2016
danilo_fme wrote:

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!

 

 


takashi
Evangelist
  • August 17, 2016
danilo_fme wrote:

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

Yes, but I intend to use only features from the Cumulative port. See also the attached example (FME 2016.1.1): cumulative-sum.fmwt

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • August 17, 2016

if the lines are ordered (or can be ordered) you can also just take their lengths and use a attribute creator with lead or lag.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings