[GIS] How to save a raster and vector into a single PNG file in GRASS

grasspngrastervector

I am trying to save a raster and vector into a PNG file. The vector is overlayed on top of the raster map. I was only able to save the raster file into a png using r.out.png but without the vector.

Best Answer

Try this:

d.mon start=png
d.rast RASTER
d.vect VECTOR
d.mon stop=png

This will basically render VECTOR layer on top RASTER layer to a file called map.png.

Other things you could do with d.mon start=png - d.mon stop=png:

  • Type d.erase to wipe the slate clean before committing with d.mon stop=png
  • Include the legend with d.rast.leg:

    d.mon start=png
    d.rast.leg RASTER
    d.vect VECTOR
    d.mon stop=png
    
  • Put the legend to a separate image with d.legend:

    d.mon start=png
    d.legend RASTER
    d.mon stop=png
    

Useful stuff..