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.
@jugoslaviaa Or the Intersector transformer. Follow that by a LengthCalculator and a TestFilter to drop short line segments.
@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.
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.
@jugoslaviaa If you can upload a small sample dataset then the community could probably tack a closer look at your possible workflow.
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.
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
@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.
@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 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.
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
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

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
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