[GRASS5] d.vect -a|c for all types ver2

Hi all,

I have rewritten the patch for d.vect which enables to use flags -a
and -c for all vector types (not only for areas). I hope I did it
better this time (for previous patch see
http://grass.itc.it/pipermail/grass5/2005-September/019563.html).

best regards, Martin

(attachments)

d_vect_rgb_column-2005-10-06.diff.gz (4.83 KB)
area.c.diff.gz (227 Bytes)
d_vect-rgb.png

Hi Markus,

2005/10/18, Markus Neteler <neteler@itc.it>:

I tried, works well for areas and lines. But should it do also for points?

I can submit as is and then (if time permits) you may get it
working for points as well?

you are right, there is a bug, I have tested it only with
icon=basic/box and it worked.
I hope it is better now. Please, see png's at

http://k153-85.fsv.cvut.cz/~martin/.../d.vect-ac/

Any comments?

Best regards,

Martin

(attachments)

d_vect_rgb_column-2005-10-18.diff.gz (4.96 KB)

On 10/6/05, Martin Landa <landa.martin@gmail.com> wrote:

Hi all,

I have rewritten the patch for d.vect which enables to use flags -a
and -c for all vector types (not only for areas). I hope I did it
better this time (for previous patch see
http://grass.itc.it/pipermail/grass5/2005-September/019563.html).

best regards, Martin

The area.c.diff seems to be correct but also the last return should be -1.

Radim

Hi all,

playing with v.patch and 3d vector maps I found a new bug in my
patches for d.vect:-(
When I try to display 3d vector map layer (trees created by trees.pl
script, see http://www.fle.czu.cz/~jachym/programs/trees.html) I get
error message "Attempt to read topo for dead isle" from function
Vect_get_area_isle(). There is temporary solution:

area.c:
- if (Vect_get_isle_area (Map, area)) { /* isle ? */
---
+ if (!Vect_is_3d (Map) && Vect_get_isle_area (Map, area)) { /* isle ? */

I know it is not nice ... but it works for now.

Martin

2005/10/18, Martin Landa <landa.martin@gmail.com>:

Hi Markus,

2005/10/18, Markus Neteler <neteler@itc.it>:

> I tried, works well for areas and lines. But should it do also for points?
>
> I can submit as is and then (if time permits) you may get it
> working for points as well?
>

you are right, there is a bug, I have tested it only with
icon=basic/box and it worked.
I hope it is better now. Please, see png's at

http://k153-85.fsv.cvut.cz/~martin/.../d.vect-ac/

Any comments?

Best regards,

Martin

(attachments)

d_vect_rgb_column-2005-10-20.diff.gz (4.98 KB)

Radim Blazek wrote:

On 10/6/05, Martin Landa <landa.martin@gmail.com> wrote:

Hi all,

I have rewritten the patch for d.vect which enables to use flags -a
and -c for all vector types (not only for areas). I hope I did it
better this time (for previous patch see
http://grass.itc.it/pipermail/grass5/2005-September/019563.html).

best regards, Martin
   
The area.c.diff seems to be correct but also the last return should be -1.

Fixed in 6.0-CVS and 6.1-CVS.

Markus

On 10/20/05, Martin Landa <landa.martin@gmail.com> wrote:

area.c:
- if (Vect_get_isle_area (Map, area)) { /* isle ? */
---
+ if (!Vect_is_3d (Map) && Vect_get_isle_area (Map, area)) { /* isle ? */

Vect_get_isle_area returns area number for given isle, so it
is wrong to give area as parameter.

Radim

Hi,

I have tried to solve this problem - I am really not sure, maybe I
don't understand correctly areas and isles...

There is a new patch for d.vect... I hope without any huge bugs;-)
Please test it ... I am ready for your comments.

Best regards,

Martin

2005/10/20, Markus Neteler <neteler@itc.it>:

On Tue, Oct 18, 2005 at 07:12:38PM +0200, Markus Neteler wrote:
> On Thu, Oct 06, 2005 at 09:18:33AM +0000, Martin Landa wrote:
> > Hi all,
> >
> > I have rewritten the patch for d.vect which enables to use flags -a
> > and -c for all vector types (not only for areas). I hope I did it
> > better this time (for previous patch see
> > http://grass.itc.it/pipermail/grass5/2005-September/019563.html).

Hi Martin,

I tested the new d.vect code (the Vlib/area.c fix is in CVS),
but there is a bug in d.vect/area.c:

d.vect delauney
ERROR: Attempt to read topo for dead isle (2)

The problem is the line:

  if (Vect_get_isle_area(Map, area))

Since this function ends with a fatal error for non-island
areas, it must be used in a different way.
However, for details better ask Radim...

I am sure that you'll iron out this missing piece!

Markus

(attachments)

d_vect_rgb_column-2005-10-23.diff.gz (5.39 KB)
area.diff (2.34 KB)
test.png

2005/10/20, Markus Neteler <neteler@itc.it>:
> On Tue, Oct 18, 2005 at 07:12:38PM +0200, Markus Neteler wrote:
> > On Thu, Oct 06, 2005 at 09:18:33AM +0000, Martin Landa wrote:
> > > Hi all,
> > >
> > > I have rewritten the patch for d.vect which enables to use flags
> > > -a and -c for all vector types (not only for areas). I hope I
> > > did it better this time (for previous patch see
> > > http://grass.itc.it/pipermail/grass5/2005-September/019563.html).
>
> Hi Martin,
>
> I tested the new d.vect code (the Vlib/area.c fix is in CVS),
> but there is a bug in d.vect/area.c:
>
> d.vect delauney
> ERROR: Attempt to read topo for dead isle (2)
>
> The problem is the line:
>
> if (Vect_get_isle_area(Map, area))
>
> Since this function ends with a fatal error for non-island
> areas, it must be used in a different way.
> However, for details better ask Radim...
>
> I am sure that you'll iron out this missing piece!
>
> Markus

..

I have tried to solve this problem - I am really not sure, maybe I
don't understand correctly areas and isles...

There is a new patch for d.vect... I hope without any huge bugs;-)
Please test it ... I am ready for your comments.

Best regards,

Martin

Is this patch ready to be committed to CVS?

What is the place of "area.diff"? It does not apply cleanly.

Hamish

(attachments)

d_vect_rgb_column-2005-10-23.diff (22.2 KB)
area.diff (2.34 KB)

Hi,

2005/12/11, Hamish <hamish_nospam@yahoo.com>:

Is this patch ready to be committed to CVS?

I don't know, one month ago I sent to Markus the new version of patch
for d.vect, see the attached file. It can be used against the current
CVS. Hope it works correctly.

Best regards,

Martin

(attachments)

d_vect_rgb_column-2005-11-07.diff.gz (5.82 KB)

Hi Markus,

I think it should be more tested, the last think what I want is to make
d.vect buggy (or more buggy;-). In the attachment you can find the
last version of the patch
(slightly modified version from 2005-11). So if you can, please test it.

for grassdev list: This patch allows to display colored lines and
points based on GRASSRGB column (not only areas).

Best regards, Martin

PS: Has anyone tested the similar patch for ps.map, see

http://grass.fsv.cvut.cz/~martin/grass/patches/ps_map-grassrgb-2005-10-02.diff.gz

2006/1/12, Markus Neteler <neteler@itc.it>:

Hi Martin,

I lost track on this somehow, sorry. What do you think,
should I submit what I have from you to CVS?
Then you compare and, if needed, send final updates?

Markus

On Mon, Nov 07, 2005 at 09:56:11AM +0100, Martin Landa wrote:
> Hi Markus,
>
> 2005/10/28, Markus Neteler <neteler@itc.it>:
>
> > Testing the patch I got the idea that it may be useful/important
> > to exclude the color equal to the monitor background color to
> > avoid, that objects become invisible. This may be a simple if
> > statement using a function which fetches the current background
> > color.
> >
>
> I am not sure if I understood well. Did you mean this??
>
> $ d.vect mapa col=white fcol=white
> WARNING: Line color and background color are the same!
> WARNING: Area fill color and background color are the same!
>
> or
>
> cat | grassrgb | vel
> -----+-------------+-----
> 2 | 255:255:255 | 15
>
> $ d.vect mapa -a
> WARNING: Category <2>: Area fill color and background color are the same!
> WARNING: Category <2>: Line color and background color are the same!
>
> > While all types of vector are well displayed with color now
> > (no more error!), there is a small bug remaining:
> >
> > #spearfish
> > d.vect fields disp=attr attrcol=label
> >
> > should only display the labels (and also centroids?) but not
> > the areas. Hopefully also easy to fix...
>
> Yes, I am wondering if it is possible to determine correctly all isles by:
>
> /* initialize isles - needed? */
> isles = Vect_new_list ();
> for ( area = 1; area <= num; area++ ) {
> n_isles = Vect_get_area_num_isles ( Map, area );
> for ( i = 0; i < n_isles; i++) {
> isle = Vect_get_area_isle ( Map, area, i );
> if (isle > 0) {
> Vect_list_append (isles, isle);
> }
> }
> }
>
> when I try to build topology of map 'fields' I see in report 11
> isles!! I don't know why so many isles...
>
> Number of areas : 65
> Number of isles : 11
> Number of areas without centroid : 2
>
> Attached patch for d.vect behaves in "old way":
>
> * area without centroid is not displayed (as "isle").
>
> I am not sure how to solve it better ... but hope it works now...
>
> Best regards,
>
> Martin
>
> > On Thu, Oct 27, 2005 at 06:36:06PM +0200, Martin Landa wrote:
> > > Hi Markus,
> > >
> > > there is the last patch for d.vect (against the current CVS). Sorry
> > > for this complication.
> > >
> > > Best regards, Martin
> > >
> > > 2005/10/27, Markus Neteler <neteler@itc.it>:
> > > > Hi Martin,
> > > >
> > > > I have already deleted all patch files to reduce (my) confusion.
> > > > Can you send the changes again to me? For me it's best to only
> > > > have it against current CVS.
> > > >
> > > > Thanks
> > > >
> > > > Markus
> > > >
> > > >
> > > > Martin Landa wrote:
> > > >
> > > > >Hi Markus,
> > > > >
> > > > >it is my fault, a little bit confusing I think, sorry for that:
> > > > >
> > > > >d_vect_rgb_column-2005-10-23.diff.gz is against the current CVS,
> > > > >please use this patch.
> > > > >
> > > > >area.diff is against d_vect_rgb_column-2005-10-18.diff
> > > > >
> > > > >Martin
> > > > >
> > > > >2005/10/26, Markus Neteler <neteler@itc.it>:
> > > > >
> > > > >
> > > > >>Martin,
> > > > >>
> > > > >>the patch doesn't work, apparently it's not against the
> > > > >>current CVS?
> > > > >>
> > > > >>patch -p0 < ~/area.diff
> > > > >>patching file d.vect/area.c
> > > > >>Hunk #1 succeeded at 44 with fuzz 2 (offset 24 lines).
> > > > >>Hunk #2 succeeded at 54 (offset -19 lines).
> > > > >>Hunk #3 succeeded at 173 with fuzz 2 (offset 24 lines).
> > > > >>Hunk #4 FAILED at 233.
> > > > >>Hunk #5 succeeded at 205 with fuzz 1 (offset -42 lines).
> > > > >>1 out of 5 hunks FAILED -- saving rejects to file d.vect/area.c.rej
> > > > >>
> > > > >>Can you please recreate it against CVS?
> > > > >>
> > > > >>Thanks
> > > > >>
> > > > >> Markus
> > > > >>
> > > > >>On Mon, Oct 24, 2005 at 12:27:12AM +0200, Martin Landa wrote:
> > > > >>
> > > > >>
> > > > >>>Hi,
> > > > >>>
> > > > >>>I have tried to solve this problem - I am really not sure, maybe I
> > > > >>>don't understand correctly areas and isles...
> > > > >>>
> > > > >>>There is a new patch for d.vect... I hope without any huge bugs;-)
> > > > >>>Please test it ... I am ready for your comments.
> > > > >>>
> > > > >>>Best regards,
> > > > >>>
> > > > >>>Martin
> > > > >>>
> > > > >>>2005/10/20, Markus Neteler <neteler@itc.it>:
> > > > >>>
> > > > >>>
> > > > >>>>On Tue, Oct 18, 2005 at 07:12:38PM +0200, Markus Neteler wrote:
> > > > >>>>
> > > > >>>>
> > > > >>>>>On Thu, Oct 06, 2005 at 09:18:33AM +0000, Martin Landa wrote:
> > > > >>>>>
> > > > >>>>>
> > > > >>>>>>Hi all,
> > > > >>>>>>
> > > > >>>>>>I have rewritten the patch for d.vect which enables to use flags -a
> > > > >>>>>>and -c for all vector types (not only for areas). I hope I did it
> > > > >>>>>>better this time (for previous patch see
> > > > >>>>>>http://grass.itc.it/pipermail/grass5/2005-September/019563.html).
> > > > >>>>>>
> > > > >>>>>>
> > > > >>>>Hi Martin,
> > > > >>>>
> > > > >>>>I tested the new d.vect code (the Vlib/area.c fix is in CVS),
> > > > >>>>but there is a bug in d.vect/area.c:
> > > > >>>>
> > > > >>>>d.vect delauney
> > > > >>>>ERROR: Attempt to read topo for dead isle (2)
> > > > >>>>
> > > > >>>>The problem is the line:
> > > > >>>>
> > > > >>>> if (Vect_get_isle_area(Map, area))
> > > > >>>>
> > > > >>>>Since this function ends with a fatal error for non-island
> > > > >>>>areas, it must be used in a different way.
> > > > >>>>However, for details better ask Radim...
> > > > >>>>
> > > > >>>>I am sure that you'll iron out this missing piece!
> > > > >>>>
> > > > >>>>Markus
> > > > >>>>
> > > > >>>>
> > > > >>>>
> > > > >>>>
> > > > >>
> > > > >>
> > > > >>>--- d.vect.18/area.c 2005-10-24 00:03:10.000000000 +0200
> > > > >>>+++ d.vect/area.c 2005-10-24 00:18:39.000000000 +0200
> > > > >>>@@ -20,8 +20,9 @@
> > > > >>> struct line_cats *Cats;
> > > > >>> int cat, centroid = 0;
> > > > >>> int red, grn, blu;
> > > > >>>+ struct ilist *isles = NULL;
> > > > >>>
> > > > >>>- struct field_info *fi=NULL;
> > > > >>>+ struct field_info *fi = NULL;
> > > > >>> dbDriver *driver = NULL;
> > > > >>> dbCatValArray cvarr;
> > > > >>> dbCatVal *cv_rgb = NULL;
> > > > >>>@@ -72,14 +73,26 @@
> > > > >>>
> > > > >>> num = Vect_get_num_areas(Map);
> > > > >>> G_debug (2, "n_areas = %d", num);
> > > > >>>-
> > > > >>>+
> > > > >>>+ /* initialize isles - needed? */
> > > > >>>+ isles = Vect_new_list ();
> > > > >>>+ for ( area = 1; area <= num; area++ ) {
> > > > >>>+ n_isles = Vect_get_area_num_isles ( Map, area );
> > > > >>>+ for ( i = 0; i < n_isles; i++) {
> > > > >>>+ isle = Vect_get_area_isle ( Map, area, i );
> > > > >>>+ if (isle > 0) {
> > > > >>>+ Vect_list_append (isles, isle);
> > > > >>>+ }
> > > > >>>+ }
> > > > >>>+ }
> > > > >>>+
> > > > >>> for ( area = 1; area <= num; area++ ) {
> > > > >>> int i;
> > > > >>> BOUND_BOX box;
> > > > >>> G_debug (3, "area = %d", area);
> > > > >>>
> > > > >>>- if ( !Vect_area_alive (Map, area) ) continue;
> > > > >>>-
> > > > >>>+ if ( !Vect_area_alive (Map, area) || Vect_val_in_list(isles, area)) continue;
> > > > >>>+
> > > > >>> /* Check box */
> > > > >>> Vect_get_area_box (Map, area, &box);
> > > > >>> if ( box.N < window->south || box.S > window->north ||
> > > > >>>@@ -136,7 +149,7 @@
> > > > >>> Vect_append_points ( Points, IPoints, GV_FORWARD);
> > > > >>> Vect_append_point ( Points, xl, yl, 0.0 ); /* ??? */
> > > > >>> }
> > > > >>>-
> > > > >>>+
> > > > >>> if( table_colors_flag ) {
> > > > >>> cat=Vect_get_area_cat ( Map, area , Clist -> field );
> > > > >>> centroid = Vect_get_area_centroid ( Map, area );
> > > > >>>@@ -196,20 +209,15 @@
> > > > >>> }
> > > > >>>
> > > > >>> if ( fcolor > -1 ) {
> > > > >>>- if (Vect_get_isle_area (Map, area)) { /* isle ? */
> > > > >>>- R_RGB_color (255, 255, 255);
> > > > >>>- }
> > > > >>>+ if (!table_colors_flag && !cats_color_flag) {
> > > > >>>+ R_color(fcolor) ;
> > > > >>>+ }
> > > > >>> else {
> > > > >>>- if (!table_colors_flag && !cats_color_flag) {
> > > > >>>- R_color(fcolor) ;
> > > > >>>+ if (rgb) {
> > > > >>>+ R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > >>> }
> > > > >>> else {
> > > > >>>- if (rgb) {
> > > > >>>- R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > >>>- }
> > > > >>>- else {
> > > > >>> R_color (fcolor);
> > > > >>>- }
> > > > >>> }
> > > > >>> }
> > > > >>> G_plot_polygon ( Points->x, Points->y, Points->n_points);
> > > > >>>@@ -239,8 +247,10 @@
> > > > >>> } /* end for */
> > > > >>>
> > > > >>> Vect_destroy_line_struct (Points);
> > > > >>>+ Vect_destroy_line_struct (IPoints);
> > > > >>> Vect_destroy_cats_struct (Cats);
> > > > >>>-
> > > > >>>+ Vect_destroy_list (isles);
> > > > >>>+
> > > > >>> return 0;
> > > > >>> }
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>
> > > > >>--
> > > > >>Markus Neteler <neteler itc it> http://mpa.itc.it
> > > > >>ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
> > > > >>MPBA - Predictive Models for Biol. & Environ. Data Analysis
> > > > >>Via Sommarive, 18 - 38050 Povo (Trento), Italy
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> >
> >
> >
> > --
> > Markus Neteler <neteler itc it> http://mpa.itc.it
> > ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
> > MPBA - Predictive Models for Biol. & Environ. Data Analysis
> > Via Sommarive, 18 - 38050 Povo (Trento), Italy
> >

--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy

(attachments)

d_vect_rgb_column-2006-01-14.diff.gz (5.54 KB)

Hi Markus,

I have modified this path to make it compile with mentioned compiler
options, see the attached file.

BTW, which compile options I should use:

Now I am using:

CFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common
-D_BSD_SOURCE=1 -D_SVID_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_
SOURCE=199506L"

Best regards, Martin

2006/1/15, Markus Neteler <neteler@itc.it>:

Hi Martin,

to make it compile with my more restrictive compiler options,
I have to add to local_proto.h:

#include "symbol.h"
and
int test_bg_color (const char*);

and to include local_proto.h in area.c and plot1.c. Please
add this to your version.

I compile with
export CFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common"
./configure ...

to find such things (which are needed for portability).

So far I couldn't test yet, hopefully others will do.

Markus

On Sun, Jan 15, 2006 at 02:21:59PM +0100, Martin Landa wrote:
> Hi Markus,
>
> I think it should be more tested, the last think what I want is to make
> d.vect buggy (or more buggy;-). In the attachment you can find the
> last version of the patch
> (slightly modified version from 2005-11). So if you can, please test it.
>
> for grassdev list: This patch allows to display colored lines and
> points based on GRASSRGB column (not only areas).
>
> Best regards, Martin
>
> PS: Has anyone tested the similar patch for ps.map, see
>
> http://grass.fsv.cvut.cz/~martin/grass/patches/ps_map-grassrgb-2005-10-02.diff.gz
>
> 2006/1/12, Markus Neteler <neteler@itc.it>:
> > Hi Martin,
> >
> > I lost track on this somehow, sorry. What do you think,
> > should I submit what I have from you to CVS?
> > Then you compare and, if needed, send final updates?
> >
> > Markus
> >
> > On Mon, Nov 07, 2005 at 09:56:11AM +0100, Martin Landa wrote:
> > > Hi Markus,
> > >
> > > 2005/10/28, Markus Neteler <neteler@itc.it>:
> > >
> > > > Testing the patch I got the idea that it may be useful/important
> > > > to exclude the color equal to the monitor background color to
> > > > avoid, that objects become invisible. This may be a simple if
> > > > statement using a function which fetches the current background
> > > > color.
> > > >
> > >
> > > I am not sure if I understood well. Did you mean this??
> > >
> > > $ d.vect mapa col=white fcol=white
> > > WARNING: Line color and background color are the same!
> > > WARNING: Area fill color and background color are the same!
> > >
> > > or
> > >
> > > cat | grassrgb | vel
> > > -----+-------------+-----
> > > 2 | 255:255:255 | 15
> > >
> > > $ d.vect mapa -a
> > > WARNING: Category <2>: Area fill color and background color are the same!
> > > WARNING: Category <2>: Line color and background color are the same!
> > >
> > > > While all types of vector are well displayed with color now
> > > > (no more error!), there is a small bug remaining:
> > > >
> > > > #spearfish
> > > > d.vect fields disp=attr attrcol=label
> > > >
> > > > should only display the labels (and also centroids?) but not
> > > > the areas. Hopefully also easy to fix...
> > >
> > > Yes, I am wondering if it is possible to determine correctly all isles by:
> > >
> > > /* initialize isles - needed? */
> > > isles = Vect_new_list ();
> > > for ( area = 1; area <= num; area++ ) {
> > > n_isles = Vect_get_area_num_isles ( Map, area );
> > > for ( i = 0; i < n_isles; i++) {
> > > isle = Vect_get_area_isle ( Map, area, i );
> > > if (isle > 0) {
> > > Vect_list_append (isles, isle);
> > > }
> > > }
> > > }
> > >
> > > when I try to build topology of map 'fields' I see in report 11
> > > isles!! I don't know why so many isles...
> > >
> > > Number of areas : 65
> > > Number of isles : 11
> > > Number of areas without centroid : 2
> > >
> > > Attached patch for d.vect behaves in "old way":
> > >
> > > * area without centroid is not displayed (as "isle").
> > >
> > > I am not sure how to solve it better ... but hope it works now...
> > >
> > > Best regards,
> > >
> > > Martin
> > >
> > > > On Thu, Oct 27, 2005 at 06:36:06PM +0200, Martin Landa wrote:
> > > > > Hi Markus,
> > > > >
> > > > > there is the last patch for d.vect (against the current CVS). Sorry
> > > > > for this complication.
> > > > >
> > > > > Best regards, Martin
> > > > >
> > > > > 2005/10/27, Markus Neteler <neteler@itc.it>:
> > > > > > Hi Martin,
> > > > > >
> > > > > > I have already deleted all patch files to reduce (my) confusion.
> > > > > > Can you send the changes again to me? For me it's best to only
> > > > > > have it against current CVS.
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Markus
> > > > > >
> > > > > >
> > > > > > Martin Landa wrote:
> > > > > >
> > > > > > >Hi Markus,
> > > > > > >
> > > > > > >it is my fault, a little bit confusing I think, sorry for that:
> > > > > > >
> > > > > > >d_vect_rgb_column-2005-10-23.diff.gz is against the current CVS,
> > > > > > >please use this patch.
> > > > > > >
> > > > > > >area.diff is against d_vect_rgb_column-2005-10-18.diff
> > > > > > >
> > > > > > >Martin
> > > > > > >
> > > > > > >2005/10/26, Markus Neteler <neteler@itc.it>:
> > > > > > >
> > > > > > >
> > > > > > >>Martin,
> > > > > > >>
> > > > > > >>the patch doesn't work, apparently it's not against the
> > > > > > >>current CVS?
> > > > > > >>
> > > > > > >>patch -p0 < ~/area.diff
> > > > > > >>patching file d.vect/area.c
> > > > > > >>Hunk #1 succeeded at 44 with fuzz 2 (offset 24 lines).
> > > > > > >>Hunk #2 succeeded at 54 (offset -19 lines).
> > > > > > >>Hunk #3 succeeded at 173 with fuzz 2 (offset 24 lines).
> > > > > > >>Hunk #4 FAILED at 233.
> > > > > > >>Hunk #5 succeeded at 205 with fuzz 1 (offset -42 lines).
> > > > > > >>1 out of 5 hunks FAILED -- saving rejects to file d.vect/area.c.rej
> > > > > > >>
> > > > > > >>Can you please recreate it against CVS?
> > > > > > >>
> > > > > > >>Thanks
> > > > > > >>
> > > > > > >> Markus
> > > > > > >>
> > > > > > >>On Mon, Oct 24, 2005 at 12:27:12AM +0200, Martin Landa wrote:
> > > > > > >>
> > > > > > >>
> > > > > > >>>Hi,
> > > > > > >>>
> > > > > > >>>I have tried to solve this problem - I am really not sure, maybe I
> > > > > > >>>don't understand correctly areas and isles...
> > > > > > >>>
> > > > > > >>>There is a new patch for d.vect... I hope without any huge bugs;-)
> > > > > > >>>Please test it ... I am ready for your comments.
> > > > > > >>>
> > > > > > >>>Best regards,
> > > > > > >>>
> > > > > > >>>Martin
> > > > > > >>>
> > > > > > >>>2005/10/20, Markus Neteler <neteler@itc.it>:
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>>On Tue, Oct 18, 2005 at 07:12:38PM +0200, Markus Neteler wrote:
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>>>On Thu, Oct 06, 2005 at 09:18:33AM +0000, Martin Landa wrote:
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>>>>Hi all,
> > > > > > >>>>>>
> > > > > > >>>>>>I have rewritten the patch for d.vect which enables to use flags -a
> > > > > > >>>>>>and -c for all vector types (not only for areas). I hope I did it
> > > > > > >>>>>>better this time (for previous patch see
> > > > > > >>>>>>http://grass.itc.it/pipermail/grass5/2005-September/019563.html).
> > > > > > >>>>>>
> > > > > > >>>>>>
> > > > > > >>>>Hi Martin,
> > > > > > >>>>
> > > > > > >>>>I tested the new d.vect code (the Vlib/area.c fix is in CVS),
> > > > > > >>>>but there is a bug in d.vect/area.c:
> > > > > > >>>>
> > > > > > >>>>d.vect delauney
> > > > > > >>>>ERROR: Attempt to read topo for dead isle (2)
> > > > > > >>>>
> > > > > > >>>>The problem is the line:
> > > > > > >>>>
> > > > > > >>>> if (Vect_get_isle_area(Map, area))
> > > > > > >>>>
> > > > > > >>>>Since this function ends with a fatal error for non-island
> > > > > > >>>>areas, it must be used in a different way.
> > > > > > >>>>However, for details better ask Radim...
> > > > > > >>>>
> > > > > > >>>>I am sure that you'll iron out this missing piece!
> > > > > > >>>>
> > > > > > >>>>Markus
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>
> > > > > > >>
> > > > > > >>>--- d.vect.18/area.c 2005-10-24 00:03:10.000000000 +0200
> > > > > > >>>+++ d.vect/area.c 2005-10-24 00:18:39.000000000 +0200
> > > > > > >>>@@ -20,8 +20,9 @@
> > > > > > >>> struct line_cats *Cats;
> > > > > > >>> int cat, centroid = 0;
> > > > > > >>> int red, grn, blu;
> > > > > > >>>+ struct ilist *isles = NULL;
> > > > > > >>>
> > > > > > >>>- struct field_info *fi=NULL;
> > > > > > >>>+ struct field_info *fi = NULL;
> > > > > > >>> dbDriver *driver = NULL;
> > > > > > >>> dbCatValArray cvarr;
> > > > > > >>> dbCatVal *cv_rgb = NULL;
> > > > > > >>>@@ -72,14 +73,26 @@
> > > > > > >>>
> > > > > > >>> num = Vect_get_num_areas(Map);
> > > > > > >>> G_debug (2, "n_areas = %d", num);
> > > > > > >>>-
> > > > > > >>>+
> > > > > > >>>+ /* initialize isles - needed? */
> > > > > > >>>+ isles = Vect_new_list ();
> > > > > > >>>+ for ( area = 1; area <= num; area++ ) {
> > > > > > >>>+ n_isles = Vect_get_area_num_isles ( Map, area );
> > > > > > >>>+ for ( i = 0; i < n_isles; i++) {
> > > > > > >>>+ isle = Vect_get_area_isle ( Map, area, i );
> > > > > > >>>+ if (isle > 0) {
> > > > > > >>>+ Vect_list_append (isles, isle);
> > > > > > >>>+ }
> > > > > > >>>+ }
> > > > > > >>>+ }
> > > > > > >>>+
> > > > > > >>> for ( area = 1; area <= num; area++ ) {
> > > > > > >>> int i;
> > > > > > >>> BOUND_BOX box;
> > > > > > >>> G_debug (3, "area = %d", area);
> > > > > > >>>
> > > > > > >>>- if ( !Vect_area_alive (Map, area) ) continue;
> > > > > > >>>-
> > > > > > >>>+ if ( !Vect_area_alive (Map, area) || Vect_val_in_list(isles, area)) continue;
> > > > > > >>>+
> > > > > > >>> /* Check box */
> > > > > > >>> Vect_get_area_box (Map, area, &box);
> > > > > > >>> if ( box.N < window->south || box.S > window->north ||
> > > > > > >>>@@ -136,7 +149,7 @@
> > > > > > >>> Vect_append_points ( Points, IPoints, GV_FORWARD);
> > > > > > >>> Vect_append_point ( Points, xl, yl, 0.0 ); /* ??? */
> > > > > > >>> }
> > > > > > >>>-
> > > > > > >>>+
> > > > > > >>> if( table_colors_flag ) {
> > > > > > >>> cat=Vect_get_area_cat ( Map, area , Clist -> field );
> > > > > > >>> centroid = Vect_get_area_centroid ( Map, area );
> > > > > > >>>@@ -196,20 +209,15 @@
> > > > > > >>> }
> > > > > > >>>
> > > > > > >>> if ( fcolor > -1 ) {
> > > > > > >>>- if (Vect_get_isle_area (Map, area)) { /* isle ? */
> > > > > > >>>- R_RGB_color (255, 255, 255);
> > > > > > >>>- }
> > > > > > >>>+ if (!table_colors_flag && !cats_color_flag) {
> > > > > > >>>+ R_color(fcolor) ;
> > > > > > >>>+ }
> > > > > > >>> else {
> > > > > > >>>- if (!table_colors_flag && !cats_color_flag) {
> > > > > > >>>- R_color(fcolor) ;
> > > > > > >>>+ if (rgb) {
> > > > > > >>>+ R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > > > >>> }
> > > > > > >>> else {
> > > > > > >>>- if (rgb) {
> > > > > > >>>- R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > > > >>>- }
> > > > > > >>>- else {
> > > > > > >>> R_color (fcolor);
> > > > > > >>>- }
> > > > > > >>> }
> > > > > > >>> }
> > > > > > >>> G_plot_polygon ( Points->x, Points->y, Points->n_points);
> > > > > > >>>@@ -239,8 +247,10 @@
> > > > > > >>> } /* end for */
> > > > > > >>>
> > > > > > >>> Vect_destroy_line_struct (Points);
> > > > > > >>>+ Vect_destroy_line_struct (IPoints);
> > > > > > >>> Vect_destroy_cats_struct (Cats);
> > > > > > >>>-
> > > > > > >>>+ Vect_destroy_list (isles);
> > > > > > >>>+
> > > > > > >>> return 0;
> > > > > > >>> }
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>
> > > > > > >>--
> > > > > > >>Markus Neteler <neteler itc it> http://mpa.itc.it
> > > > > > >>ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
> > > > > > >>MPBA - Predictive Models for Biol. & Environ. Data Analysis
> > > > > > >>Via Sommarive, 18 - 38050 Povo (Trento), Italy
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Markus Neteler <neteler itc it> http://mpa.itc.it
> > > > ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
> > > > MPBA - Predictive Models for Biol. & Environ. Data Analysis
> > > > Via Sommarive, 18 - 38050 Povo (Trento), Italy
> > > >
> >
> >
> >
> > --
> > Markus Neteler <neteler itc it> http://mpa.itc.it
> > ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
> > MPBA - Predictive Models for Biol. & Environ. Data Analysis
> > Via Sommarive, 18 - 38050 Povo (Trento), Italy
> >

--
Markus Neteler <neteler itc it> http://mpa.itc.it
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy

(attachments)

d_vect_rgb_column-2006-01-15.diff.gz (5.7 KB)

Hi, just some thoughts re 'd.vect -a' for all feature types-

after this patch is merged I would like to add a d.vect rgb_column=
option to set the column name to something other than GRASSRGB (although
that will be the default).

I collect a number of channels of data along my gps tracks (water
temperature, chemistry, life, clarity, etc) and for each variable
calculate a max/min and then fit a color scale which is written as a db
column during post-processing, before the whole thing is loaded into
GRASS with v.in.ascii. Currently I need to create one GRASS vector file
per variable due to only being able to access a single "GRASSRGB" column
for coloring.

Taking this further, and acknowledging that d.vect is already
overwhelmingly complicated, perhaps a color_rules= option could be
added to access one of the standard GRASS raster color maps (in
$GISBASE/etc/colors/), fit to data, and then use on-the-fly?
e.g. use with LIDAR data where DB holding GRASSRGB column can't
exist and just too huge for d.vect.thematic (if it worked without a data
column).

Even further- allow access to any colr/ file created with r.colors.
But mixing raster/vector functions like this isn't very clean and is to
be avoided...

re. d.vect being way too complicated to quickly use or learn:
An idea would be to keep d.vect powerful but split up the functionalily
in the GUI into "display points" and "display areas" etc. as the "Add
vector layer" panel is already too much for a new user. split up into
features,colors,labels,query sections which can be collapsible? dunno.

I already use scripts for displaying points and areas (d.stations and
d.varea on the wiki add-ons page) as d.vect has too many options to
quickly type. And I see the existance of useful work around scripts to
be a sign there is a problem that should be fixed at the core.

regards,
Hamish

On pon, 2006-01-16 at 17:18 +1300, Hamish wrote:

Hi, just some thoughts re 'd.vect -a' for all feature types-

after this patch is merged I would like to add a d.vect rgb_column=
option to set the column name to something other than GRASSRGB (although
that will be the default).

Sounds great to me.

<snip>

Taking this further, and acknowledging that d.vect is already
overwhelmingly complicated,

Might be puzzing for a newbie indeed.

perhaps a color_rules= option could be
added to access one of the standard GRASS raster color maps (in
$GISBASE/etc/colors/), fit to data, and then use on-the-fly?

In spite of acknowledging the over-complexity of d.vect, I admit that
such "color_rules=" would be an _excellent_, desired feature.

e.g. use with LIDAR data where DB holding GRASSRGB column can't
exist and just too huge for d.vect.thematic (if it worked without a data
column).

Yup.

Even further- allow access to any colr/ file created with r.colors.
But mixing raster/vector functions like this isn't very clean and is to
be avoided...

I don't feel that making d.vect and d.rast able to use a common color
rules definitions is something bad. From a user point of view it's all
about display only. Maybe an idea is to make the colr/ independent from
rasters, redo r.colors to support vectors also (alike d.vect.thematic?)
and rename to g.colors. Then g.copy, g.remove, g.mremove, g.rename would
need to be able to manipulate contents of /colr too.

How about an import module for arcview color definitions?
https://intevation.de/rt/webrt?serial_num=2789

re. d.vect being way too complicated to quickly use or learn:
An idea would be to keep d.vect powerful but split up the functionalily
in the GUI into "display points" and "display areas" etc. as the "Add
vector layer" panel is already too much for a new user. split up into
features,colors,labels,query sections which can be collapsible? dunno.

I double this idea. d.vect cannot be simpler it seems. Let's leave it to
GUI to make it more convenient in use.

Maciek

--------------------
Szukasz do¶wiadczonej firmy poligraficznej? Zale¿y Ci na terminowo¶ci i atrakcyjnych cenach?
Zapraszamy do nas!
http://www.foldruk.pl/

Hi Martin,

the patch is now in CVS for easier testing.
Thanks for it!

Markus

On Sun, Jan 15, 2006 at 09:53:16PM +0100, Martin Landa wrote:

Hi Markus,

I have modified this path to make it compile with mentioned compiler
options, see the attached file.

BTW, which compile options I should use:

Now I am using:

CFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common
-D_BSD_SOURCE=1 -D_SVID_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_
SOURCE=199506L"

Best regards, Martin

2006/1/15, Markus Neteler <neteler@itc.it>:
> Hi Martin,
>
> to make it compile with my more restrictive compiler options,
> I have to add to local_proto.h:
>
> #include "symbol.h"
> and
> int test_bg_color (const char*);
>
>
> and to include local_proto.h in area.c and plot1.c. Please
> add this to your version.
>
> I compile with
> export CFLAGS="-g -Wall -Werror-implicit-function-declaration -fno-common"
> ./configure ...
>
> to find such things (which are needed for portability).
>
> So far I couldn't test yet, hopefully others will do.
>
> Markus
>
> On Sun, Jan 15, 2006 at 02:21:59PM +0100, Martin Landa wrote:
> > Hi Markus,
> >
> > I think it should be more tested, the last think what I want is to make
> > d.vect buggy (or more buggy;-). In the attachment you can find the
> > last version of the patch
> > (slightly modified version from 2005-11). So if you can, please test it.
> >
> > for grassdev list: This patch allows to display colored lines and
> > points based on GRASSRGB column (not only areas).
> >
> > Best regards, Martin
> >
> > PS: Has anyone tested the similar patch for ps.map, see
> >
> > http://grass.fsv.cvut.cz/~martin/grass/patches/ps_map-grassrgb-2005-10-02.diff.gz
> >
> > 2006/1/12, Markus Neteler <neteler@itc.it>:
> > > Hi Martin,
> > >
> > > I lost track on this somehow, sorry. What do you think,
> > > should I submit what I have from you to CVS?
> > > Then you compare and, if needed, send final updates?
> > >
> > > Markus
> > >
> > > On Mon, Nov 07, 2005 at 09:56:11AM +0100, Martin Landa wrote:
> > > > Hi Markus,
> > > >
> > > > 2005/10/28, Markus Neteler <neteler@itc.it>:
> > > >
> > > > > Testing the patch I got the idea that it may be useful/important
> > > > > to exclude the color equal to the monitor background color to
> > > > > avoid, that objects become invisible. This may be a simple if
> > > > > statement using a function which fetches the current background
> > > > > color.
> > > > >
> > > >
> > > > I am not sure if I understood well. Did you mean this??
> > > >
> > > > $ d.vect mapa col=white fcol=white
> > > > WARNING: Line color and background color are the same!
> > > > WARNING: Area fill color and background color are the same!
> > > >
> > > > or
> > > >
> > > > cat | grassrgb | vel
> > > > -----+-------------+-----
> > > > 2 | 255:255:255 | 15
> > > >
> > > > $ d.vect mapa -a
> > > > WARNING: Category <2>: Area fill color and background color are the same!
> > > > WARNING: Category <2>: Line color and background color are the same!
> > > >
> > > > > While all types of vector are well displayed with color now
> > > > > (no more error!), there is a small bug remaining:
> > > > >
> > > > > #spearfish
> > > > > d.vect fields disp=attr attrcol=label
> > > > >
> > > > > should only display the labels (and also centroids?) but not
> > > > > the areas. Hopefully also easy to fix...
> > > >
> > > > Yes, I am wondering if it is possible to determine correctly all isles by:
> > > >
> > > > /* initialize isles - needed? */
> > > > isles = Vect_new_list ();
> > > > for ( area = 1; area <= num; area++ ) {
> > > > n_isles = Vect_get_area_num_isles ( Map, area );
> > > > for ( i = 0; i < n_isles; i++) {
> > > > isle = Vect_get_area_isle ( Map, area, i );
> > > > if (isle > 0) {
> > > > Vect_list_append (isles, isle);
> > > > }
> > > > }
> > > > }
> > > >
> > > > when I try to build topology of map 'fields' I see in report 11
> > > > isles!! I don't know why so many isles...
> > > >
> > > > Number of areas : 65
> > > > Number of isles : 11
> > > > Number of areas without centroid : 2
> > > >
> > > > Attached patch for d.vect behaves in "old way":
> > > >
> > > > * area without centroid is not displayed (as "isle").
> > > >
> > > > I am not sure how to solve it better ... but hope it works now...
> > > >
> > > > Best regards,
> > > >
> > > > Martin
> > > >
> > > > > On Thu, Oct 27, 2005 at 06:36:06PM +0200, Martin Landa wrote:
> > > > > > Hi Markus,
> > > > > >
> > > > > > there is the last patch for d.vect (against the current CVS). Sorry
> > > > > > for this complication.
> > > > > >
> > > > > > Best regards, Martin
> > > > > >
> > > > > > 2005/10/27, Markus Neteler <neteler@itc.it>:
> > > > > > > Hi Martin,
> > > > > > >
> > > > > > > I have already deleted all patch files to reduce (my) confusion.
> > > > > > > Can you send the changes again to me? For me it's best to only
> > > > > > > have it against current CVS.
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Markus
> > > > > > >
> > > > > > >
> > > > > > > Martin Landa wrote:
> > > > > > >
> > > > > > > >Hi Markus,
> > > > > > > >
> > > > > > > >it is my fault, a little bit confusing I think, sorry for that:
> > > > > > > >
> > > > > > > >d_vect_rgb_column-2005-10-23.diff.gz is against the current CVS,
> > > > > > > >please use this patch.
> > > > > > > >
> > > > > > > >area.diff is against d_vect_rgb_column-2005-10-18.diff
> > > > > > > >
> > > > > > > >Martin
> > > > > > > >
> > > > > > > >2005/10/26, Markus Neteler <neteler@itc.it>:
> > > > > > > >
> > > > > > > >
> > > > > > > >>Martin,
> > > > > > > >>
> > > > > > > >>the patch doesn't work, apparently it's not against the
> > > > > > > >>current CVS?
> > > > > > > >>
> > > > > > > >>patch -p0 < ~/area.diff
> > > > > > > >>patching file d.vect/area.c
> > > > > > > >>Hunk #1 succeeded at 44 with fuzz 2 (offset 24 lines).
> > > > > > > >>Hunk #2 succeeded at 54 (offset -19 lines).
> > > > > > > >>Hunk #3 succeeded at 173 with fuzz 2 (offset 24 lines).
> > > > > > > >>Hunk #4 FAILED at 233.
> > > > > > > >>Hunk #5 succeeded at 205 with fuzz 1 (offset -42 lines).
> > > > > > > >>1 out of 5 hunks FAILED -- saving rejects to file d.vect/area.c.rej
> > > > > > > >>
> > > > > > > >>Can you please recreate it against CVS?
> > > > > > > >>
> > > > > > > >>Thanks
> > > > > > > >>
> > > > > > > >> Markus
> > > > > > > >>
> > > > > > > >>On Mon, Oct 24, 2005 at 12:27:12AM +0200, Martin Landa wrote:
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>>Hi,
> > > > > > > >>>
> > > > > > > >>>I have tried to solve this problem - I am really not sure, maybe I
> > > > > > > >>>don't understand correctly areas and isles...
> > > > > > > >>>
> > > > > > > >>>There is a new patch for d.vect... I hope without any huge bugs;-)
> > > > > > > >>>Please test it ... I am ready for your comments.
> > > > > > > >>>
> > > > > > > >>>Best regards,
> > > > > > > >>>
> > > > > > > >>>Martin
> > > > > > > >>>
> > > > > > > >>>2005/10/20, Markus Neteler <neteler@itc.it>:
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>>On Tue, Oct 18, 2005 at 07:12:38PM +0200, Markus Neteler wrote:
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>>>>On Thu, Oct 06, 2005 at 09:18:33AM +0000, Martin Landa wrote:
> > > > > > > >>>>>
> > > > > > > >>>>>
> > > > > > > >>>>>>Hi all,
> > > > > > > >>>>>>
> > > > > > > >>>>>>I have rewritten the patch for d.vect which enables to use flags -a
> > > > > > > >>>>>>and -c for all vector types (not only for areas). I hope I did it
> > > > > > > >>>>>>better this time (for previous patch see
> > > > > > > >>>>>>http://grass.itc.it/pipermail/grass5/2005-September/019563.html).
> > > > > > > >>>>>>
> > > > > > > >>>>>>
> > > > > > > >>>>Hi Martin,
> > > > > > > >>>>
> > > > > > > >>>>I tested the new d.vect code (the Vlib/area.c fix is in CVS),
> > > > > > > >>>>but there is a bug in d.vect/area.c:
> > > > > > > >>>>
> > > > > > > >>>>d.vect delauney
> > > > > > > >>>>ERROR: Attempt to read topo for dead isle (2)
> > > > > > > >>>>
> > > > > > > >>>>The problem is the line:
> > > > > > > >>>>
> > > > > > > >>>> if (Vect_get_isle_area(Map, area))
> > > > > > > >>>>
> > > > > > > >>>>Since this function ends with a fatal error for non-island
> > > > > > > >>>>areas, it must be used in a different way.
> > > > > > > >>>>However, for details better ask Radim...
> > > > > > > >>>>
> > > > > > > >>>>I am sure that you'll iron out this missing piece!
> > > > > > > >>>>
> > > > > > > >>>>Markus
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>>--- d.vect.18/area.c 2005-10-24 00:03:10.000000000 +0200
> > > > > > > >>>+++ d.vect/area.c 2005-10-24 00:18:39.000000000 +0200
> > > > > > > >>>@@ -20,8 +20,9 @@
> > > > > > > >>> struct line_cats *Cats;
> > > > > > > >>> int cat, centroid = 0;
> > > > > > > >>> int red, grn, blu;
> > > > > > > >>>+ struct ilist *isles = NULL;
> > > > > > > >>>
> > > > > > > >>>- struct field_info *fi=NULL;
> > > > > > > >>>+ struct field_info *fi = NULL;
> > > > > > > >>> dbDriver *driver = NULL;
> > > > > > > >>> dbCatValArray cvarr;
> > > > > > > >>> dbCatVal *cv_rgb = NULL;
> > > > > > > >>>@@ -72,14 +73,26 @@
> > > > > > > >>>
> > > > > > > >>> num = Vect_get_num_areas(Map);
> > > > > > > >>> G_debug (2, "n_areas = %d", num);
> > > > > > > >>>-
> > > > > > > >>>+
> > > > > > > >>>+ /* initialize isles - needed? */
> > > > > > > >>>+ isles = Vect_new_list ();
> > > > > > > >>>+ for ( area = 1; area <= num; area++ ) {
> > > > > > > >>>+ n_isles = Vect_get_area_num_isles ( Map, area );
> > > > > > > >>>+ for ( i = 0; i < n_isles; i++) {
> > > > > > > >>>+ isle = Vect_get_area_isle ( Map, area, i );
> > > > > > > >>>+ if (isle > 0) {
> > > > > > > >>>+ Vect_list_append (isles, isle);
> > > > > > > >>>+ }
> > > > > > > >>>+ }
> > > > > > > >>>+ }
> > > > > > > >>>+
> > > > > > > >>> for ( area = 1; area <= num; area++ ) {
> > > > > > > >>> int i;
> > > > > > > >>> BOUND_BOX box;
> > > > > > > >>> G_debug (3, "area = %d", area);
> > > > > > > >>>
> > > > > > > >>>- if ( !Vect_area_alive (Map, area) ) continue;
> > > > > > > >>>-
> > > > > > > >>>+ if ( !Vect_area_alive (Map, area) || Vect_val_in_list(isles, area)) continue;
> > > > > > > >>>+
> > > > > > > >>> /* Check box */
> > > > > > > >>> Vect_get_area_box (Map, area, &box);
> > > > > > > >>> if ( box.N < window->south || box.S > window->north ||
> > > > > > > >>>@@ -136,7 +149,7 @@
> > > > > > > >>> Vect_append_points ( Points, IPoints, GV_FORWARD);
> > > > > > > >>> Vect_append_point ( Points, xl, yl, 0.0 ); /* ??? */
> > > > > > > >>> }
> > > > > > > >>>-
> > > > > > > >>>+
> > > > > > > >>> if( table_colors_flag ) {
> > > > > > > >>> cat=Vect_get_area_cat ( Map, area , Clist -> field );
> > > > > > > >>> centroid = Vect_get_area_centroid ( Map, area );
> > > > > > > >>>@@ -196,20 +209,15 @@
> > > > > > > >>> }
> > > > > > > >>>
> > > > > > > >>> if ( fcolor > -1 ) {
> > > > > > > >>>- if (Vect_get_isle_area (Map, area)) { /* isle ? */
> > > > > > > >>>- R_RGB_color (255, 255, 255);
> > > > > > > >>>- }
> > > > > > > >>>+ if (!table_colors_flag && !cats_color_flag) {
> > > > > > > >>>+ R_color(fcolor) ;
> > > > > > > >>>+ }
> > > > > > > >>> else {
> > > > > > > >>>- if (!table_colors_flag && !cats_color_flag) {
> > > > > > > >>>- R_color(fcolor) ;
> > > > > > > >>>+ if (rgb) {
> > > > > > > >>>+ R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > > > > >>> }
> > > > > > > >>> else {
> > > > > > > >>>- if (rgb) {
> > > > > > > >>>- R_RGB_color ((unsigned char) red, (unsigned char) grn, (unsigned char) blu);
> > > > > > > >>>- }
> > > > > > > >>>- else {
> > > > > > > >>> R_color (fcolor);
> > > > > > > >>>- }
> > > > > > > >>> }
> > > > > > > >>> }
> > > > > > > >>> G_plot_polygon ( Points->x, Points->y, Points->n_points);
> > > > > > > >>>@@ -239,8 +247,10 @@
> > > > > > > >>> } /* end for */
> > > > > > > >>>
> > > > > > > >>> Vect_destroy_line_struct (Points);
> > > > > > > >>>+ Vect_destroy_line_struct (IPoints);
> > > > > > > >>> Vect_destroy_cats_struct (Cats);
> > > > > > > >>>-
> > > > > > > >>>+ Vect_destroy_list (isles);
> > > > > > > >>>+
> > > > > > > >>> return 0;
> > > > > > > >>> }
> > > > > > > >>>

Just a quick note.

I'm about to release for testing a fundamentally rewritten GIS Manager II.
This does not yet address the issues that Hamish raises below, but hopefully
begins to provide a platform for doing so.

I hope to get this onto my website and into the CVS today or tomorrow. If
someone out there could produce a GRASS GUI WIKI page, I could put this and
the UI design documents there also.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Hamish <hamish_nospam@yahoo.com>
Date: Mon, 16 Jan 2006 17:18:32 +1300
To: <grass5@grass.itc.it>
Cc: Martin Landa <landa.martin@gmail.com>
Subject: Re: [GRASS5] d.vect -a|c for all types ver2

Hi, just some thoughts re 'd.vect -a' for all feature types-

after this patch is merged I would like to add a d.vect rgb_column=
option to set the column name to something other than GRASSRGB (although
that will be the default).

I collect a number of channels of data along my gps tracks (water
temperature, chemistry, life, clarity, etc) and for each variable
calculate a max/min and then fit a color scale which is written as a db
column during post-processing, before the whole thing is loaded into
GRASS with v.in.ascii. Currently I need to create one GRASS vector file
per variable due to only being able to access a single "GRASSRGB" column
for coloring.

Taking this further, and acknowledging that d.vect is already
overwhelmingly complicated, perhaps a color_rules= option could be
added to access one of the standard GRASS raster color maps (in
$GISBASE/etc/colors/), fit to data, and then use on-the-fly?
e.g. use with LIDAR data where DB holding GRASSRGB column can't
exist and just too huge for d.vect.thematic (if it worked without a data
column).

Even further- allow access to any colr/ file created with r.colors.
But mixing raster/vector functions like this isn't very clean and is to
be avoided...

re. d.vect being way too complicated to quickly use or learn:
An idea would be to keep d.vect powerful but split up the functionalily
in the GUI into "display points" and "display areas" etc. as the "Add
vector layer" panel is already too much for a new user. split up into
features,colors,labels,query sections which can be collapsible? dunno.

I already use scripts for displaying points and areas (d.stations and
d.varea on the wiki add-ons page) as d.vect has too many options to
quickly type. And I see the existance of useful work around scripts to
be a sign there is a problem that should be fixed at the core.

regards,
Hamish

If someone out there could produce a GRASS GUI WIKI page, I could put
this and the UI design documents there also.

I have created a GrassDevelopment page in the wiki, linked from the main
page. Log in & click on the GrassGui "?" (or edit the page and call it
NextGenGui or whatever before clicking). You can then fill in the page.

http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassDevelopment

Hamish

Hi,

Just testing out the new 'd.vect -a' code in CVS.

I found one problem that wasn't in the last version I tested:

drawing vector points with fill color taken from GRASSRGB column works
fine & as expected, but if you try and take off the black border with
"color=none", nothing at all is drawn. The fill color still should be.

draws fill areas with GRASSRGB color and symbol border in black:
  d.vect -a temp_data icon=basic/circle size=7

doesn't draw anything:
  d.vect -a temp_data icon=basic/circle size=7 color=none

I am trying to make a "slug trail" of points, and the border messes it
up when the symbols overlap.
  http://bambi.otago.ac.nz/hamish/grass/profile_rgb.png

?
Hamish

Hi Hamish,

you are right, it does not work as it should. I hope the attached
patch will solve this problem.

best regards, Martin

2006/1/18, Hamish <hamish_nospam@yahoo.com>:

Hi,

Just testing out the new 'd.vect -a' code in CVS.

I found one problem that wasn't in the last version I tested:

drawing vector points with fill color taken from GRASSRGB column works
fine & as expected, but if you try and take off the black border with
"color=none", nothing at all is drawn. The fill color still should be.

draws fill areas with GRASSRGB color and symbol border in black:
  d.vect -a temp_data icon=basic/circle size=7

doesn't draw anything:
  d.vect -a temp_data icon=basic/circle size=7 color=none

I am trying to make a "slug trail" of points, and the border messes it
up when the symbols overlap.
  http://bambi.otago.ac.nz/hamish/grass/profile_rgb.png

?
Hamish

(attachments)

plot1.c.diff (2.01 KB)

> Just testing out the new 'd.vect -a' code in CVS.
>
> I found one problem that wasn't in the last version I tested:
>
> drawing vector points with fill color taken from GRASSRGB column
> works fine & as expected, but if you try and take off the black
> border with "color=none", nothing at all is drawn. The fill color
> still should be.

..

you are right, it does not work as it should. I hope the attached
patch will solve this problem.

It does, thanks. Applied to CVS.

by the way,

+++ plot1.c 18 Jan 2006 14:00:44 -0000
@@ -192,9 +192,9 @@

         if ( (ltype & GV_POINTS) && Symb != NULL ) {
       /* Note: this should go to some library function */
- if (color > -1) {

I have that library function almost ready; will trial it in the d.graph
module before unleashing on the more important d.vect module.
Will post more about it later today.

Also will hopefully get the GRASSRGB variable column name code into
d.vect today.

regards,
Hamish

Also will hopefully get the GRASSRGB variable column name code into
d.vect today.

done.

Hamish