[GRASS5] Re: [GRASSLIST:1775] r.in.bin

Glynn Clements glynn.clements at virgin.net
Fri Apr 27 17:10:35 EDT 2001


Bob Covill wrote:

> > > First, congratulations for a briliant program.
> > >
> > > My problem (is it a bug?):
> > > I'm getting a gtopo30 file from:
> > > http://edcdaac.usgs.gov/gtopo30/w020n90.html
> > >
> > > The I try to import the .DEM file into Grass with r.in.bin
> > >
> > > I get all OK (byte swap, signed integer, etc...) except that at a level of
> > > about 110 (going up a hill for ex.), the z (altitude) values suddently go to
> > > -120, and then increase in line with the terrain.
> > >
> > > Has anybody seen that behaviour?
> > >
> > > I'm running 5.0 beta 11 on Linux RH 7.0 (2.2.16 kernel)
> 
> I finaly got around to downloading and importing the DEM from the above
> link. I have been able to import the data successfully into both a Lat
> Long and XY database using the following command:
> 
> r.in.bin input=W020N90.DEM output=W020N90.DEM north=90 south=40 east=20
> west=-20 r=6000 c=4800 anull=-9999 bytes=2
> 
> I imported it on both a SUN and Linux with byteswapping set accordingly.
> The minmax reported from r.describe is the correct -30 to 4536. You may
> have been getting incorrect results with the -s flag which I believe was
> intended for data with a range of -127 to 127.

That would explain it; the case which worked for me could have been
when I "forgot" the -s flag.

I suggest that it be disabled for importing 2-/4-byte data; the code
is:

	if (sflag && cell[col] > 127) cell[col] -= 256;

which certainly doesn't implement "signed" behaviour on anything other
than bytes, but it is being used for all sizes.

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

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list