Skip to main content

Hallo FME community,

I have many lines in a shapefile and some lines are connected to each other. I want to bring all lines that are connected together into one feature. I would be grateful if someone could give me an idea.

 

If they are all end node connected, you can use the LineCombiner.

 

If they are not end noded, I would first use the NetworkTopologyCalculator transformer. This should tag each connected set of lines with a common attribute _network_id. From there, you can aggregate those lines into one feature with Aggregator with Group By set to _network_id. You may need to process the lines through an Intersector before the NetworkTopologyCalculator, if the lines are not node connected.


If they are all end node connected, you can use the LineCombiner.

 

If they are not end noded, I would first use the NetworkTopologyCalculator transformer. This should tag each connected set of lines with a common attribute _network_id. From there, you can aggregate those lines into one feature with Aggregator with Group By set to _network_id. You may need to process the lines through an Intersector before the NetworkTopologyCalculator, if the lines are not node connected.

it works. many Thanx. :)


If they are all end node connected, you can use the LineCombiner.

 

If they are not end noded, I would first use the NetworkTopologyCalculator transformer. This should tag each connected set of lines with a common attribute _network_id. From there, you can aggregate those lines into one feature with Aggregator with Group By set to _network_id. You may need to process the lines through an Intersector before the NetworkTopologyCalculator, if the lines are not node connected.

it works. many Thanx. :)

How would I do if they have a gap between eachother? Snapper will have varied results. Think motorway roads, I want into 1 line but it is messy, see example:  would snapper work? If I have 6 nearby lines:

 

 


Hi ​@clowncutie 

From the screenshot it looks like this is not possible, unless there are attributes that can do unique matching. 

However, if the lines are meant to mostly represent the same thing (eg. multiple slightly different representation of the same road), a Matcher with a vector tolerance might help.