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

Soeren Gebbert soerengebbert at googlemail.com
Wed Aug 12 03:19:09 EDT 2009


Hello Markus,
many thanks for your response.
I guess the behavior of r.out.gdal in case of a raster map in UTM projection
and DTED export seems to be correct.
So i removed the DTED test from the GRASS testsuite, based on your
suggestions and the gdal documentation.

soeren

2009/8/11 Markus Metz <markus.metz.giswork at googlemail.com>

> From the DTED specs:
>
> A data file of DTED Level 0, DTED Level 1 or
> DTED Level 2 is a 1° by 1° cell defined by whole degree latitude and
> longitude
> lines on WGS. A DTED file shall not cross whole degree latitude or
> longitude
> lines.
>
> Matrix intervals for DTED Level 0.
> ZONE LATITUDE latitude x longitude INTERVAL
> I 0° - 50° North-South 30 x 30 seconds
> II 50° - 70° North-South 30 x 60 seconds
> III 70° - 75° North-South 30 x 90 seconds
> IV 75° - 80° North-South 30 x 120 seconds
> V 80° - 90° North-South 30 x 180 seconds
>
> Matrix intervals for DTED Level 1.
> ZONE LATITUDE latitude x longitude INTERVAL
> I 0° - 50° North-South 3 x 3 seconds
> II 50° - 70° North-South 3 x 6 seconds
> III 70° - 75° North-South 3 x 9 seconds
> IV 75° - 80° North-South 3 x 12 seconds
> V 80° - 90° North-South 3 x 18 seconds
>
> Matrix intervals for DTED Level 2.
> ZONE LATITUDE latitude x longitude INTERVAL
> I 0° - 50° North-South 1 x 1 seconds
> II 50° - 70° North-South 1 x 2 seconds
> III 70° - 75° North-South 1 x 3 seconds
> IV 75° - 80° North-South 1 x 4 seconds
> V 80° - 90° North-South 1 x 6 seconds
>
> No idea how strict the gdal driver for DTED is, but it seems that it is
> very strict and won't work without reprojection, followed by setting
> region extends and resolution according to the desired DTED level.
>
> Markus M
>
>
> Soeren Gebbert wrote:
>
>> 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 <http://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
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> grass-dev mailing list
>> grass-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20090812/91af5aef/attachment-0001.html


More information about the grass-dev mailing list