[GRASS-dev] [GRASS GIS] #1474: random color -c flag broken in d.vect

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: unspecified
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
d.vect -c no longer colors vector areas in random colors. I just tried it
on the geology map from the spm07 demo set (after rebuilding the map for
GRASS 7). All areas remain displayed as grey. I tried it from the wxGUI
and from the command line using d.mon. There were no errors It just didn't
work.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: unspecified
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by cmbarton):

A followup. This works fine on GRASS 6.4.2 svn

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: unspecified
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by cmbarton):

This is caused by setting the layer default to -1 instead of 1. Setting
this default to -1 causes other problems with querying and labeling. IMHO,
the default should be 1, which is the case for most vectors and would
avoid bogus errors like this one.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * version: unspecified => svn-trunk

Comment:

Replying to [comment:2 cmbarton]:
> This is caused by setting the layer default to -1 instead of 1. Setting
this default to -1 causes other problems with querying and labeling. IMHO,
the default should be 1, which is the case for most vectors and would
avoid bogus errors like this one.

I wonder where the new -1 default in GRASS 7 is documented. Not in

http://grass.osgeo.org/wiki/GRASS_7_ideas_collection
http://trac.osgeo.org/grass/wiki/Grass7/VectorLib
http://trac.osgeo.org/grass/wiki/Grass7/NewFeatures#Libvector
?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by cmbarton):

This seems to be a global default chosen throughout all vector modules
that have the option of choosing layers. Where is it set for all of GRASS
7 vectors?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [comment:4 cmbarton]:
> This seems to be a global default chosen throughout all vector modules
that have the option of choosing layers. Where is it set for all of GRASS
7 vectors?

it's G_OPT_V_FIELD_ALL defined in gislib
source:grass/trunk/lib/gis/parser_standard_options.c#L468

Regarding `d.vect` we could use for `layer` option G_OPT_V_FIELD which
defines default answer as 1. Then layers different from '1' will be not
rendered by default. Or we could just fix `d.vect` to colorize vector
features based on layer '1' when `layer=-1` is entered.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1474: random color -c flag broken in d.vect
-------------------------+--------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: d.vect | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by cmbarton):

It also affects querying and labels for d.vect. Additionally, it looks
like -1 is the default layer selected for all other v.* modules. This may
or may not cause problems. I understand your point.

But the most common case for vectors is to have one layer. Someone who
wants to display more than one layer can switch to -1 for display as
easily as someone who wants to use layer 1 instead of -1. But it seems we
should default to the most common case rather than less common ones.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1474#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>