Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
You should also check the relevant wiki page: – pmav99 Nov 27 '15 at 12:52
up vote 3 down vote accepted

you can do that with the help of MASK and r.resample (make a copy of your raster before) This video would guide you :

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.