[GIS] Altering elevation of specific cells in raster layer of QGIS

maskingpolygonqgis-2.12raster

I'm looking to alter the height of some cells within a raster and it's been suggested that I do this by creating a polygon layer and use that as a mask to alter only the heights of cells within the polygon.

The closest problem I've found similar to this is – How to change raster cell values within a polygon using QGIS GUI? – but I'm quite new to using GIS and don't understand how to do that though, I can't seem to control the extents of the polygon and can't find how to alter the heights.

Previously, I've tried using the Raster Calculator to create separate GeoTiff files in an attempt to alter the elevations and then merge the files back into a raster, I'm not certain if that sounds more straightforward, it just seems to give me an area with nan(not a number) rather than the elevations I want to input.

Another link that might be useful – Using polygons to apply unique value to all raster cells within those polygons?

Best Answer

Found that I could create a polygon mask of desired shape using Layer>Create Layer>New Shapefile Layer... Including an integer field to be filled with "1", then converting this layer into a raster using Raster>Conversion>Rasterise, selecting your shapefile and choosing the integer field as the attribute field - I didn't alter the default pixel size given of 3000x3000 and saved in GeoTIFF format.

Using my new Raster I went to the Raster Calculator and did as described in: How to change raster cell values within a polygon using QGIS GUI? with the expression yourdem@1 - ((poltoras@1 = 1) * x ) With x being the desired reduction in height and being able to increase height within the polygon similarly. Once again saving the output in .tif

From there I converted my original topography.asc file into topography.tif using Raster>Conversion>Translate to choosing the original ASCII file and choosing the output format to be GeoTIFF. From there I merged the topography and altered elevation .tif files and then converted the resulting file back into .asc using the process described above.