[GRASSLIST:2296] s.surf.rst generating seemingly empty rasters

This occurs on the Windows port of GRASS (5.0.2) using the cygwin
environment and XWindows driver

No matter what I try, it seems that when I use s.surf.rst to produce a
raster file from my sites file (hg1), I produce trashed rasters that for
example have a size of 0 bytes in the cell directory in the mapset.
I tried using g.region sites=hg1 to change the region but to no avail.
The actual s.surf.rst process works OK, discarding only 4 of my points,
including the rest, and taking some time to complete because of the
relatively high resolution.
If I then try to display the raster I've created I get the error message
Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

Could it be because I have null values in the site file?

Region:-

proj: 3
zone: 0
north: 90N
south: 89:55:12S
east: 153:02:24W
west: 121:55:12W
cols: 448
rows: 245
e-w resol: 0:44:02.785714
n-s resol: 0:44:03.722449

Site file (hg1)

name|
desc|
time|
labels|
form|
-3.45|53.5|%0.8265 @"x"
-0.09|52.5|%0.655 @"x"
5.45|53.1|%0.55323 @"x"
10.8|59.9|%0.2651 @"x"
18.1|59.3|%0.1887 @"x"
-21.9|64.2|%0.4144 @"x"
23.7|38|%0.1724 @"x"
20.3|67.9|%0.0857 @"xi"
25|60.2|%0.0404 @"x"
21.6|53.9|%0.0402 @"x"
77.2|28.6|%0.1707 @"x"
77.4|23.3|%0.125 @"x"
106.9|47.9|%0.064 @"x"
25.0|60.2|%0.0404 @"x"
27.6|53.9|%0.0402 @"x"
77.2|28.6|%0.1707 @"x"
77.4|23.3|%0.125 @"x"
106.9|47.9|%0.064 @"x"
33.4|35.3|%0.0816 @"x"
35.0|32.8|%0.3556 @"x"
39.9|24.6|%0.1531 @"x"
39.9|21.5|%0.1029 @"x"
29.0|41.0|%0.1844 @"x"
34.5|31.5|%0.0839 @"x"
36.3|33.5|%0.0972 @"x"
44.8|41.7|%0.1038 @"x"
43.8|40.8|%0.4 @"x"
43.3|38.5|%0.1684 @"x"
44.3|39.8|%0.2273 @"x"
44.5|40.2|%0.2222 @"x"
44.5|40.8|%0.2222 @"x"
32.7|41.2|%0.4279 @"x"
37.3|36.2|%0.0943 @"x"
51.5|35.7|%0.3214 @"x"
71.7|41.0|%0.2857 @"x"
34.0|18.0|%0.0 @"x"
44.0|15.0|%0.0484 @"x"
40.0|40.3|%0.075 @"x"
26.0|-24.8|%0.0 @"x"
40.0|8.0|%0.0 @"x"

Matthew Tennant wrote:

This occurs on the Windows port of GRASS (5.0.2) using the cygwin
environment and XWindows driver

No matter what I try, it seems that when I use s.surf.rst to produce a
raster file from my sites file (hg1), I produce trashed rasters that for
example have a size of 0 bytes in the cell directory in the mapset.

s.surf.rst creates floating-point maps. These have a zero-byte file in
the "cell" directory, with the actual data in the "fcell" directory.

I tried using g.region sites=hg1 to change the region but to no avail.
The actual s.surf.rst process works OK, discarding only 4 of my points,
including the rest, and taking some time to complete because of the
relatively high resolution.
If I then try to display the raster I've created I get the error message
Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

The most common reason for this error on Windows is that the data
files are stored on a Cygwin "filesystem" which performs automatic
LF<->CRLF translation. This will corrupt binary data files.

Either add "binmode" to the setting of the CYGWIN environment
variable, or use the "mount" program to change the filesystem type to
"binary".

Note: any maps which were created on a "text" filesystem will be
corrupted, and will have to be re-created (i.e. you need to run
s.surf.rst again).

Also, GRASS modules which read text files won't normally accept files
with CRLF line terminators, so you can't use Notepad etc to
create/edit them. Either use a Cygwin-based program such as vi, or a
text editor which allows explicit control of line terminators.

--
Glynn Clements <glynn.clements@virgin.net>

Glynn:

Also, GRASS modules which read text files won't normally accept files
with CRLF line terminators, so you can't use Notepad etc to
create/edit them. Either use a Cygwin-based program such as vi, or a
text editor which allows explicit control of line terminators.

may I recommend "TextPad"

Matthew:

Could it be because I have null values in the site file?

I didn't think the sites format supported null values?

If that's breaking things, you can make a clean sites file with a
command similar to:

grep -v NULL sites_file > sites_file.clean

(change "NULL" to whatever you used ..)

Hamish

Thanks for all suggestions.
I have created a DOS environment variable, CYGWIN, which is set to
"binmode".
I have also saved my site file "hg1" in Textpad to be of format UNIX and
encoding ANSI.

However, I still get the errors

d.rast map=hg1
Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

I note that in the fcell directory, the file hg1 is actually 392kb, as
Glynn suggested.

Here's the ouput from the s.surf.rst:-

Warning: strip exists with insufficient data
Warning: points are more dense than specified 'DMIN' -- ignored 4 points.
Warning: there is less than 42 points for interpolation, no segmentation
is neccessary, to run the
program faster set segmax=42 (see manual)
The number of points in sites file is 37
The number of points outside the region 0
The number of points being used (after reduction) is 33

Processing all selected output files will require 439152 bytes of disk
space for temp files

100%
Percent complete: history initiated

Any more suggestions out there?

Glynn Clements <glynn.clements@virgin.net>
Sent by: owner-GRASSLIST@baylor.edu
21/01/2004 05:13

To
"Matthew Tennant" <Matthew.Tennant@MobileInnovation.co.uk>
cc
"GRASSLIST@baylor.edu" <GRASSLIST@baylor.edu>
Subject
[GRASSLIST:2298] Re: s.surf.rst generating seemingly empty rasters

Matthew Tennant wrote:

This occurs on the Windows port of GRASS (5.0.2) using the cygwin
environment and XWindows driver

No matter what I try, it seems that when I use s.surf.rst to produce a
raster file from my sites file (hg1), I produce trashed rasters that for

example have a size of 0 bytes in the cell directory in the mapset.

s.surf.rst creates floating-point maps. These have a zero-byte file in
the "cell" directory, with the actual data in the "fcell" directory.

I tried using g.region sites=hg1 to change the region but to no avail.
The actual s.surf.rst process works OK, discarding only 4 of my points,
including the rest, and taking some time to complete because of the
relatively high resolution.
If I then try to display the raster I've created I get the error message
Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

The most common reason for this error on Windows is that the data
files are stored on a Cygwin "filesystem" which performs automatic
LF<->CRLF translation. This will corrupt binary data files.

Either add "binmode" to the setting of the CYGWIN environment
variable, or use the "mount" program to change the filesystem type to
"binary".

Note: any maps which were created on a "text" filesystem will be
corrupted, and will have to be re-created (i.e. you need to run
s.surf.rst again).

Also, GRASS modules which read text files won't normally accept files
with CRLF line terminators, so you can't use Notepad etc to
create/edit them. Either use a Cygwin-based program such as vi, or a
text editor which allows explicit control of line terminators.

--
Glynn Clements <glynn.clements@virgin.net>

ForwardSourceID:NT00009FEE

Matthew Tennant wrote:

I have created a DOS environment variable, CYGWIN, which is set to
"binmode".
I have also saved my site file "hg1" in Textpad to be of format UNIX and
encoding ANSI.

However, I still get the errors

d.rast map=hg1
Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

Are you sure that setting is effective? What is the result of running
the command "echo $CYGWIN" within the GRASS shell?

Also, what does "mount" say? For a mounted filesystem, the mount
options override the CYGWIN setting.

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements wrote

Are you sure that setting is effective? What is the result of running
the command "echo $CYGWIN" within the GRASS shell?

Also, what does "mount" say? For a mounted filesystem, the mount
options override the CYGWIN setting.

echo $CYGWIN results in a blank line being outputted

mount results in the output below (I have a lot of substed drives on my
Win2000 set-up)
Looks like I'm still in textmode! Any suggestions as to how to set
binmode? My sites file is located
in c:\cygwin\data\....... My grass installation is in
c:\cygwin\usr\local\., I think.

c:\system\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system
(binmode)

c:\cygwin\bin on /usr/bin/ type system (textmode)
c:\cygwin\lib on /usr/lib/ type system (textmode)
c:\cygwin on / type system (textmode)
c: on /cygdrive/c type type user (textmode,noumount)
d: on /cygdrive/d type type user (textmode,noumount)
h: on /cygdrive/h type type user (textmode,noumount)
j: on /cygdrive/j type type user (textmode,noumount)
k: on /cygdrive/k type type user (textmode,noumount)
l: on /cygdrive/l type type user (textmode,noumount)
etc

Matthew Tennant wrote:

> Are you sure that setting is effective? What is the result of running
> the command "echo $CYGWIN" within the GRASS shell?
>
> Also, what does "mount" say? For a mounted filesystem, the mount
> options override the CYGWIN setting.

echo $CYGWIN results in a blank line being outputted

mount results in the output below (I have a lot of substed drives on my
Win2000 set-up)
Looks like I'm still in textmode! Any suggestions as to how to set
binmode? My sites file is located
in c:\cygwin\data\....... My grass installation is in
c:\cygwin\usr\local\., I think.

c:\system\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system
(binmode)

c:\cygwin\bin on /usr/bin/ type system (textmode)
c:\cygwin\lib on /usr/lib/ type system (textmode)
c:\cygwin on / type system (textmode)

This is the problem. Try:

  mount -b c:\cygwin /

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements wrote

This is the problem. Try:

               mount -b c:\cygwin /

I tried this :-

GRASS:/usr/local/bin > mount -b c:\cygwin /

but got the message

mount: /: Mount device busy

and when I tried mount again - it was still all textmode:-

c:\system\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system
(binmode)

c:\cygwin\bin on /usr/bin/ type system (textmode)
c:\cygwin\lib on /usr/lib/ type system (textmode)
c:\cygwin on / type system (textmode)
c: on /cygdrive/c type type user (textmode,noumount)
d: on /cygdrive/d type type user (textmode,noumount)
h: on /cygdrive/h type type user (textmode,noumount)
j: on /cygdrive/j type type user (textmode,noumount)
k: on /cygdrive/k type type user (textmode,noumount)
l: on /cygdrive/l type type user (textmode,noumount)
etc

Why can't I set binmode?

Matthew Tennant wrote:

> This is the problem. Try:
>
> mount -b c:\cygwin /

I tried this :-

GRASS:/usr/local/bin > mount -b c:\cygwin /

but got the message

mount: /: Mount device busy

Try adding the -f switch, i.e.

  mount -f -b c:\cygwin /

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements wrote:-

Try adding the -f switch, i.e.

               mount -f -b c:\cygwin /

mount -f -b c:\cygwin / resulted in the error "mount: /: Invalid Argument"
I tried typing mount -f -b c:/cygwin / and this returned no error message
and also changed the output of mount so that a line was changed

"c:\cygwin on / type system" (textmode) became "c:\cygwin on / type system
(binmode)."

However, after a rerun, s.surf.rst results again in the output.

d.rast map=hg1

Warning: Fail of initial read of compressed file [hg1 in PERMANENT]
Warning: unable to open raster map [hg1 in PERMANENT]
Error: Not able to open cellfile for [hg1]

I had saved the sites file "hg1" as UNIX , ANSI file. The created hg1
raster file in fcell is 392kb big. I wonder if anything else can be wrong?
All the other rasters in my location display fine.

Any more suggestions would be appreciated - thanks for your help so far.

----------------------

Matthew Tennant

PS I have located through Google someone who had the same problem as me:-

"I have recently installed the wingrass sytem (grass5.0.0pre3) on my =
machine which is running win2000. I have tried to follow all the =
installation instuctions bt not being familiar with the whole unix like =
setup I might have made some mistakes.
Basically grass is working. I can create my own location and tcltkgrass =
is working. My problem comes when trying to create and display raster =
images. I had a 3 column ascii file that I managed to import into a =
sites list using s.in.ascii (I can disply the site data). I then tried =
to convert that into a raster image using s.to.rast and s.surf.rst. Both =
programs appear to work as they output a file. I then open a display =
window and try to display the raster file with d.rast. I get the =
following error:
  WARNING: Fail of initial read of compressed file [cape.img in user1]
  mail: not found
  WARNING: unable to open raster map [cape.img in user1]
  mail: not found
  ERROR: Not able to open cellfile for [cape.img]
  mail: not found
I thought it might be a binary read problem that I have read about in =
the mail archive but I can display raster images from the spearfish data =
set. It is only raster data sets that I create that I cannot display. I =
have also tried to import a tiff image and to display it but I get the =
same problem.=20
Is anyone able to help?
Ross"

Hi all,

I'm trying to import a LANDSAT ETM+ image which is
provided as a geoTIFF.
When I first tried to run r.in.gdal I got an error due
to the missing gdal libraries; I downloaded the source
code and installed it. I tried again but I got a
segmentation error.
I reinstalled GRASS from source code (using
--with-gdal) and when I ran r.in.gdal again, I got the
same "segmentation error".

Am I missing something here? I'd appreciate any help,

Thanks

Jaime

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

Glynn Clements wrote

Try adding the -f switch, i.e.

               mount -f -b c:\cygwin /

To end this thread I can happily say that s.surf.rst is now working for
me. Thanks for all suggestions.

The most important thing I did was to reinstall Cygwin using Unix text
files by default. After this when I did "mount" eveything seemed to be
reported as in binmode. I then cd'd to \cygdrive\c\...\local\bin\ (full
UNIX style path name ensuring drive will be mounted in binmode) and then
started grass5, and set up my location path similarly as
\cygdrive\c\...\data\. Then s.surf.rst worked