Skip to main content
Question

Connecting lines with the same network id


fmenco
Contributor
Forum|alt.badge.img+5

Hi,

 

I have a linenetwork that consists, of numerous connected and none- connected linesegments. I want to connect all the lines that belong to the same network, and then split them again on locations where they intersect with points from a different dataset.

It's the first part, connecting/combining the lines that belong to the same network, where there are problems. I still get individual/not connected linesegments where I would have expected just one whole connected line.

 

This is what (part of) the workbench looks like. I've also implemented the steps given in this post, https://knowledge.safe.com/questions/57491/joining-of-two-lines-where-more-than-two-intersect-1.html

however no luck. I did with both a max modulo count of 2 and 1.

14 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

I think you've set up that LineCombiner with both a group by and a combine on, so that means that it will combine adjacent lines with the same value for _network_id but only in groups of lines with the same value for pol_count. If you take out that Group By it should yield a better result.


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 7, 2019
redgeographics wrote:

I think you've set up that LineCombiner with both a group by and a combine on, so that means that it will combine adjacent lines with the same value for _network_id but only in groups of lines with the same value for pol_count. If you take out that Group By it should yield a better result.

Hi, I just tried this, but the results are not better unfortunately. I have 126 networks in this datasets, so I was expecting 126 lines. The results are way off in both what I did first,and what i just implemented (endresult 13K plus).


redgeographics
Celebrity
Forum|alt.badge.img+49
fmenco wrote:

Hi, I just tried this, but the results are not better unfortunately. I have 126 networks in this datasets, so I was expecting 126 lines. The results are way off in both what I did first,and what i just implemented (endresult 13K plus).

If one network can consist of multiple disjointed parts a LineCombiner won't create a single one out of it, for that you'll also need to use an Aggregator.

Any chance you can share the data here?


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 7, 2019
redgeographics wrote:

If one network can consist of multiple disjointed parts a LineCombiner won't create a single one out of it, for that you'll also need to use an Aggregator.

Any chance you can share the data here?

No, unfortunately I can't share the data...:-). I started off with an Aggregator, with a group by the network_id, and yes that does work. However, when I wanted to implement the next step, which was to " split the lines again on locations where they intersect with points from a different dataset", a pointonlineoverlayer would deaggregate everything again. And I don't want that. Maybe I should do the pointonlineoverlay first, and then try to combine or aggregate?


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 7, 2019

@francois_binnem. I created a separate post..., your input is welcome... :-)

@mark2atsafe

@takashi


redgeographics
Celebrity
Forum|alt.badge.img+49
fmenco wrote:

No, unfortunately I can't share the data...:-). I started off with an Aggregator, with a group by the network_id, and yes that does work. However, when I wanted to implement the next step, which was to " split the lines again on locations where they intersect with points from a different dataset", a pointonlineoverlayer would deaggregate everything again. And I don't want that. Maybe I should do the pointonlineoverlay first, and then try to combine or aggregate?

Yes, give that a try and see if it works out for you.


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2019
redgeographics wrote:

Yes, give that a try and see if it works out for you.

I've been trying that, but it doesn't work either. I feel like I'm overthining something....:-)

I just want to create a long line, and then split that line again where certain points intersect.

is there a way to transform the aggregated features in such a way that for instance a pointonlineoverlayer interprets them as one feature, and/or doesn't deaggregate or reject them?

Or is it possible to just recreate new lines from existing nodes, and having the lines stop where I want them everytime they reach certain points in the dataset?


redgeographics
Celebrity
Forum|alt.badge.img+49
fmenco wrote:

I've been trying that, but it doesn't work either. I feel like I'm overthining something....:-)

I just want to create a long line, and then split that line again where certain points intersect.

is there a way to transform the aggregated features in such a way that for instance a pointonlineoverlayer interprets them as one feature, and/or doesn't deaggregate or reject them?

Or is it possible to just recreate new lines from existing nodes, and having the lines stop where I want them everytime they reach certain points in the dataset?

Hard to say without a sample I'm afraid (I'm the "let's poke it and see what happens" kind of person)


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2019
redgeographics wrote:

Hard to say without a sample I'm afraid (I'm the "let's poke it and see what happens" kind of person)

Hi,

 

This is what my data looks like schematically (see image). On the left is what my dataset is now, on the right is what I want. Keep in mind that the blue and black lines are lines with different attributes that I need to keep separate. I want to combine all the individual lineelements up untill the poit where they reach one of those red points. By the way, I just installed FME 2019, but I've noticed that the linebuilder here doesn't have a connection break attribute?


redgeographics
Celebrity
Forum|alt.badge.img+49
fmenco wrote:

Hi,

 

This is what my data looks like schematically (see image). On the left is what my dataset is now, on the right is what I want. Keep in mind that the blue and black lines are lines with different attributes that I need to keep separate. I want to combine all the individual lineelements up untill the poit where they reach one of those red points. By the way, I just installed FME 2019, but I've noticed that the linebuilder here doesn't have a connection break attribute?

Assuming there's a way to separate the black and blue lines... In broad terms, a LineCombiner with grouping set to that attribute followed by a PointOnAreaOverlayer (if necessary snap the points to the lines first using an AnchoredSnapper).

The LineCombiner should join up all lines that are connected and have the same values for the attribute(s) you're grouping on.

Strange about the LineBuilder, I'm on 2019.0 and the parameter is still there.


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2019
redgeographics wrote:

Assuming there's a way to separate the black and blue lines... In broad terms, a LineCombiner with grouping set to that attribute followed by a PointOnAreaOverlayer (if necessary snap the points to the lines first using an AnchoredSnapper).

The LineCombiner should join up all lines that are connected and have the same values for the attribute(s) you're grouping on.

Strange about the LineBuilder, I'm on 2019.0 and the parameter is still there.

This was my first approach, but it didn't combine lines where there where more than 3 intersections. I was still left with a lot of individual segments. Right now, I'm just trying to get the relevant nodes through a topology builder and I'm trying to reconstruct the line (with a linebuilder) up until it encounters one of the red points, but I'm afraid that won't take care of the "more than two intersections" either. Thank you for your help, and with thinking along...:-)


fbinneman
Contributor
  • Contributor
  • August 13, 2019
fmenco wrote:

No, unfortunately I can't share the data...:-). I started off with an Aggregator, with a group by the network_id, and yes that does work. However, when I wanted to implement the next step, which was to " split the lines again on locations where they intersect with points from a different dataset", a pointonlineoverlayer would deaggregate everything again. And I don't want that. Maybe I should do the pointonlineoverlay first, and then try to combine or aggregate?

Hi fmenco

On your solution where you first used the Aggregator and then tried the PointOnLineOverlayer, perhaps try the Intersector transformer instead of the PointOnLineOverlayer. According to the help of that transformer, it should accomplish what you need.

If not, perhaps try to replace the red points (from your schematic) with small circle areas and then try to do an operation where the lines are cut at the circle boundaries. If the circle areas are very small, you could probably omit that piece of line inside and you should then have disjoint sets of lines around your points. Else, you could again split the line inside the circle area in two and add a part to each network on each side. I have not tried this myself, but think this may be a (bit of a tedious) workaround?

Hope you can solve this.


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 13, 2019

Hi, thank you for thinking along. I managed to get the results I wanted last week.

I basically did a point_on_line_overlay, modified the lines that overlapped with the point dataset (make them shorter), applied a networktopology trasformation, and then aggregated based on network_id. And of course a lot of other steps in between like the intersector etc ..:-). Maybe a bit cumbersome in the end, but that seemed to do the trick.


fmenco
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 13, 2019
fbinneman wrote:

Hi fmenco

On your solution where you first used the Aggregator and then tried the PointOnLineOverlayer, perhaps try the Intersector transformer instead of the PointOnLineOverlayer. According to the help of that transformer, it should accomplish what you need.

If not, perhaps try to replace the red points (from your schematic) with small circle areas and then try to do an operation where the lines are cut at the circle boundaries. If the circle areas are very small, you could probably omit that piece of line inside and you should then have disjoint sets of lines around your points. Else, you could again split the line inside the circle area in two and add a part to each network on each side. I have not tried this myself, but think this may be a (bit of a tedious) workaround?

Hope you can solve this.

Hi, thank you for thinking along. I managed to get the results I wanted last week.

I basically did a point_on_line_overlay, modified the lines that overlapped with the point dataset (make them shorter), applied a networktopology trasformation, and then aggregated based on network_id. And of course a lot of other steps in between like the intersector etc ..:-). That seemed to do the trick.


Reply


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