Sunday 21 August 2016

qgis - Increasing extent of Raster?


I have a Raster, which covers only the southern part of the country, like this:



enter image description here


I wish to have a Raster, which covers the entire country (including the North part)? The northern part should have the nodata values.


How do I do this using GDAL or QGIS?


( I do not have ArcGIS, so I can't use the answer given here: Increasing raster extent by filling extent with no data using ArcGIS Desktop without Spatial Analyst?)


I tried using gdalwarp's -te parameter; It was successful in reducing the extent, but did not extend the extent to the Northern part.



Answer



My suggested workflow:




  1. Create a polygon of the extent you want to cover





  2. rasterize the polygon




  3. fill it with a nodata value using gdalcalc




  4. add the existing raster with gdalwarp without the -overwrite option.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...