I have an SRTM DEM and I want contour lines generated for specific elevations. This can easily be done using r.contour.level/step etc. but the contours generated are smooth and cover the cells only partially (red lines in image).
Are there any methods by which I could generate a contour line that encloses the cell boundaries above a desired elevation.
Image description: Red line is the 3950m contour generated by QGIS. The yellow line is one I need: a contour enclosing all cells >= 3950m).
EDIT: The goal is to extract the surface area of elevation ranges (50-100,100-150 etc.) in my raster. I have a surface area raster, and the next step is to calculate zonal statistics of the raster based on a defined polygon area of interest as my contours are occur every 50m, they seemed ideal for the mask. BUT Using a smooth contour vector gives me incomplete zonal statistics for every elevation polygon. This is could be because the 3950 contour polygon does not "completely" enclose pixels >= 3950. In the example below, the the zonal stats only gave me data for 5 pixels. The correct data should include 12 pixels (which I manually checked to be >= 3950m) as enclosed by the yellow line.