4

I have a layer with a lot of polygons. Now I want to filter all polygons that are very narrow. For example, the polygons show living space. But I'm only interested in large living spaces. Function $area does not help here, as there are also very long and narrow surfaces. Does anyone know a function in QGIS that comes to this output via filtering x and y?

6
  • You could use the point of inaccessibility and its distance to the polygons border?
    – Erik
    Commented Jul 5, 2019 at 11:50
  • Do you mean checking the difference of max_x minus min_x (or y) is very small? So you can do QGIS expression to select them according to a defined threshold.
    – etrimaille
    Commented Jul 5, 2019 at 11:51
  • I tried that: new field -> xmax ($geometry) - xmin ($geometry). And the same for y. But I'm still missing something. That does not help me yet.
    – hugo
    Commented Jul 5, 2019 at 12:02
  • 1
    @hugo - If you want to ignore long, narrow polygons which, for example, have an average width of 10m, you could use a query like area(buffer($geometry, -5)) > 0. This query creates a negative buffer (i.e. inwards) and if the area of the buffer is greater than 0 then that polygon has a greater width.
    – Joseph
    Commented Jul 5, 2019 at 12:09
  • 1
    This works very well! Thanks! Can you explain to me what significance the -5 has here?
    – hugo
    Commented Jul 5, 2019 at 12:20

1 Answer 1

5

If you want to ignore long, narrow polygons which, for example, have an average width of 10m, you could use a query like:

area( buffer($geometry, -5 )) > 0

This query creates a negative buffer (i.e. inwards) and if the area of the buffer is greater than 0 then that polygon has a greater width. You can change the value to set a threshold more suited for your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.