[GRASS-user] No color for geotiffs exported with r.out.gdal

Hello,

I am using GRASS 6.4~rc5-2 on Ubuntu 9.10. I am trying to export a DCELL
raster map to both a byte formatted and a UInt16 formatted Geotiff file.
The UInt16 formatted file shows nothing when I try to open the file, and
the byte formatted file is in black and white only. I can't seem to get
color. The original GRASS raster uses the "ndvi" color scheme.

Thanks, Bill

How about r.out.tiff?

Mark

On Fri, Apr 2, 2010 at 11:00 AM, William Hudspeth <bhudspeth@edac.unm.edu> wrote:

Hello,

I am using GRASS 6.4~rc5-2 on Ubuntu 9.10. I am trying to export a DCELL
raster map to both a byte formatted and a UInt16 formatted Geotiff file.
The UInt16 formatted file shows nothing when I try to open the file, and
the byte formatted file is in black and white only. I can’t seem to get
color. The original GRASS raster uses the “ndvi” color scheme.

Thanks, Bill


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

I have tried that too with the same results...

Thanks though,

Bill

On Fri, 2010-04-02 at 12:59 -0400, M S wrote:

How about r.out.tiff?

Mark

On Fri, Apr 2, 2010 at 11:00 AM, William Hudspeth
<bhudspeth@edac.unm.edu> wrote:
        Hello,
        
        I am using GRASS 6.4~rc5-2 on Ubuntu 9.10. I am trying to
        export a DCELL
        raster map to both a byte formatted and a UInt16 formatted
        Geotiff file.
        The UInt16 formatted file shows nothing when I try to open the
        file, and
        the byte formatted file is in black and white only. I can't
        seem to get
        color. The original GRASS raster uses the "ndvi" color scheme.
        
        Thanks, Bill
        
        _______________________________________________
        grass-user mailing list
        grass-user@lists.osgeo.org
        http://lists.osgeo.org/mailman/listinfo/grass-user

On Fri, Apr 2, 2010 at 5:00 PM, William Hudspeth <bhudspeth@edac.unm.edu> wrote:

Hello,

I am using GRASS 6.4~rc5-2 on Ubuntu 9.10. I am trying to export a DCELL
raster map to both a byte formatted and a UInt16 formatted Geotiff file.
The UInt16 formatted file shows nothing when I try to open the file, and
the byte formatted file is in black and white only. I can't seem to get
color. The original GRASS raster uses the "ndvi" color scheme.

NDVI ranges (theoretically) from -1 to +1. Hence not much information
would survive then stored in 0..255 (8 bit) or 0..65535 (16bit UInt).

Solutions are
- select Float32 (but GeoTIFF won't support a color table)
- Add +1 and multiply with 100 and adjust the color table accordingly,
then export to 8bit
- choose a different format which supports color tables in floating
point format,
  check http://www.gdal.org/formats_list.html
- maybe more...

Please post your solution here.

Markus

On Fri, 2010-04-02 at 12:59 -0400, M S wrote:

How about r.out.tiff?
Mark

Another (strange) option is to export with "r.out.ascii" and convert
into GeoTIFF with gdal_translate. For example, given that your ascii
rasters have ".asc" extension:

for x in *.asc; do gdal_translate (your-options-go-here) $x $x.tif; done

(Don't remember from where I stole this hint).
Nikos

On Fri, Apr 2, 2010 at 11:00 AM, William Hudspeth
<bhudspeth@edac.unm.edu> wrote:
        Hello,
        I am using GRASS 6.4~rc5-2 on Ubuntu 9.10. I am trying to
        export a DCELL raster map to both a byte formatted and a
        UInt16 formatted Geotiff file.
        The UInt16 formatted file shows nothing when I try to open the
        file, and the byte formatted file is in black and white only.
        I can't seem to get color. The original GRASS raster uses the
        "ndvi" color scheme.
        Thanks, Bill

Markus,

Thanks for your assistance and explanation. I ended up adding +1 and
multiplying by 100 the source raster....

e.g.

r.mapcalc "new_raster=(old_raster+1.0)*100"

I also transformed the ndvi color table accordingly, and post it here if
anyone should wish to use it...

0.00 5 24 82
70.0 5 24 82
82.0 255 255 255
100.0 255 255 255
102.5 206 197 180
107.5 191 163 124
112.5 179 174 96
115 163 181 80
117.5 144 170 60
123.3 166 195 29
126.6 135 183 3
133.3 121 175 1
136.6 101 163 0
143.3 78 151 0
146.6 43 132 4
155.0 0 114 0
165.0 0 90 1
175.0 0 73 0
185.0 0 56 0
195.0 0 31 0
200.0 0 0 0

Thanks, Bill

On Fri, 2010-04-02 at 23:10 +0200, Markus Neteler wrote:

<grass-user@lists.osgeo.org>

William Hudspeth wrote:

Markus,

Thanks for your assistance and explanation. I ended up adding +1 and
multiplying by 100 the source raster....

e.g.

r.mapcalc "new_raster=(old_raster+1.0)*100"

I also transformed the ndvi color table accordingly, and post it here if
anyone should wish to use it...
  

Bill:
Looks like a good candidate for the GRASS wiki, if you don't mind.

0.00 5 24 82
70.0 5 24 82
82.0 255 255 255
100.0 255 255 255
102.5 206 197 180
107.5 191 163 124
112.5 179 174 96
115 163 181 80
117.5 144 170 60
123.3 166 195 29
126.6 135 183 3
133.3 121 175 1
136.6 101 163 0
143.3 78 151 0
146.6 43 132 4
155.0 0 114 0
165.0 0 90 1
175.0 0 73 0
185.0 0 56 0
195.0 0 31 0
200.0 0 0 0

Thanks, Bill

On Fri, 2010-04-02 at 23:10 +0200, Markus Neteler wrote:
  

<grass-user@lists.osgeo.org>
    
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.

--
Micha Silver
Arava Development Co. +972-52-3665918
http://surfaces.co.il