[GRASS5] d.site.labels and double precision categories
H Bowman
hamish_nospam at yahoo.com
Wed May 28 03:55:09 EDT 2003
> Re: [GRASS5] TODOs - Wishes for 5.0.3
>
> Also I was wondering whether it would be useful to include r.recolor
> and d.site.labels from
> http://grass.itc.it/outgoing/SJGeo.tar.gz
> and r.wavelets into CVS so that it is easier for people to try them
> out. I am not sure whether any of these tools are under development
> for 5.1(in particular histogram equalized color tables and writing
> rotated site labels may be something that users would appreciate).
Just a note about d.site.labels,
I've been thinking about an option to limit the significant digits
for the display of attr=double. Having text like "145.000000" everywhere
makes a horrible mess when there are lots of sites. I've been
manually hacking "%.0lf" into do_labels.c. (I use this a lot
for tracking down the cause of errors in s.surf.rst results)
.. which leads me to my next question:
d.site.labels's do_labels.c uses "%lf" for several things, including
categories and dimensions. Moreover, it distinguishes between int, float,
and double category types, which doesn't seem right- maybe I don't fully
understand the "new" sites layout, but I was under the understanding
that categories had to be integers..
The PDF version of the programmer's manual states in section 12.13.1.1
(p.167) that "Categories must be integers."
But in section 12.13.4 (p.171) it defines the Site structure with
RASTER_MAP_TYPE cattype;
CELL ccat;
FCELL fcat;
DCELL dcat;
do_sites.c and an example in the programmer's manual (p.178) both check
against 'cattype' before choosing %d, %f, or %lf ..
So which is it? Are Site structures re-used in raster maps & thus CELL
is the only meaningful category type for Sites? Does 'category' have
multiple meanings in the GRASS code? Does 'Sites' have multiple
meanings? I'm lost.
thanks,
Hamish
More information about the grass-dev
mailing list