[GRASS5] d.vect.area
Eric G. Miller
egm2 at jps.net
Thu Jan 31 11:02:55 EST 2002
On Thu, 31 Jan 2002 14:11:32 +0100, "M Lennert" <fa1079 at qmul.ac.uk> wrote:
> Hi all,
>
> I tested d.vect.area on a very moderate (589 area, no islands
> AFAIK) vector file, but even on such a file the speed difference was
> significant in comparison to d.area: 3 seconds for the former
> compared to 5.5 seconds for the latter.
>
> I was just wondering, Eric, why you decided to implement
> d.vect.area with a cat-rgb file option, and not with the catnum
> option that was in d.area. This means that for scripts like the
> d.area.class I posted last week, I will have to go through a
> temporary file which will hamper perfomance again... I guess all
> this will not be a problem with the new vector format, but for the
> time being, I liked the catnum option.
Thought it'd be easier to figure out a color scheme once, and then
reuse it. Also, it's a bit faster to approach it that way if you
want to draw multicolored (only have to go through the entire
dataset once). And it does use category number (not the label).
I, personally, wanted to be able to save a color scheme after
deciding on it, and be able to easily reuse it. That's the main
reason (selfish, I know). I might be talked into the "catnum"
argument, but that approach isn't very amenable to more than
a few categories (there's a limit on command line argument
length). Also, I'd think about having your script generate a
"legend" file that the user could save for reuse. Besides,
the performance hit of generating even a temporary file is
probably insubstantial compared to iterating through the
dataset multiple times to draw each color. Color lookups
in d.vect.area should be pretty fast even for a very
large number of categories (unlike the raster color lookups,
I'm using a balanced tree which scales well).
I was also thinking about creating some palettes for the
"random" color option (and perhaps making it really random).
The standard GRASS colors are fairly boring.
--
Eric G. Miller <egm2 at jps.net>
More information about the grass-dev
mailing list