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

Debian UserDavid D Gray ddgray at armadce.demon.co.uk
Mon Oct 30 09:01:04 EST 2000


Markus Neteler wrote:
> 
> On Fri, Oct 27, 2000 at 07:08:12PM -0700, Eric G . Miller wrote:
> > The site list format spec. says FP cats are okay (though, I disagree
> > with this notion).  It also says a cat is not required.  The tricky
> > thing here is, if the raster is an INT type, then you really want to put
> > the value in the cat since there is no INT attribute type in the sites
> > spec.  Automatically putting it in a '%' (decimal) field will cause it
> > to alway be interpreted as FP later.  On the flip side, some modules are
> > not up to date with the current sites format (s.surf.rst is mentioned)
> > and expect a certain format.  These modules should be updated so the
> > user can specify what attribute to use (it's often relatively easy
> > to add this functionality).
> >
> > As far as r.to.sites goes,  I'm favoring either writing a cat for CELL,
> > or writing a '%' for FCELL.  I *really* don't like non-integer values
> > for the cat.  It screws up conversion to vector which does not support
> > FP cats (and really can't).
> Hi Eric, hi all,
> 
> I agree to restrict sites "#cat" to INT only. For me it is a sort of
> index (and additionally common INT values). To store FP in cat
> field is somewhat inconsistent as we have the %double, too.
> 
> My proposal is to change the specifications to have it more restrict.
> Then "type guessing" is not required any more as only INT would be
> allowed for #cat field.
> 
> For r.to.sites we could insert a switch for CELL and FCELL to
> suppprt #cat resp. %double. Then the "-a" would not be required any
> more for r.to.sites.
> 
> Bill, could you live with that?
> As far as I see this restriction would not break anything.
> 
> Kind regards
> 
>  Markus
> 


Hi Markus, Eric, all

That's OK by me. The sites modules I have worked on only use CELL cats
anyway. Very little recoding would be needed.

Just a thought for a future idea. Something that is a bit annoying in
some contexts is that the numerical _attribute_ fields must always be
represented as fp, as Eric has pointed out. Could a new int type be
added to the struct so that it would be for example:

typedef struct
{
  double east, north;
  double *dim;
  int dim_alloc;
  CELL cat;
  int str_alloc;
  char **str_att;
  int dbl_alloc;
  double *dbl_att;
  int int_alloc;
  double *int_att;
} Site;

Maybe if that was the case, the cat field could be confined (by
convention though not by compulsion) to an index or key. I think this is
the way we want to go with vector data also. This would allow existing
modules to continue to use the cat, but modules could be changed at
leisure to use an int attribute while still allowing a cat to be
selected as a non-default option.

David

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