[GRASSLIST:6006] How deep is a region?

Greetings!

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...

david

Rich Shepard wrote:

On Sat, 5 Mar 2005, David Adam wrote:

GRASS_INFO_ERROR(5579,1): default region is invalid
GRASS_INFO_ERROR(5579,1): line 15: <depths: -1074916636>

cols: 7867
rows: 7329

david,

  Notice that this is 57.6 million cells. Do you have sufficient memory for
these? The depth error might be spurious because GRASS cannot be more
specific.

Rich

Well, according to my system monitor I'm using less than 40% of 377MB. I keep getting variations
on a "region is invalid" theme, with the "depths:" line as the last bit of information.

And once again, can anyone tell me what "depths:" refers to?

TIA,

david

When using at database with the RGB field

and doing

   d.vect -a

how do i get the area line color to be the same as the area ?

or

how do i supress the line around the area ?

thank you

Steps so far

echo "alter table wind_ca add column grassrgb varchar(11)" | db.execute
echo "update wind_ca set grassrgb='222:184:135' where GRIDCODE=2" |
db.execute
--repeated as needed---
d.vect -a map=wind_ca type=area display=shape

how do i suppress the displaying of the line around each polygon/shape ?

I'm creating a map of wind power for the the state of calif.

d.vect -a map=wind_ca type=area display=shape

so far so good (except I can't get rid if the border line)

The last step I want to do is place political (state and
county) borders on the map.

I imported a shp of US state borders, but when I use it

d.vect map=states

it's areas are "filled", if I display this first, the data
from wind_ca covers most of the border.

what can i do ?

thanks

-pete

found ...

BTW the "color" none is missing from the docs

sorry for all the noise on the list

When using at database with the RGB field

and doing

   d.vect -a

..

how do i supress the line around the area ?

d.vect -a color=none

color= is for line color. It can be a standard color name, R:G:B
triplet (0-255), or the word "none".

Many display modules have this same color naming flexibility.

Hamish

I'm creating a map of wind power for the the state of calif.

d.vect -a map=wind_ca type=area display=shape

so far so good (except I can't get rid if the border line)

as previous email, to get rid of line drawing:

d.vect -a color=none

The last step I want to do is place political (state and
county) borders on the map.

I imported a shp of US state borders, but when I use it

d.vect map=states

it's areas are "filled", if I display this first, the data
from wind_ca covers most of the border.

In the same fashion, set the fill color to "none":

d.vect map=states fcolor=none

another way with same result is to just draw vector boundaries, not
areas:

d.vect map=states type=boundary

This second method also avoids drawing the centroid markers.

Hamish

what Grass version? beta, cvs - date?

I recall there've been some bugfixes recently on a related topic, try the latest CVS snapshot and see if it works

Maciek

----- Original Message ----- From: "David Adam" <david@quercus.org>
To: <grasslist@baylor.edu>
Sent: Saturday, March 05, 2005 6:23 PM
Subject: [GRASSLIST:6006] How deep is a region?

Greetings!

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...

david

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

On Sun, 6 Mar 2005, 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.

This seems to be another side-effect of the precipitate introduction of 3D
windows in 6.0.0beta*. The code seems to be in lib/gis/adj_cellhd.c, about
line 249 - it may not be, because working out what is going on is far from
easy. r.in.gdal seems not to write a depth (about raster/r.in.gdal/main.c
line 227 and following). So the next operation to access the data tries to
make one, and:

if (!depth_flag)
{
    cellhd->depths = (cellhd->top - cellhd->bottom + cellhd->tb_res/2.0) /
        cellhd->tb_res;
    if (cellhd->depths < 0)
    cellhd->depths = 1;
}

says:

(1 - 0 + (1/2)) / 1

[1] 1.5

for this data. But while top, bottom and tb_res are double, depths is
integer, and the printed output looks very much like an integer that has
fallen over the edge. But maybe the functions called don't visit
G_adjust_Cell_head3(), just something else?

It would be really nice if we had a fixed set of operations that a release
candidate had to pass before changes were introduced and made available to
non-developers.

Roger

Thanks for the help!

david

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

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

I see, r.in.gdal was fixed after beta2, should be ok in cvs, just edit the DEFAULT_WIND and change depths to 1.

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@itc.it>
To: David Adam <david@quercus.org>
Cc: grasslist@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 -------

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?

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@itc.it>
> To: David Adam <david@quercus.org>
> Cc: grasslist@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 -------

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

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@itc.it>
To: David Adam <david@quercus.org>
Cc: grasslist@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 -------

On Tue, 8 Mar 2005, Radim Blazek wrote:

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.

Nor do I - I've added Cho to the CCs here in case GRASSLIST isn't enough.
Who else could fix and check this before tomorrow, someone who knows and
uses r.in.gdal?

Roger

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@itc.it>
>>>To: David Adam <david@quercus.org>
>>>Cc: grasslist@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 -------
>>
>>
>

--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand@nhh.no

Roger Bivand wrote:

On Tue, 8 Mar 2005, Radim Blazek wrote:

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.

Nor do I - I've added Cho to the CCs here in case GRASSLIST isn't enough. Who else could fix and check this before tomorrow, someone who knows and uses r.in.gdal?

cellhd.depths in r.in.gdal should be set to 1 without doubts.
I don't maintain raster modules.

Radim

Roger

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@itc.it>
To: David Adam <david@quercus.org>
Cc: grasslist@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 -------

hi all!!!

I'm having just some troubles with grass 5.7 in these days....... now I can't
find the command r.mask, has it been substitute by other command?
another thing... we've tried to work con r.reclass, but it seems it doesn't
work.... when the windows opens, it asks for the name of the raster map to
be reclassified, the name of the resultant map and the title and no more.
so when we say "run" logically the comand answers... "no rules especified"
the question is: where have we to specify the rules???

thanks in advance,

Chiara

__________________________________________________________________
Tiscali Adsl 3 Mega Flat con 3 MESI GRATIS!
Con Tiscali Adsl 3 Mega Flat navighi con la supervelocita'
a soli 29.95 euro al mese, senza limiti di tempo. E se attivi
entro il 15 Marzo, 3 MESI sono GRATIS!
Scopri come su http://abbonati.tiscali.it/adsl/

On Tue, 8 Mar 2005 13:05:25 +0100
kj_in_tec@tiscali.it wrote:

hi all!!!

I'm having just some troubles with grass 5.7 in these days....... now I can't
find the command r.mask, has it been substitute by other command?
another thing... we've tried to work con r.reclass, but it seems it doesn't
work.... when the windows opens, it asks for the name of the raster map to
be reclassified, the name of the resultant map and the title and no more.
so when we say "run" logically the comand answers... "no rules especified"
the question is: where have we to specify the rules???

thanks in advance,

Chiara

To create a mask:
r.mapcalc MASK=<input file>

To get rid of it
g.remove rast=MASK

T
--
Trevor Wiens
twiens@interbaun.com

The significant problems that we face cannot be solved at the same
level of thinking we were at when we created them.
(Albert Einstein)

Hi Chiara,

As I know in 6.0 it's only necesary to rename the raster file you want
to be the mask with the name "MASK"

I can't help you with the second questions as r.reclass works fine for
me on 6.0 or 5.4(I'm not using 5.7)

Hope this helps,

hi all!!!

I'm having just some troubles with grass 5.7 in these days....... now I
can't find the command r.mask, has it been substitute by other command?
another thing... we've tried to work con r.reclass, but it seems it
doesn't work.... when the windows opens, it asks for the name of the
raster map to be reclassified, the name of the resultant map and the
title and no more. so when we say "run" logically the comand answers...
"no rules especified" the question is: where have we to specify the
rules???

thanks in advance,

Chiara

__________________________________________________________________
Tiscali Adsl 3 Mega Flat con 3 MESI GRATIS!
Con Tiscali Adsl 3 Mega Flat navighi con la supervelocita'
a soli 29.95 euro al mese, senza limiti di tempo. E se attivi entro il
15 Marzo, 3 MESI sono GRATIS! Scopri come su
http://abbonati.tiscali.it/adsl/