Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to save a raster map in GRASS in jpeg/bmp format without using the GUI for d.out.file/d.save. Is there a script to do it? I tried r.out.gdal but it produced a map that is black and white.

share|improve this question
1  
What's the range of the map? If it has negative values, they cannot be represented in JPEG/BMP to my knowledge. –  markusN Mar 25 '11 at 17:43
    
it is from -25 to 1000. I'll just fix the negative values and Try saving it again. I had generated a jpeg file from a raster map using r.out.gdal but it just produced a black and white map –  teamAngat Mar 26 '11 at 3:52
1  
If it is a floating point map, also that cannot be represented in JPEG or BMP format. What do you want to achieve with the export? –  markusN Mar 26 '11 at 8:45
    
It is a floating point map and I am trying to save it in another image format rather than PNG since PNG cannot be embedded directly on the application that I am using. –  teamAngat Mar 27 '11 at 20:22
    
E.g. GeoTIFF can stored floating point. –  markusN Mar 28 '11 at 23:33
add comment

3 Answers

Have a look on d.out.file command. See that page and format option. BMP is available.

share|improve this answer
add comment

You can use the GDAL library by:

r.out.gdal InRaster.dem format=JPEG output=out.jpg

have a look at the documentation here.

share|improve this answer
2  
Small note: From GRASS 6.4 onwards, the command name is r.out.gdal –  markusN Mar 27 '11 at 18:24
add comment

If for some odd reason d.out.file doesn't work, you could also add the GRASS raster to a QGIS map and use the File > Save as Image command. Alternatively, add to QGIS and create a layout which you can export as an image.

share|improve this answer
add comment

Your Answer

 
discard

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.