Skip to main content
Question

How can I get accumulation of length of a segmented lines?

  • November 3, 2017
  • 4 replies
  • 110 views

Forum|alt.badge.img

Hi,

For a given 2 lines (line_id1, line_id2), I should do LineOnLineOverlayor and then lengthcalculator.

After that I want to have the accumulation of length of the new segment of Line_id1.

Ex: length_accumulator of the first new segment = the same

length_accumlator of the second new segment = length_accumulator + length

And so on.

I’m using Counter (to have line_id1), then LineOnLineOverlayer (generate List line_id1_List) and finally AttributeCreator (length_accumulator).

What should I do to calculate the length_accumlator (I can not use length between coordinates because I have curve and polylines)?

Thanks

4 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 3, 2017

If i understand correctly..

You have the original id of lines line_id1, line_id2.

You do a overlayer and propagate this id.

Create new length attribute on the new segments.

Then a counter to create id the new segments.

To accumulate the lengths you can then use a statistics calculator with groupby original id and new id.


Forum|alt.badge.img+2
  • November 3, 2017

MeasureGenerator will give the the length, including the lengths along arcs. So if you can use PathBuilder, followed by MeasureGenerator, you'll get the true lengths along your lines. Use PathSpliter to break up your segments to their original pieces and extract the last measure with MeasureExtractor, which should be the accumulated length.


Forum|alt.badge.img
  • Author
  • November 4, 2017

thanks.

lets say line_id1 is segmented to 5 (could be less or more). Then I want the length of first new line (from start line_id1 to the end of first new line). The second from the start of line_id1 to the end of new second line. Is Statistic calculator doing that?


takashi
Influencer
  • November 6, 2017
miladahmad wrote:

thanks.

lets say line_id1 is segmented to 5 (could be less or more). Then I want the length of first new line (from start line_id1 to the end of first new line). The second from the start of line_id1 to the end of new second line. Is Statistic calculator doing that?

If it's sure that the segment features are input in the order from 1 to 5, yes the StatisticsCalculator can be used.

 

 


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