[GRASS-dev] Possible bug in r.out.gdal?

Soeren Gebbert soerengebbert at googlemail.com
Tue Aug 11 08:47:08 EDT 2009


Dear Devs,
i found a strange behavior in r.out.gdal while updating the GRASS test
suite.

Im using the grass6.4svn snapshot:
grass-6.4.svn_src_snapshot_2009_08_01.tar.gz.
on openSuse 10.3 Linux 2.6.22.19-0.2-bigsmp
gdal version 1.6.1

The test i am implementing tries to export a DCELL raster map (named
elevation ) to a DTED file with r.out.gdal.
r.out.gdal reports plenty of errors (all of the same type) an exits with
return code 0.
A dted file is created, but im not sure if it is valid.
Exporting the same file with r.out.gdal in ENVI and ELAS formats seems to
work correctly.

These steps are performed:

GRASS 6.4.0svn > g.region -p
projection: 1 (UTM)
zone:       32
datum:      wgs84
ellipsoid:  wgs84
north:      5582000
south:      5580000
west:       400000
east:       402000
nsres:      20
ewres:      20
rows:       100
cols:       100
cells:      10000

GRASS 6.4.0svn > r.info elevation
 +----------------------------------------------------------------------------+
 | Layer:    elevation                      Date: Sun Apr 30 12:48:58
2006    |
 | Mapset:   PERMANENT                      Login of Creator:
soeren          |
 | Location:
TestLocation                                                     |
 | DataBase:
/1/gebbert/src/GRASS_Testsuite                                   |
 | Title:     ( elevation
)                                                   |
 | Timestamp:
none                                                            |
 |----------------------------------------------------------------------------|
 |
|
 |   Type of Map:  raster               Number of Categories:
255             |
 |   Data Type:
DCELL                                                      |
 |   Rows:
100                                                        |
 |   Columns:
100                                                        |
 |   Total Cells:
10000                                                      |
 |        Projection: UTM (zone
32)                                           |
 |            N:    5582000    S:    5580000   Res:
20                     |
 |            E:     402000    W:     400000   Res:
20                     |
 |   Range of data:    min = 68.246322  max =
363.529491                      |
 |
|
 |   Data
Description:                                                        |
 |    generated by
r.mapcalc                                                  |
 |
|
 |
Comments:                                                                |
 |    sin(col() * 5) * col() + cos(row() * 5) * row() +
200                   |
 |
|
 +----------------------------------------------------------------------------+


GRASS 6.4.0svn > r.out.gdal --verbose format=DTED type=Float32
input=elevation output=/tmp/test.dted
....
ERROR 5: Access window out of range in RasterIO().  Requested
(0,994) of size 201x1 on raster of 100x100.
ERROR 5: Access window out of range in RasterIO().  Requested
(0,995) of size 201x1 on raster of 100x100.
ERROR 5: Access window out of range in RasterIO().  Requested
(0,996) of size 201x1 on raster of 100x100.
More than 1000 errors or warnings have been reported. No more will be
reported from now.
r.out.gdal complete.


GRASS 6.4.0svn > gdalinfo -nomd -noct -stats /tmp/test.dted
Driver: DTED/DTED Elevation Raster
Files: /tmp/test.dted
       /tmp/test.dted.aux.xml
Size is 201, 1201
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (399.997500000000002,559.000416666666638)
Pixel Size = (0.005000000000000,-0.000833333333333)
Corner Coordinates:
Upper Left  (     399.998,     559.000) (399d59'51.00"E,559d 0'1.50"N)
Lower Left  (     399.998,     558.000) (399d59'51.00"E,557d59'58.50"N)
Upper Right (     401.002,     559.000) (401d 0'9.00"E,559d 0'1.50"N)
Lower Right (     401.002,     558.000) (401d 0'9.00"E,557d59'58.50"N)
Center      (     400.500,     558.500) (400d30'0.00"E,558d30'0.00"N)
Band 1 Block=1x1201 Type=Int16, ColorInterp=Palette
  Min=0.000 Max=0.000
  Minimum=0.000, Maximum=0.000, Mean=0.000, StdDev=0.000
  NoData Value=-32767
  Unit Type: m
  Color Table (RGB with 365 entries)


Any suggestions what i did wrong?
Maybe the region settings are incompatible with the dted output coordinate
system?
Or is this a correct behavior of r.out.gdal?

Thanks in advance
best regards
Soeren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20090811/99230ea1/attachment.html


More information about the grass-dev mailing list