I have a 'Layer 1' that represents geographical areas. And another 'Layer 2' contains some location-based information.

I want to count/aggregate the tweets per geographical using QGIS. For example, in the following screenshot. The count is 3 points(containing the one on the border if allowed), given that Layer 2 has no reference attribute that can be used to link with layer 1 (only the location of the feature).

Is there a way to do it using QGIS?

enter image description here

2 Answers 2


Use the "Count points in polygon" tool, which can be found under Vector > Analysis Tools > Count points in polygon as well as in the Processing Toolbox (Ctrl+Shift+T).


Using QGIS expressions via field calculator:

  1. select the polygonal layer;
  2. start the field calculator;
  3. create a new numeric field;
  4. populates the field with the expression
aggregate (
  layer: = 'points',
  aggregate: = 'count',
  expression: = $id, 
  filter: = intersects ($geometry, geometry(@parent))

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.