Question

Lines that touching multiple polygons

  • 24 October 2016
  • 3 replies
  • 10 views

Hello, I have a question about using line transformers. I have lines and polygons. Some lines are touching polygons at both ends, some lines are touching 1 polygon at 1 end. Some lines are touching no polygons. How can I determine the lines who touching the polygons at both ends?

Kind regards,

Steven Loosman


3 replies

Badge +1

If you use a SpatialRelator, with your lines as the requestor and the polygons as the supplier, you can use the related candidates-parameter (should be 2).

If there is a risk of intersections other points of the line too, use a snipper with (5%,95%) and perform the same process on the first and last snippet of the line. Then aggregate and sum the related candidates.

Userlevel 1
Badge +21

Alternatively you can extract the start and end points of each line using a coordinate extractor (0 for start of line -1 for end of line), create points and perform a spatial test using spatial relator to see if the point touches a polygon. Aggregate the results based on an id for the line feature summing the related candidates and only those lines that have related candidates of 2 touch a polygon at both ends

I tried the SpatialRelator and it works. Thanks for the answers.

Reply