I have a layer of polygons that represent two specific zones withing a city. I want to get a count of the number of parcel polygons in another layer that are within the two specific zones I am interested in. Some of the boundaries of the two layers touch each other. Is there a way to get a count of parcels in each zone in QGIS?

I've tried doing a join attributes by location using the zones as the target layer and the parcels as the join layer. I used contains with a precision of 2 to try an account for the boundaries touching. I have the attribute summary as sum and Keep all records. The outcome is a shapefile but there is no sum of the number of parcels in each zone even though I have a count column in the parcel attribute table.

Is this the best way of going about this? IS there a way I could select using an expression from either attribute table?

EDIT: Here are the images of the polygons and the Join dialogue box for the options I used:

Options for Join by Location

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Feb 14 '17 at 20:23
  • Thanks, I added some more detail about what I have tried or ideas. – Aurust Feb 14 '17 at 21:21
  • The tool you used seems to be adapt for your case. Did you set the "Take summary of intersecting features" option in the "Attribute summary" parameter? – mgri Feb 14 '17 at 21:23
  • Yes I did, I though this would give me the sum I specified in the summary – Aurust Feb 14 '17 at 21:40
  • Could you post an image of the polygons? And also a screenshot of the tool's dialog? – mgri Feb 14 '17 at 23:32

To find which parcel is located in which zone use the Intersection Tool under Vector-> Geoprocessing Tools with both layers as input layers.

The result is a layer, which contains every parcel (or part of it) which is inside the zone layer and the attribute table contains all attributes from both input layers.

Now you can either directly work with the intersection layer or split it with Vector-> Data Management Tools-> Split vector layer using the field which specifies the outer zone. Each of the new file now has directly the number of features which are located inside the corresponding zone.

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.