Solved

Spatial filters and conditions


Badge

I have a set of lines, and a set of polygons. I've used a spatial filter to check wether or not the lines intersect with the polygons. I want to filter the polygons that don't have an intersecting line. The lines were used as filter, and the polygons as candidate. That worked fine.

However, I wanted to add a condition that only intersections of more than a specified number should be considered valid intersections. Seems pretty straightforward, but I don't get any output once I set a condition

This is my workbench. Reader 1 are the lines, reader 2 the polygons. To set the condition, I select "intersect" as tests to perform in the spatial filter. After that I click the drop down menu for that tests and select/type the condition: if length <= 1

I think I'm forgetting something really small, but I just can't seem to figure out what.

icon

Best answer by takashi 18 October 2017, 16:17

View original

10 replies

Userlevel 5
Badge +25

You could use a Tester or TestFilter to select the lines you want before putting them in to the SpatialFilter

Badge

You could use a Tester or TestFilter to select the lines you want before putting them in to the SpatialFilter

But I don't know before I filter which line sthat should be. I want to keep all polygons, where the lines intersect for 1 m or more....

 

 

Badge

Alternatively, you could use the Intersector and the overlaps attribute to filter based on the amount of intersections.

Userlevel 1
Badge +21

If you need to only consider intersections to be valid once 1m or more of the line is within the polygon then the spatial filter is not going to help here. You will need to use something like a clipper or lineonareaoverlayer to calculate the length that is within the polygon

It's not 100% clear from your question whether in this example you would want to return the red and the blue line since both are greater than 1m and intersect with the area, or whether you just want the blue line as that intersects with the area by more than 1m

Badge

If you need to only consider intersections to be valid once 1m or more of the line is within the polygon then the spatial filter is not going to help here. You will need to use something like a clipper or lineonareaoverlayer to calculate the length that is within the polygon

It's not 100% clear from your question whether in this example you would want to return the red and the blue line since both are greater than 1m and intersect with the area, or whether you just want the blue line as that intersects with the area by more than 1m

I want the red, but in my case the part of the red line that overlaps (the 0.75m) could also consist of multiple linesegments that have a combined length of 0.75m

 

 

Userlevel 2
Badge +17

Hi @fmenco, if your requirement is to select lines where the line is clipped by a polygon and also the length of clipped inside part is equal to or less than 1 meter, this workflow might help you.

Badge

Hi @fmenco, if your requirement is to select lines where the line is clipped by a polygon and also the length of clipped inside part is equal to or less than 1 meter, this workflow might help you.

I'm gong to try this, too...

 

But no, I want to filter out polygons which are being overlapped by a line shorter than a certain length or not being overlapped at all.

 

I've allready expanded my workbench by:

 

-filtering out lines that don't intersect (spatialfilter, lines= candidate, polygons = filter)

 

- joining lines that did intersect (linejoiner).

 

- using a lineonareaoverlay

 

-calculating linelength (lengthcalculator) and then filtering out "short" lines (tester)

 

 

That's how far I've gotten

 

I guess now I have to add another spatialfilter to filter out the polygons that are left now? But now just with the filter and candidate switched, so lines =filter, and polygons= candidate?

 

 

 

Badge

Hi @fmenco, if your requirement is to select lines where the line is clipped by a polygon and also the length of clipped inside part is equal to or less than 1 meter, this workflow might help you.

Thank you.. this helped.. I had to adapt it of course with a linejoiner before the geometryextractor and a lengthcalculator after the clipper... But this gave me the results I was looking for..

 

Thanks again..:-)

 

 

Badge

Hi @fmenco, if your requirement is to select lines where the line is clipped by a polygon and also the length of clipped inside part is equal to or less than 1 meter, this workflow might help you.

Almost there... This is my workbench

 

 

Eventhough it filters out the bulk of what I want to filter out, it doesn't filter out everything.

 

Polygon A, should also be filtered out, but is now in the same category as polygon B. It's like I need another tescriteria or something,..one that specifies that the lines should pass the criteria for all polygons it intersects with. or something like that. How do I do that?

 

 

 

 

 

 

Userlevel 2
Badge +17

Hi @fmenco, if your requirement is to select lines where the line is clipped by a polygon and also the length of clipped inside part is equal to or less than 1 meter, this workflow might help you.

If the goal is to filter polygons intersecting only with the clipped parts of the lines, the GeometryReplacer would not be necessary.

 

 

Reply