I have a raster map that I generated from cropping/masking from a bigger raster map. It produced a map with only a portion of not null values. I only want to have a map that is zoomed in to the portion of not null values in order to save it into a PNG file. I only succeeded in setting the region (g.region) to the portion, but not cutting the map that only contains that portion.


you can do that with the help of MASK and r.resample (make a copy of your raster before) This video would guide you : http://www.youtube.com/watch?v=0tfcyxRvEJ8

  • Thanks! it was very helpful. Given the resulting map that I generated, can i save the map in PNG format? I tried running the r.out.png, but it failed and produced errors.
    – teamAngat
    Feb 26 '11 at 17:26
  • how did it fail? you may want to try r.out.gdal with the PNG driver instead, its more robust than the one-off exporters.
    – scw
    Feb 26 '11 at 17:36
  • You can use r.out.gdal to export to PNG. But r.out.png works fine, you "just" have to write into a directory in which you have permissions to save files.
    – markusN
    Feb 26 '11 at 19:02

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.