Skip to main content
Solved

Cleaning the lines after intersection


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6

Hello everyone,

I have center line data and I have created two offseted lines by using OffsetCurveGenerator. How can i cleaned the lines after the intersection of the two lines? By using Topologoy Builder, I have splitted them so those are individual lines. But I could not find way to delete them.

Blue lines represents the lines that I would like to remove.

Best answer by markatsafe

@jugoslaviaa Thanks for including some sample data. The problem here is that the data is very poor quality, with lines that overlap and lines that have gaps. So it's very unlikely that you'll get a result that removes 100% of the dangles, without also removing valid edges - see the purple edges in the image below). As has been suggested, TopologyBuilder is your friend, but then you can post process the TopologyBuilder output to help identify the valid/invalid edges, or edges that are ambiguous.

The attached workspace finds the nodes that touch more than one edge - internal nodes (Blue). The end of line nodes are dropped. Then we can test for:

- any edge that has internal nodes at either end is an internal edge and should be kept (dark green)

- any edge longer than x (I've used 20m) should be kept (light green)

- any edge that is short (>10m) and only has one node is probably a dangle - reject (red)

- any edge that has one internal node and is between 10 & 20 m is ambiguous and should be validated manually (purple)

You'll probably find other things you can test for when you work with a larger dataset

Workspace:

Workspace (2018.1):finddangles.fmw

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

14 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 1, 2019

You can use the TopologyBuilder (Assume Clean Data = No), and then test the segments to see which ones are dangles and less than a given length.


Forum|alt.badge.img+2

@jugoslaviaa Or the Intersector transformer. Follow that by a LengthCalculator and a TestFilter to drop short line segments.


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 5, 2019
markatsafe wrote:

@jugoslaviaa Or the Intersector transformer. Follow that by a LengthCalculator and a TestFilter to drop short line segments.

Unfortunately, it does not work as some dangle lines as long as normal lines that I would like to keep. It does delete also those necessary lines.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 5, 2019
jugoslaviaa wrote:

Unfortunately, it does not work as some dangle lines as long as normal lines that I would like to keep. It does delete also those necessary lines.

That would be why I suggested the topology builder, to be able only remove dangle lines less than a certain length.


Forum|alt.badge.img+2

@jugoslaviaa If you can upload a small sample dataset then the community could probably tack a closer look at your possible workflow.


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 6, 2019
jdh wrote:

You can use the TopologyBuilder (Assume Clean Data = No), and then test the segments to see which ones are dangles and less than a given length.

@MarkAtSafe I have just added sample and snap shot of topology checker. As you can see in the second image, I can not use only length information as the length of actual lines are sometimes very small.

@jdh Sorry but i am new with FME. Can you tell me how can I delete the dangle line with topology builder? thanks in advance.


ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • March 6, 2019

If you use the topology builder you can identify all the edges that are dangling - lines that are dangling will contain their edge_id value in either the right_edge or left_edge attribute.

 

So you can test for edge_id = @abs(@Value(_left_edge)) or edge_id = @abs(@Value(_right_edge)) to identify the dangles, and test those for the length to exclude them

geojson_dangles.fmwt


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 6, 2019
jugoslaviaa wrote:

@MarkAtSafe I have just added sample and snap shot of topology checker. As you can see in the second image, I can not use only length information as the length of actual lines are sometimes very small.

@jdh Sorry but i am new with FME. Can you tell me how can I delete the dangle line with topology builder? thanks in advance.

@egomm gave an explanation.

 

 

You would have a TopologyBuilder -> LengthCalculator -> Tester

 

Those than come out of the passed port would be the dangles you can drop.

 

 

Replace the length value with whatever your threshold value is.

If you have a larger dataset you may also find it more efficient to test for dangles, length calculate only those, and test for length.


Forum|alt.badge.img+2
  • Best Answer
  • March 7, 2019

@jugoslaviaa Thanks for including some sample data. The problem here is that the data is very poor quality, with lines that overlap and lines that have gaps. So it's very unlikely that you'll get a result that removes 100% of the dangles, without also removing valid edges - see the purple edges in the image below). As has been suggested, TopologyBuilder is your friend, but then you can post process the TopologyBuilder output to help identify the valid/invalid edges, or edges that are ambiguous.

The attached workspace finds the nodes that touch more than one edge - internal nodes (Blue). The end of line nodes are dropped. Then we can test for:

- any edge that has internal nodes at either end is an internal edge and should be kept (dark green)

- any edge longer than x (I've used 20m) should be kept (light green)

- any edge that is short (>10m) and only has one node is probably a dangle - reject (red)

- any edge that has one internal node and is between 10 & 20 m is ambiguous and should be validated manually (purple)

You'll probably find other things you can test for when you work with a larger dataset

Workspace:

Workspace (2018.1):finddangles.fmw


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 7, 2019
markatsafe wrote:

@jugoslaviaa Thanks for including some sample data. The problem here is that the data is very poor quality, with lines that overlap and lines that have gaps. So it's very unlikely that you'll get a result that removes 100% of the dangles, without also removing valid edges - see the purple edges in the image below). As has been suggested, TopologyBuilder is your friend, but then you can post process the TopologyBuilder output to help identify the valid/invalid edges, or edges that are ambiguous.

The attached workspace finds the nodes that touch more than one edge - internal nodes (Blue). The end of line nodes are dropped. Then we can test for:

- any edge that has internal nodes at either end is an internal edge and should be kept (dark green)

- any edge longer than x (I've used 20m) should be kept (light green)

- any edge that is short (>10m) and only has one node is probably a dangle - reject (red)

- any edge that has one internal node and is between 10 & 20 m is ambiguous and should be validated manually (purple)

You'll probably find other things you can test for when you work with a larger dataset

Workspace:

Workspace (2018.1):finddangles.fmw

Thank you very much. I am afraid I will always some manual effort to have perfect results.


  • March 7, 2019

Hi

I did something for the city of Montréal that's look like what you're looking for. Because we need a duplicate of our streetbase centerline, for exemple when we want to remove snow we do it on one side of the street at different day. So i create our double street base that is topological.

 

If you need that i translate the comments of the workspace just write me

Bye!

 

gb_double.zip


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 11, 2019
x2py2ez2 wrote:

Hi

I did something for the city of Montréal that's look like what you're looking for. Because we need a duplicate of our streetbase centerline, for exemple when we want to remove snow we do it on one side of the street at different day. So i create our double street base that is topological.

 

If you need that i translate the comments of the workspace just write me

Bye!

 

gb_double.zip

Wow. It is really amazing workspace and your output looks how i image. However, I need to use different buffer size based on the lines type because I have the street with different width. Therefore it looks like this now

 


  • March 11, 2019
x2py2ez2 wrote:

Hi

I did something for the city of Montréal that's look like what you're looking for. Because we need a duplicate of our streetbase centerline, for exemple when we want to remove snow we do it on one side of the street at different day. So i create our double street base that is topological.

 

If you need that i translate the comments of the workspace just write me

Bye!

 

gb_double.zip

Hi Jugoslaviaa,

 

Good question

 

Maybe try to adjust the workspace for each kind of buffer with a attributefilter and see how to reconnect un street with a buffer size different of the other street. Ex Separate Highway from local street if you have an attribute for that run a buffer for each with the value you need

But after that i think you will have to clean where local street and highway connect together


jugoslaviaa
Enthusiast
Forum|alt.badge.img+6
  • Author
  • Enthusiast
  • March 12, 2019
x2py2ez2 wrote:

Hi Jugoslaviaa,

 

Good question

 

Maybe try to adjust the workspace for each kind of buffer with a attributefilter and see how to reconnect un street with a buffer size different of the other street. Ex Separate Highway from local street if you have an attribute for that run a buffer for each with the value you need

But after that i think you will have to clean where local street and highway connect together

Thanks for the tip. The Dissolver after the buffer may help. It will disolve the all polygons with different buffer size and then to the chopper


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