[GRASSLIST:6057] Re: How deep is a region?

Radim Blazek blazek at itc.it
Tue Mar 8 02:09:55 EST 2005


Roger Bivand wrote:
> On Mon, 7 Mar 2005, Radim Blazek wrote:
> 
> 
>>I see, r.in.gdal was fixed after beta2, should be ok in cvs, just edit 
>>the DEFAULT_WIND and change depths to 1.
> 
> 
> Reading the CVS shows include/gis.h struct Cell_head has int depths, the 
> changes in raster/r.in.gdal/main.c are setting cellhd.depths = 1.5; - why 
> should this work? And why 1.5 when the top is 1.0, bottom 0.0, and 
> resolution 1.0, all doubles? Shouldn't it just be (int) 1?

cellhd.depths should be inited to 1, Cho followed gis/adj_cellhd.c
where
cellhd->depths =
  (cellhd->top - cellhd->bottom + cellhd->tb_res/2.0) / cellhd->tb_res;

I don't know why cellhd->tb_res/2.0, it is copy-paste of cols/rows.

Radim

> Roger
> 
> 
>>Radim
>>
>>dpadam wrote:
>>
>>>It was created using r.in.gdal; I haven't been able to do anything further
>>>because of the "invalid region" errors.
>>>
>>>david
>>>
>>>
>>>---------- Original Message -----------
>>>From: Radim Blazek <blazek at itc.it>
>>>To: David Adam <david at quercus.org>
>>>Cc: grasslist at baylor.edu
>>>Sent: Mon, 07 Mar 2005 09:39:52 +0100
>>>Subject: Re: [GRASSLIST:6019] Re: How deep is a region?
>>>
>>>
>>>
>>>>How was the region file created - what was the last module which
>>>>modified the region?
>>>>
>>>>Radim
>>>>
>>>>David Adam wrote:
>>>>
>>>>
>>>>>Hamish wrote:
>>>>>
>>>>>
>>>>>
>>>>>>>I'm trying to set up a region, starting with a Landsat TIFF
>>>>>>>image from California.  I have imported the region with r.in.gdal,
>>>>>>>which produces a large file. I then close grass60 and reopen in the
>>>>>>>new location, at which point I get the errors
>>>>>>>
>>>>>>>
>>>>>>>GRASS_INFO_ERROR(5579,1): default region is invalid
>>>>>>>GRASS_INFO_ERROR(5579,1): line 15: <depths:     -1074916636>
>>>>>>>
>>>>>>>The relevant file for the region is
>>>>>>>
>>>>>>>DEFAULT_WIND --
>>>>>>>
>>>>>>>proj:       99
>>>>>>>zone:       0
>>>>>>>north:      213720.89780907
>>>>>>>south:      -6149.10219093
>>>>>>>east:       -168613.96484194
>>>>>>>west:       -404623.96484194
>>>>>>>cols:       7867
>>>>>>>rows:       7329
>>>>>>>e-w resol:  30
>>>>>>>n-s resol:  30
>>>>>>>top:        1
>>>>>>>bottom:     0
>>>>>>>cols3:      7867
>>>>>>>rows3:      7329
>>>>>>>depths:     -1074916636
>>>>>>>e-w resol3: 30
>>>>>>>n-s resol3: 30
>>>>>>>t-b resol:  1
>>>>>>>
>>>>>>>--------------
>>>>>>>
>>>>>>>Most of the fields in the file are explained in the REGION section
>>>>>>>of the manual, but I can't seem to find anyplace that defines or
>>>>>>>explains what the "depths" field is about.  But until I can get
>>>>>>>grass to accept the region, I can't do much of anything.
>>>>>>>
>>>>>>>All help is much appreciated...
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>rows,cols, and res=30 all look right. I don't know what is causing the
>>>>>>depths to go nuts. Try editing the "WIND" file in your mapset to make
>>>>>>depths: 1?
>>>>>>
>>>>>>
>>>>>>maybe this works as a temporary workaround--
>>>>>>
>>>>>>try viewing the GeoTIFF meta-data with "gdalinfo".
>>>>>>
>>>>>>If the meta-data is bogus, wipe it clean with:
>>>>>>
>>>>>>tifftopnm map.tiff | pnmtotiff > map_clean.tiff
>>>>>>
>>>>>>
>>>>>>This will wipe all geo-coding, but you should be able to load into a X,Y
>>>>>>location ok and at least view the data. May rectify from there.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Hamish
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>Thanks, I'll give that a try.
>>>>>In response to another reply, this is happening under Grass6.0.0beta2.
>>>>>
>>>>>But one of my questions still stands: What does depth represent?  The
>>>>>other terms in the
>>>>>DEFAULT_WIND file are defined in the g.region documentation, but not
>>>>>depth.  If I knew
>>>>>what it stands for, perhaps I could guess the right value.
>>>>>
>>>>>Thanks for the help!
>>>>>
>>>>>david
>>>
>>>------- End of Original Message -------
>>
>>
> 




More information about the grass-user mailing list