1

i'm working on a map with population densities. My raster data contains values as [People/square meter] for each cell. I have per capita values of energy demand etc. which I want to multiply with the raster to get a spatial distribution of the demand, but this requires the number of people in one cell. Consequently i'd have to multiply the population density values with the area of each cell, but here's the problem:

Each cell is 0.0083 degrees but depending on the distance from the equator has a different area.

How can I extract the area values from this raster/ directly calculate population numbers of the cells?

My first try was to vectorize the raster, calculate the area for each polygon and rasterize again, but vectorizing it, QGIS consolidates cells with similar values to one polygon. From 660,000 raster cells I get 60,000 polygons.

  • To an excellent approximation, the area of each cell is 0.8534 * cos(latitude) square kilometers. (0.8534 = (0.0083 * 111.300)^2.) This formula leads to a fast, efficient, direct solution. For details, see our thread about converting back from square meters to square degrees. For a slightly more accurate formula see gis.stackexchange.com/a/29743/664 -- which answers essentially the same question as this. – whuber Jul 17 '14 at 15:08
  • Thank you whuber, i'll try that as soon as I need to work with the bigger rasters. How can I get the latitude values per cell to use them in the raster calculator? Can't find this for QGIS in the forum either... – Gumbo Jul 18 '14 at 8:45
  • The answer at gis.stackexchange.com/a/91035/664 describes one way. Although it is couched in the language of ArcGIS, it applies to any raster GIS with flow accumulation capabilities, which includes GRASS. There are many other ways, too, including generating the latitude grid with a script and computing the Euclidean distance grid from a line representing the Equator. – whuber Jul 18 '14 at 13:00
  • the time has come that I need a bigger raster with the area values, but after reading several times the related posts (thanks for that @whuber), I don't get it done, so I will just open a new thread... – Gumbo Jul 21 '14 at 15:00
3

You should be able to use the method you were describing above, but create your vector layer using the 'vector grid' tool under the vector>research tools menu.

This has a checkbox to align the extents and resolution of the vector grid to a raster layer, so should give you a perfect match with your original raster, and also remember to check the option to output as polygons (it's set to lines by default)!

You should then be able to calculate the area of each cell and convert back to a raster as you described above.

  • This solution will overburden any computer once the rasters get reasonably large. Use a raster-based solution instead, because it will be very, very much faster. – whuber Jul 17 '14 at 15:11

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.