[Qgis-user] QGIS Analytical combinations

enricofer enricofer at gmail.com
Tue Nov 4 06:26:45 PST 2014


I suggest you to put everything in spatialite database and, assuming that
1) GRID is the polygon layer with grid definition
2) POINTS is the point layer with population data
3) POINTS has a field "pop" with population data
4) both layers have a keyfield named "id"
5) both layer have "geom" as geometries field

Run the following query with dbmanager:

SELECT DISTINCT GRID.id, SUM(POINTS.pop) AS POPxGRID
FROM POINTS
INNER JOIN GRID ON ST_Within(POINTS.Geometry,GRID.geom)
GROUP BY GRID.ID

you will get a table with a reference to a grid feature ID and the sum of
the population of the points that are within the grid feature

I hope this help you.

Enrico Ferreguti



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Analytical-combinations-tp5171127p5171139.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list