Question

Detection the gap between two lines


Badge +1

Hello,

please, Im trying to solve interesting issue in gasoline industry. I have the source file, contains lines features, and I need to compare lines to each other. Issue is following:

- none of line end-points cannot be in distance 5-30 centimeters to end-points, vertices or line segment of another lines

Is there any possibility to detect this gap between lines please?

Thank You so much!

Lubo


10 replies

Userlevel 4

My first try would be to convert the line endpoints to point geometries and use the NeighborFinder.

Badge +1

My first try would be to convert the line endpoints to point geometries and use the NeighborFinder.

@david_r,

 

 

thank You for tip! Unfortunately, NeighborFinder doesn´t support interval value for maximum distance paramater - I need to find all point in distance 5-30 centimeters...

 

Userlevel 4
@david_r,

 

 

thank You for tip! Unfortunately, NeighborFinder doesn´t support interval value for maximum distance paramater - I need to find all point in distance 5-30 centimeters...

 

I would set the NeighborFinder to 30 centimeters, then use e.g. a Tester on "_distance" to exclude those <5 centimeters.
Badge +1
I would set the NeighborFinder to 30 centimeters, then use e.g. a Tester on "_distance" to exclude those <5 centimeters.
@david_r,

 

 

thank You so much, I forgot that NeighbourFinder can calculate distance between points... And what if I want to check, if lines connected to each other are connected only through end-points or vertex points? I need to detect lines, which are spatially connected, but not through end-points or vertex points...

 

 

Userlevel 4
@david_r,

 

 

thank You so much, I forgot that NeighbourFinder can calculate distance between points... And what if I want to check, if lines connected to each other are connected only through end-points or vertex points? I need to detect lines, which are spatially connected, but not through end-points or vertex points...

 

 

Maybe use the Chopper with max vertices = 1 to get point geometries on all vertices. Then pass the lines through the TopologyBuilder and compare the Nodes with the output from the Chopper (e.g. PointOnPointOverlayer and check _overlaps value).
Badge +1
@david_r

Im not sure if this is right way. I attached the sample, where You can try it. Still, if one line touches another one by end point, but second one has no end point or vertex point at touch location, there is overlaps with end point of first line :-(

abc.zip

Badge +3

@lazarlubomir

extract begin and end coordinate of each line.(parallel so as to have same name for x and y coordinates).

Listbuilder (or aggregator) group by x and y.

Listelementcount =1 are endpoints and not matching other vertices.

But of course you need to take notice your example has Paths. So if you follow above procedure you will notice the network is topologicaly correct. Result will therefore also yield points on paths.

Badge +1

@lazarlubomir

extract begin and end coordinate of each line.(parallel so as to have same name for x and y coordinates).

Listbuilder (or aggregator) group by x and y.

Listelementcount =1 are endpoints and not matching other vertices.

But of course you need to take notice your example has Paths. So if you follow above procedure you will notice the network is topologicaly correct. Result will therefore also yield points on paths.

@gio,

 

thank You so much for idea. But it is only for endpoints, right? What if line is connected to another line by endpoint on first line and vertex point on second line? I attached pic below, which describe what Im looking for. I need to detect all lines connected to another lines, but not through end point or vertex point.

 

Thank You so much!

 

Lubo
Badge +3

@lazarlubomir

Hi,

You also need to extract all vertices in the process I described. Using same attribute names for the coordinates.

Listbuilder and listelementcounter.

Now test for to chelement_couint = 2

Badge +1

@lazarlubomir

Hi,

You also need to extract all vertices in the process I described. Using same attribute names for the coordinates.

Listbuilder and listelementcounter.

Now test for to chelement_couint = 2

Hello @gio,

 

yes, it is a quite good solution, thank You so much! Probably, I found another solution -

 

1. convert all lines to points via chopper

 

2. pointonpointoverlayer and select points, where overlaps attribute value = 0

 

3. pointonlineoverlayer and select points, where overlaps attribute value is bigger than 1.

 

It looks that it works :-)

 

Reply