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

GRASS GIS trac at osgeo.org
Fri Aug 12 02:52:43 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
Resolution:               |   Keywords:  r.out.gdal
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+---------------------------------

Comment (by mmetz):

 Replying to [ticket:3130 neteler]:
 > 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.

 According to Landsat metadat, 0 is not a valid data value, valid range is
 1 - 255. Also, r.info -r shows that 0 is not present, therefore 0 can be
 used for nodata.

 > The only solution seems to be an extra alpha channel to be stored in the
 resulting GDAL file (here: GeoTIFF).

 You mean r.out.gdal should create this extra alpha channel internally? You
 could also try the PHOTOMETRIC and ALPHA creation options for GeoTIFF with
 a corresponding alpha channel created manually.

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



More information about the grass-dev mailing list