I have a series of points with various fields in the attribute table such as car_id, time etc.,

I've created a hexagon vector grid, I want to count how many unique car_id's occur in one of the hexagon polygons.

Essentially a step further than points in polygon, if there are multiple points in a polygon where car_id = 25, the car_id = 25 would be counted once. The car_id count for a polygon using the sample data below would be 4

car_id = 25
car_id = 25
car_id = 25
car_id = 22
car_id = 22
car_id = 23
car_id = 24 

My question is what is the most appropriate QGIS tool to achieve this? Would it be Count Unique Points in Polygon, in the processing toolbox?

  • @Aaron, thank you for the suggestion, do you know how using the spatial join I can count the occurrences in the polygon, all the spatial join tools i've looked at offer stats like mean, stdev, etc. but not CountOf. – hselbie Nov 24 '15 at 2:25

Your guess is correct - use 'Count Unique Points in Polygon' in the processing toolbox, using "car_id" as the "Class field".

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.