<div dir="ltr">Hi! I get the solution! The Enrico suggestion was great, but it implies working out of QGIS and data conversion (Shapes to relational DBs), so, I've found a method to do it only with the QGIS options:<div><br></div><div>The idea is:</div><div><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)">We create a grid (Vector->Research Tools->Grid Vector), we must define the grid extension and cell size, in this case we want a grid as polygons. This action will create a new shape that must be loaded on the project.</p><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)">When we have a grid, we must do a join (Vector->Data Management Tools->Join Attributes by Location), use grid as target layer, choose the vector layer that you want to work with and the operation that you want to be performed (Mean/Min/Max/Sum/Median). This will generate a new shape with the treated data.</p><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)">That's all, the options of this are so much limited than the SQLite option, but it's very straight forward.</p><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)">If you want to take a look at the result: <a href="http://projectlog.ferranfabregas.info/grid-based-thematic-map-with-qgis-2-4/">http://projectlog.ferranfabregas.info/grid-based-thematic-map-with-qgis-2-4/</a></p><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)">Regards,</p><p style="margin:1.6em 0px;padding:0px;border:0px;font-family:Arial,Helvetica,sans-serif;font-stretch:inherit;line-height:21px;font-size:14px;vertical-align:baseline;word-wrap:break-word;color:rgb(85,85,85)"><br></p></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><br><i>Ferran</i><br></div></div>
<br><div class="gmail_quote">On Tue, Nov 4, 2014 at 3:41 PM, ferran fabregas <span dir="ltr"><<a href="mailto:ferri.fc@gmail.com" target="_blank">ferri.fc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks! That make sense, I'll try and I will let you know.<br><br><div class="gmail_quote">El mar., 4 de noviembre de 2014 15:26, enricofer <<a href="mailto:enricofer@gmail.com" target="_blank">enricofer@gmail.com</a>> escribió:<div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I suggest you to put everything in spatialite database and, assuming that<br>
1) GRID is the polygon layer with grid definition<br>
2) POINTS is the point layer with population data<br>
3) POINTS has a field "pop" with population data<br>
4) both layers have a keyfield named "id"<br>
5) both layer have "geom" as geometries field<br>
<br>
Run the following query with dbmanager:<br>
<br>
SELECT DISTINCT GRID.id, SUM(POINTS.pop) AS POPxGRID<br>
FROM POINTS<br>
INNER JOIN GRID ON ST_Within(POINTS.Geometry,<u></u>GRID<u></u>.geom)<br>
GROUP BY <a href="http://GRID.ID" target="_blank">GRID.ID</a><br>
<br>
you will get a table with a reference to a grid feature ID and the sum of<br>
the population of the points that are within the grid feature<br>
<br>
I hope this help you.<br>
<br>
Enrico Ferreguti<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/QGIS-Analytical-combinations-tp5171127p5171139.html" target="_blank">http://osgeo-org.1560.x6.<u></u>nabbl<u></u>e.com/QGIS-Analytical-<u></u>combinat<u></u>ions-<u></u>tp5171127p5171139.html</a><br>
Sent from the Quantum GIS - User mailing list archive at Nabble.com.<br>
______________________________<u></u><u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman<u></u>/listinfo/qgis-user</a><br>
</blockquote></div></div></div></blockquote></div><br></div>