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

Bill Brown - staff brown at gis.uiuc.edu
Tue Oct 24 12:27:50 EDT 2000


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

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

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.

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


Hope this helps -

Bill


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