1

I'm using two raster (tiff) files of the Global Human Settlement dataset. One is representing the population in each cell, and the other one is representing the type of settlement (1=rural,2=low density urban cluster, 3=high density urban cluster).

I'm trying to create a table with the total population for each type of settlement. Is there a way to create this table using QGIS?

closed as too broad by aldo_tapia, BERA, nmtoken, Dan C, whyzar May 15 '18 at 15:51

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Yes, what have you tried and why didnt it work? – BERA May 15 '18 at 11:54
1

Usually this kind of task would be raster cross-tabulation (e.g. GRASS r.report, SAGA cross-classification and tabulation,...) operations.

However, since the cell values in population raster can be anything (zero, and/or even 20 million), number of class (or combination) would be too many to expect a reasonable output.

Alternatively, let me suggest more vector-oriented way.

(1) SAGA Raster values to points tool (QGIS Processing toolbox | SAGA | Vector <-> raster).

Just select your two raster layers. This tool will extract values and create a point layer.

(2) Open the attribute table of new point layer.

By the Field Calculator, create a new integer field by an expression:

sum("population", group_by:= to_int("type_of_settlement"))

(Please modify field names of above "population" and "type_of_settlement" as necessary).

New field has the total (sum of) population per the type of settlement.

Not the answer you're looking for? Browse other questions tagged or ask your own question.