[GRASS-dev] [GRASS GIS] #2501: r.out.gdal -t creates offset values in raster table for integer grids with values beginning with 1

GRASS GIS trac at osgeo.org
Wed Nov 26 15:11:59 PST 2014


#2501: r.out.gdal -t creates offset values in raster table for integer grids with
values beginning with 1
-----------------------+----------------------------------------------------
  Reporter:  dnewcomb  |       Owner:  grass-dev@…                         
      Type:  defect    |      Status:  closed                              
  Priority:  normal    |   Milestone:  7.0.0                               
 Component:  Default   |     Version:  svn-releasebranch70                 
Resolution:  wontfix   |    Keywords:  r.out.gdal table attribute alignment
  Platform:  Linux     |         Cpu:  x86-64                              
-----------------------+----------------------------------------------------

Comment(by dnewcomb):

 Replying to [comment:2 mmetz]:
 > Replying to [ticket:2501 dnewcomb]:
 > > Exporting integer grids with values starting with 1 using r.out.gdal
 -t results in a raster attribute table with vertically shifted values in
 the last 3 columns.
 >
 > In your example, the output is shifted in the first 2 columns. The last
 3 columns are correct. What software did you use? The faulty fields `OID`
 and `value` are added by this software.
 >
 > Here is an example using the NC sample dataset:
 >
 > {{{
 > g.region -p rast=landclass96
 > r.out.gdal in=landclass96 out=landclass96.tif -t
 > }}}
 >
 > This creates a GeoTIFF with an associated file landclass96.tif.aux.xml
 holding the attribute table. The fields and first entry of this attribute
 table are
 > {{{
 > min, max, label
 > 1, 1, developed
 > }}}
 > all fine.
 >
 > According to `gdalinfo landclass96.tif`, the fields and first entry of
 this attribute table are
 > {{{
 > min, max, label
 > 1, 1, developed
 > }}}
 > all fine.
 >
 > Exporting landclass96 in Erdas Imagine format (`format=HFA`), there is
 no associated .xml file.
 >
 > According to `gdalinfo landclass96.img`, the fields and first entry of
 this attribute table are now
 > {{{
 > Red, Green, Blue, min, max, Class_Names
 > 0, 0, 0, 0, 1, 1, developed
 > }}}
 >
 > this is wrong, a bug in GDAL.
 >
 > If GDAL itself is not able to correctly reproduce raster attribute
 tables created by itself, other software does not really have a chance to
 read raster attribute tables ay provided by GDAL. Further on, it seems
 that some other software further modifies the raster attribute table:
 >
 > It seems that raster attribute tables created by GDAL are not widely
 supported, if yes, errors might be introduced.
 >
 > Closing as wontfix because this is a problem of GDAL and GIS software
 other than GRASS.

 I'll check with the gdal list.
 BTW,I'm running GRASS 70 with gdal 1.11.1, and when I run r.out.gdal -t, I
 get associated .xml files with both .tif and .img formats.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2501#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list