[GRASS-dev] [GRASS GIS] #3130: r.out.gdal: add alpha channel support

GRASS GIS trac at osgeo.org
Thu Aug 11 14:58:29 PDT 2016


#3130: r.out.gdal: add alpha channel support
-------------------------+---------------------------------
 Reporter:  neteler      |      Owner:  grass-dev@…
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  7.2.0
Component:  Raster       |    Version:  svn-releasebranch72
 Keywords:  r.out.gdal   |        CPU:  Unspecified
 Platform:  Unspecified  |
-------------------------+---------------------------------
 At time the export of RGB data with nodata is rather difficult.


 {{{
 grass72 ~/grassdata/nc_spm_08_grass7/landsat

 # test case:
 # set region to be half off the NC Landsat scene:
 g.region n=226831.5 s=221188.5 w=626430 e=634467 res=28.5 -p
 d.mon wx0
 d.rgb b=lsat7_2002_10 g=lsat7_2002_20 r=lsat7_2002_30

 # yes, null is expected:
 r.univar lsat7_2000_30 -g | grep null
 null_cells=24750

 r.out.gdal lsat7_2000 output=lsat7_2000_RGB.tif --o
 Checking GDAL data type and nodata value...
  100%
 Using GDAL data type <Byte>
 Input raster map contains cells with NULL-value (no-data). The value 0
 will
 be used to represent no-data values in the input map. You can specify a
 nodata value with the nodata option.
  100%
 ...
 }}}

 But in this case the 0 value is a data value and should not be used for
 nodata. The only solution seems to be an extra alpha channel to be stored
 in the resulting GDAL file (here: GeoTIFF).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3130>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list