[GRASS-dev] random colors in d.vect

Martin Landa landa.martin at gmail.com
Thu Jun 1 04:28:22 EDT 2006


Hi all,

I have rewritten the previous patch. I have separated the added code
to a function random_color() and tried to clean the code. Now it works
also for layer=-1 (i.e. according to layer number). There is also a
small bug in the current d.vect. Flag -c does not work (in connection
with layer=-1) for areas. It should be also solved. Please test it if
you like, I have no access to the CVS...

Best, Martin

PS: I think that default value for parameter 'layer' should be -1
instead of 1. Generally, I want to display all objects no matter which
layer they are stored in.

2006/5/31, Martin Landa <landa.martin at gmail.com>:
> Hi,
>
> the difference is that the current implementation use 'pseudo random'
> colors (e.g. cat % palette_ncolors), i.e. the color composition is
> always the same. The patch changes this behaviour, it means, you will
> not get the same colours by d.vect -c (it is useful if you do not like
> the current colors).
>
> Best, Martin
>
> 2006/5/31, Huidae Cho <grass4u at gmail.com>:
> > Hi,
> >
> > What's different between 'd.vect -c' and your patch?  The -c flag also
> > implements random colors based on category/layer number.
> >
> > Huidae Cho
> >
> >
> > On Wed, May 31, 2006 at 11:36:10AM +0200, Martin Landa wrote:
> > > Hi all,
> > >
> > > I have tried to implement *random* colouring based on category number
> > > (according to layer number can be implemented later before CVS
> > > committing...), see the attached patch.
> > >
> > > I do not completely understand why you need to use in level 2
> > > Vect_line_alive() + Vect_read_line() in contrast with level 1 and
> > > function Vect_read_next_line (). In any case the functions
> > > Vect_read_line () and Vect_read_next_line behave in the same way -
> > > they may return 'line number', -1 or -2. So I do not know why
> > > variable 'ltype' is tested only (switch (ltype)) in level 1.
> > >
> > > Best regards, Martin
> > >
> > > PS: Temporarily I have no GNU/Linux PC with Internet connection, so
> > > this patch is against CVS snapshot from 2006/05/27.
> >
> >
> > > _______________________________________________
> > > grass-dev mailing list
> > > grass-dev at grass.itc.it
> > > http://grass.itc.it/mailman/listinfo/grass-dev
> >
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: d_vect_random_cols-2006-06-01.diff.gz
Type: application/x-gzip
Size: 2348 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060601/c95db367/d_vect_random_cols-2006-06-01.diff.gz


More information about the grass-dev mailing list