Skip to main content
Question

Finding lines not connected to/touching/near any other lines


tim_wood
Contributor
Forum|alt.badge.img+8

As a proof of concept, I want to use FME to find lines not connected to, touching or near any other lines. The nearness would be user defined e.g. keep lines within 10 metres of another line. I can't find an existing answer so I'm posting my solutions. I was inspired by @redgeographics answer to:

https://knowledge.safe.com/questions/42455/lines-connected.html

The first solutions has 2 options for pre-processing. Either buffer the input lines by the amount required to take care of undershoots. This will obviously create polygons. Or use the LineExtender to do a similar job. The difference with the LineExtender is the direction of the extensions at each end (see documentation).

Then send the pre-processing result to both the Requestor AND Supplier ports of the SpatialRelator. Choose the Intersects and Touches tests (regardless of whether you're using buffered or extended lines). Select ObjectID (or other primary key) as the attribute that must differ. Results with _related_candidates values of 0 (zero) are the lines not connected. A Tester could be used to filter the data to keep, or to filter the unwanted lines to do a DELETE fme_db_operation on the source data.

The second solution is to use the NeighborFinder in CandidatesOnly mode. Set a Maximum Distance to included or excluded non-intersecting/non-touching lines for your desired tolerance. The Matched port will contain the features to keep. The UnmatchedCandidate port had more than just the unwanted lines. I don't know why but I'm not that familiar with the NeighborFinder so there may be a setting I need to tweak. This solution is more elegant in the sense it doesn't involve doing any modifications to the input data.

I've attached my test data in a zipped ShapeFile.

5 replies

david_r
Celebrity
  • March 23, 2018

One solution could be to use a Snapper with a 10m radius and then a NetworkTopologyCalculator, as described in https://knowledge.safe.com/questions/42455/lines-connected.html


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 23, 2018
david_r wrote:

One solution could be to use a Snapper with a 10m radius and then a NetworkTopologyCalculator, as described in https://knowledge.safe.com/questions/42455/lines-connected.html

I experimented with the NetworkTopolgyCalculator and wasn't completely happy with the results (but again, I'm not so familiar with that Transformer). But I didn't try it in conjunction with the Snapper.

 

 


david_r
Celebrity
  • March 23, 2018
tim_wood wrote:
I experimented with the NetworkTopolgyCalculator and wasn't completely happy with the results (but again, I'm not so familiar with that Transformer). But I didn't try it in conjunction with the Snapper.

 

 

The Snapper basically introduces a tolerance.

 

If you also need to detect intersecting lines that do not break at the point of intersection, try also inserting an Intersector or a TopologyBuilder after the Snapper and before the NetworkTopologyCalculator.

Forum|alt.badge.img
  • March 23, 2018

I think you have the answer already with the NeighborFinder in CandidatesOnly mode.

Is that not providing you with the right results?


tim_wood
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • March 23, 2018
davidrich wrote:

I think you have the answer already with the NeighborFinder in CandidatesOnly mode.

Is that not providing you with the right results?

Sorry - perhaps I wasn't very clear. I'm not exactly asking a question, rather sharing my solutions to potentially help others. But there might be other ways or better ways of doing it...

 


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