[GRASS-user] r.in.srtm help, again

antonio rodriguez antonio.raju at gmail.com
Wed Mar 14 04:45:07 EDT 2007


Hamish escribió:
> antonio rodriguez wrote:
>   
>> I have some bathymetric data from GEBCO which are in .grd format (GMT)
>>
>> so I've tried:
>>
>> r.in.bin -h in=data.grd out=bati
>>
>> and I get:
>>
>> ERROR: North must be north of south
>>
>> The coordinates of the data are 38n/34n 9w/2w
>>
>> I've tried too:
>>
>> r.in.bin input=/home/toni/tmp/38n34n9w2w/38n34n9w2w.grd output=bati 
>> north=38 south=34 east=-2 west=-9
>>
>> Using rows=4 cols=11
>>     
>
>  ^^^^
>
>   
>> ATENCIÓN: Bytes do not match File size
>> ATENCIÓN: File Size 319216 ... Total Bytes 44
>> ATENCIÓN: Try bytes=7254 or adjusting input parameters
>>
>> So I tried with bytes=7254 (bytes=7255, bytes=7256) but I never get
>> the  right number
>>
>> Any idea?
>>     
>
>
> set the correct rows= and cols= options. Right now it is guessing the
> raster resolution is 1 pixel = 1 degree x 1 degree.
>
> note the bytes description; it will mostly always be 1, 2, or 4:
>    bytes   Number of bytes per cell (1, 2, 4)
>            default: 1
>
>
>
> Hamish
>
>
>   
Hamish,

I've made first:

grdinfo 38n34n9w2w.grd

38n34n9w2w.grd: Title: GEBCO One Minute Grid
38n34n9w2w.grd: Command: 1.02
38n34n9w2w.grd: Remark:
38n34n9w2w.grd: Normal node registration used
38n34n9w2w.grd: grdfile format: cs (# 8)
38n34n9w2w.grd: x_min: -9 x_max: -2 x_inc: 0.0166667 name: user_x_unit 
nx: 421
38n34n9w2w.grd: y_min: 34 y_max: 38 y_inc: 0.0166667 name: user_y_unit 
ny: 241
38n34n9w2w.grd: z_min: -4060 z_max: 3110 name: user_z_unit
38n34n9w2w.grd: scale_factor: 1 add_offset: 0

So from the nx and ny values above, in GRASS I've tried:

r.in.bin input=/home/toni/tmp/38n34n9w2w/38n34n9w2w.grd output=bati 
north=38 south=34 east=-2 west=-9 rows=241 cols=421

ATENCIÓN: Bytes do not match File size
ATENCIÓN: File Size 203536 ... Total Bytes 101461
ATENCIÓN: Try bytes=2 or adjusting input parameters

So, again:

r.in.bin input=/home/toni/tmp/38n34n9w2w/38n34n9w2w.grd output=bati 
north=38 south=34 east=-2 west=-9 rows=241 cols=421 bytes=2
ATENCIÓN: Bytes do not match File size
ATENCIÓN: File Size 203536 ... Total Bytes 202922
ATENCIÓN: Try bytes=2 or adjusting input parameters

I tried with bytes=1 and bytes=4 but the same problem. The combination 
of rows, cols and bytes never match the file size: 203536

TIA

Antonio

                                                   








More information about the grass-user mailing list