[GRASSLIST:2577] Re: Moire effect in aspect map

John Gillette JGillette at rfmd.com
Thu Feb 12 11:53:50 EST 2004


OK. There's a problem here.  If you look at the coordinates from grass
versus gdal, Grass has shifted the NW coordinate 1/2 resolution size
to the north and west. This would be consistent if grass was interpreting
the gdal coordinates to be the centers of the pixel cells.  BUT, then
grass ends up with a SE coordinate that is 1.5 cells to the north and west
of the gdal SE corner and therefore ends up with 1 fewer row and column than
the gdal data.  (I would have expected this to be .5 cells to the SE, if grass
was using cell centers and I would have expected 1 MORE row and column.) 
This is based on the information you show below.

gdal, on the other hand, appears to be using the coordinates as cell edges
because the number of columns it reports is (E-W)/resolution.  If it was
using the coordinates as cell centers, the number would be [(E-W)/resolution]+1.

It would be interesting to confirm exactly how many rows and columns are 
actually in the data.  Perhaps you could use gdal_translate to translate the
file into tiff and use some picture program to tell you what the actual
dimensions of the tiff are. (Also look for your moire pattern.)

In any event, there seems to be an inconsistency here between grass and gdal.

John 



-----Original Message-----
Sent: Wednesday, February 11, 2004 4:37 PM
To: Grasslist
Subject: [GRASSLIST:2567] Re: Moire effect in aspect map


Sorry for bothering you again... 


gdalinfo gives the same info for projection, zone, datum, and ellipsoid as my default settings. 


Last part of the output of gdalinfo: 
Origin = (131904.828978,4561132.087882) 
Pixel Size = (27.27543571,-27.27543571) 
Corner Coordinates: 
Upper Left ( 131904.829, 4561132.088) 
Lower Left ( 131904.829, 4317044.214) 
Upper Right ( 416060.318, 4561132.088) 
Lower Right ( 416060.318, 4317044.214) 
Center ( 273982.574, 4439088.151) 
Band 1 Block=256x4 Type=Float32, ColorInterp=Undefined 
Min=1280.949 Max=4412.362 
NoData Value=-3.40282e+38 


This is consistent with the output of r.info when I import the DEM with the -o flag, i.e. when I override the projection to get quadratic grid cells: 
Type of Map: raster 
Number of Categories: 4412 
Data Type: FCELL 
Rows: 8948 
Columns: 10417 
Total Cells: 93211316 
Projection: UTM (zone 13) 
N: 4561145.72559973 S: 4317085.1268369 Res: 27.27543571 
E: 416019.40508569 W: 131891.19125998 Res: 27.27543571 
Range of data: min = 0.000000 max = 4412.000000 


The only thing that is different in gdalinfo is: 
Size is 10418, 8949 
and the Min/Max values. 




More information about the grass-user mailing list