[Qgis-user] Count polygons within a larger polygon

Alex Mandel tech_dev at wildintellect.com
Sun Aug 7 20:38:05 PDT 2011


On 08/07/2011 07:44 PM, Kate Beard wrote:
> Wondering if anyone can help?  i'm trying to count the number of smaller
> polygons within a larger polygon.
> 
> I've used the Vector > Data Management > Join by location, which gives me
> numbers which are close, but not quite correct.
> 
> I've also found the Points in Polygon tool which would be fine if I had
> points - unfortunately I have polygons.
> 
> Thanks,
> Kate
> 

You may be running into and issue around the type of Spatial Join.
Conceptually there's:
Intersects
Within(Contains)
Touches

I'm not sure which the Join by location uses. My guess is within which
means that things that spill outside don't match.

Well you get the point. Using Spatialite or Postgis will get you much
finer control over the process. Or you can go the route of doing an
Intersect and then counting the number of features that share the parent
polygon.

Enjoy,
Alex



More information about the Qgis-user mailing list