2

i have two layers: 1. a point layer. It contains a value. 2. a polygon layer.

I want to sum up the values of the points within each polygon.

I tried to do it with "Count points in polygon(weighted)" - but it's extreml slow. Not even 1 % finished after 10 minutes (and it's only ~ 50000 points!). Is that correct?!

  • Which QGIS version are you using? – ndawson Sep 16 '16 at 21:56
4

The DB Manager plugin now gives you access to shapefiles as 'virtual layers' AND allows you to run not only SQL queries on these layers, but SQL Spatial Functions!

So here's a quick example where I count the number of schools (points) in each elementary boundary (polygon) using 2 shapefiles and SQL spatial:

enter image description here

So instead of using count(*) you would use sum(value_field).

Give it a shot!

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.