Question

chop the lines by length

  • 7 January 2020
  • 7 replies
  • 40 views

Badge

Hi!!! I have a project need to cut these (M)lines by length

for example: there are line 1 is 13 miles long and line 2 is 16 miles long.

I need to chop these 2 line by every 5 miles. as I have picture below, line 2 begin measure at 3th mile not 0.

any idea how to do this? thanks


7 replies

Badge +2

Hi,

Have you tried "Chopper" with mode "as Length "?

Badge

Hi,

Have you tried "Chopper" with mode "as Length "?

yes, I did but the chopper cut lines start measure at 0.

I would like they continue measure whatever previous line left (as picture)

Badge +2

yes, I did but the chopper cut lines start measure at 0.

I would like they continue measure whatever previous line left (as picture)

In the example provided, after 3 miles (in Line#1) you are considering 2 miles from other line (from Line#2).

Are you sure that line #1 does not have break at intersection in entire data?

Badge

In the example provided, after 3 miles (in Line#1) you are considering 2 miles from other line (from Line#2).

Are you sure that line #1 does not have break at intersection in entire data?

Hi pratap,

look like chopper just chop existing vertex. So if you have a polyline with a great distance between vertices, your results might be very approximate....: https://knowledge.safe.com/questions/36693/problems-with-chopper-when-trying-to-chop-by-lengt.html

so i don't think chopper is not tool for my case

Badge +2

Hi pratap,

look like chopper just chop existing vertex. So if you have a polyline with a great distance between vertices, your results might be very approximate....: https://knowledge.safe.com/questions/36693/problems-with-chopper-when-trying-to-chop-by-lengt.html

so i don't think chopper is not tool for my case

We can use Densifier and add vertices as required and remove later.

But are you sure that line #1 does not have break at intersection in entire data?

Badge +2

@knfme2019 Are you sure Chopper By Length doesn't give you what you need? For each line that is chopped, it preserves the original measures. Perhaps include a small example dataset and show the community the results you'd like to see.

Userlevel 2
Badge +16

Hi @knfme2019, I think the difficulty is that the two lines are not connected at their end nodes.

A possible way I can think of is, create a network topology from the two lines with the TopolgyBuilder, find the shortest path from the start node to the end node with the ShortestPathFinder, and then split the path into segments having an identical length with the LineDivider (from FME Hub).

See also this workspace example that demonstrates the procedure above: chop-lines-by-length.fmw (FME 2019.2.2)

Result

Reply