Does anyone know how to calculate the area in km² for each altitudinal band (between 100 and 200, 200 and 300...) based on a DEM? I added the contour lines with a distance of 100 metres but could not find a way to modify them in order to allow area calculation. I am working with QGIS 1.8.0. DEM is taken from ASTER.
1 Answer
My initial answer was wrong so im providing a new one:
As wuber said the best way to calculate the area to reclassify the parts of your dem you want measure, polygonize (raster to vector) then add the $area attribute. Here's a step-by-step example.
For the purpose of this example im using a DEM which can be downloaded from here.
- Open your DEM with QGIS. For the example DEM the upper and lower limits are approximately from elevation 3300 to 3550 m.
- You want measure the area which is between eg. 3400 and 3500.
- First you need to mark those area. You can use the
Raster Calculator
from theRaster
menu. - At the
Raster Calculator
use the following formula :(O44121a1@1 >= 3400 and O44121a1@1 <= 3500)
. This will create a mask marking with1
all the areas we're interested in. - From
Raster
menu again, Select theConversion->Polygonize
tool. Select the Raster map you created in step 4 as input and also tick theField Name
option. You can use whatever name you want. - We only want two polygons. One polygon to mark the ares we are intrested in at the other to mark the polygons we are not intrested in. To group all the polygons to those two categories from
Vector
menu, chooseGeometry Tools -> Singleparts to Multiparts
Tool. Choose the polygon you created at step 5, and use the Field Name you chose. - Open the attribute table of the shapefile you created in step 6, and click at the
field calculator
button (you need to be in edit mode first). choose to create a new column define the precision , and in the expression box bellow type$area
(or you can double click it from the list), and click OK. - The new field should contain the area in MapUnits² with the choosen presision.
-
Thank you! Steps 1 to 6 are working well. I have some problems with the field calculator: Whatever I insert, the result is always the same. If I want to close edit mode, it turns to 0. I could not find this problem so I guess something is wrong with my general settings. Any ideas? Dec 21, 2012 at 11:03
-
What projection are you using? What are its units? If it is degrees the $area won't work. Jan 3, 2013 at 18:58
-
Ok, that was one problem, thank you. The project CRS now is WGS 84 / UTM zone 46N. That schould be metres, right? If yes, I'll get my km² by dividing the result by 1000? Jan 3, 2013 at 20:49
-