[GRASS5] r.to.sites: change proposal for -a

Markus Neteler neteler at geog.uni-hannover.de
Tue Oct 24 13:21:03 EDT 2000


On Tue, Oct 24, 2000 at 11:27:50AM -0500, Bill Brown - staff wrote:
> >
> >I didn't change that, was just guessing (I should read the programmer's
> >manual). But I am expecting problems with s.surf.rst & friends if it is not
> >stored as %double. Or am I wrong?
> 
> Yes, you currently need to use r.to.sites -a if you want to
> generate input for s.surf.rst.  I imagine though that there
> are a lot of existing scripts out there that expect r.to.sites
> to generate # by default, so I have no problem with specifying -a
> if I know I need input for s.surf.rst.  It's not too hard to
> convert # to % using vi or awk, if you have an old site list
> you want to use, but it would be much better if somebody 
> would write this program:
> http://www2.gis.uiuc.edu:2280/modviz/grass5/s.format.html

Bill,

thanks for your notes. Why I am insiting here is that I want to
get it as convenient as possible. I am thinking of all the new
users (or lazy users) who say:  "Why should I always add -a
if the GRASS could do it for me?"
 
> >
> >The s.info only accepts INT cats:
> >s.info ktb12.5
> >[...]
> >Number of DIMENSIONS:         2
> >--------------------
> >                 - - MIN - -     - - MAX - -
> >        dim  1  3558006.250000  3574281.250000  Easting
> >        dim  2  5756006.250000  5775993.750000  Northing
> >
> >Type of CATEGORY information: CELL_TYPE
> >----------------------------
> >                 - - MIN - -     - - MAX - -
> >                          80             370    No Label
> >[...]
> 
> mine accepts FCELL_TYPE:
> 
>       Type of CATEGORY information: FCELL_TYPE
>       ----------------------------
> 		       - - MIN - -     - - MAX - -
> 			  1.100000        5.500000    

Aha! It seems you have a different version. Would you share it?

> I think the way the sites library tries to decide if the # is an
> int or float is to just read the first one and take a guess by
> using a decimal point as a clue.  If the first site CAT doesn't have
> a decimal, it reads them all as ints so you have to make sure to
> use a format that will print the cats as floats (1.0 rather than 1)
> when you are generating a fp site list. The sites library expects
> consistant site lists - the number and types of attributes must be 
> consistant and the first site is used to guess what it is.  There is
> a format field in the header but I'm not sure what it's used for and
> it doesn't allow specifying the type of the CAT.
But this "guessing from the first" is quite error prone (like my
random example from previous mail). Of course it would be too time
consuming to parse the entire sites list to determine the format.

> >
> >And if I want to reconvert the list back to raster with s.to.rast,
> >this module will make an INT raster map:
> 
> That's because it is still using the sites library to guess the cat
> type.
O.k., but it does not fix the problem. :-)

I understand you prefer to keep the "-a" parameter? For me it's somewhat
inconvenient as most of the sites modules don't accept site lists
generated without "-a"...

Kind regards

 Markus

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