5

I have two polygon layers (yellow and orange in the attached image).

I am wondering if there is a way to get a count of the number of isolated areas that the orange polygon has divided the yellow polygon into using QGIS?

I have tried using various vector processing tools in QGIS but have yet to find one that will produce the desired output. I am using QGIS version 3.4.

screenshot of the two polygons I am working with

4

It's simple

Step One - "Vector> Geoprocessing> Difference";

Step Two - “Analysis Tools> Split Composite Objects” (This step is necessary in order to convert a multipolygon to a polygon, otherwise the result may not be accurate);

the third step "select a layer in the layers panel with the name" Single_parts ", click on the right mouse button and in the pop-up window set the checkbox - Show number of objects" and this is your result ...

2

The easy way

There is a very easy way to do so:

You can use Vector -> Geoprocessing Tools -> Clip.

Input Layer is the underlying, greenish one.

Overlay Layer is the clipping, orange one.

This will create a new layer (and if you leave the Clipped name empty, it will default to a temporary, disposable layer, so you don't pollute your hard drive).

The number of individual features of the clipped layer is the number you are looking for.

The flexible way

You can avoid doing the manual count (useful if you have a large number of features) by using:

Toolbox (the "gear" icon) -> Join attributes by location (summary)

and inputting something like in the following screenshot:

Join attributes by location (summary)

Please note that, depending on the options you select, you can yield many more useful insights about the newly clipped polygons ;)

  • 2
    This seems to only creates an output layer that is the same as the overlay layer (orange one). – Evan May 27 at 17:05
  • yes, because in your case the orange layer seems to only cut one contiguous feature of the yellow one. – RafDouglas May 27 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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