[Qgis-user] QGIS Analytical combinations

ferran fabregas ferri.fc at gmail.com
Thu Nov 13 04:40:10 PST 2014


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:

The idea is:

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.

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.

That's all, the options of this are so much limited than the SQLite option,
but it's very straight forward.

If you want to take a look at the result:
http://projectlog.ferranfabregas.info/grid-based-thematic-map-with-qgis-2-4/

Regards,




*Ferran*

On Tue, Nov 4, 2014 at 3:41 PM, ferran fabregas <ferri.fc at gmail.com> wrote:

> Thanks! That make sense, I'll try and I will let you know.
>
> El mar., 4 de noviembre de 2014 15:26, enricofer <enricofer at gmail.com>
> escribió:
>
> 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.nabbl
>> e.com/QGIS-Analytical-combinations-tp5171127p5171139.html
>> Sent from the Quantum GIS - User mailing list archive at Nabble.com.
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20141113/b6d0dc1d/attachment.html>


More information about the Qgis-user mailing list