[GRASS5] [bug #920] (grass) d.vect.line does not draw lines

Eric G. Miller egm2 at jps.net
Fri Feb 15 21:52:06 EST 2002


On Fri, Feb 15, 2002 at 04:25:25PM +0000, M Lennert wrote:
[snip]
> So when I just want to draw the boundaries of areas without filling
> them, I have to use either d.vect or d.vect.area with
> fillcolor=backgroundcolor (which is slow since it "fills" the areas
> even though they are the same color as the background) ?

This is a shortcoming of the current modules.  Originally, I was
planning on having four, possibly five, vector drawing modules.

d.vect            -- Just draws all the line work in some color
d.vect.area.fill  -- Just draws area fill
d.vect.area.lines -- Just draws area boundaries
d.vect.lines      -- Just draws labelled lines
d.vect.points ?   -- Just draws vector points (like d.sites)

Then comes the idea to make d.vect.area more like d.area and
also to make d.vect do more than it formerly did (i.e. consolidate
everything into d.vect).  It wouldn't be too hard to consolidate
all of the functionality into d.vect, but would require some
slight changes to the interface, and either a more general
"legend" file concept or scrapping that.

One way to extend the d.vect to meet most of those needs would
be via a couple extra flags and one parameter.  Currently there's 
an 'f' flag for filling areas.  If we add an 'a' flag for area
lines, an 'l' flag for labelled lines, and a "fillcolor" argument,
then it would work something like:

If "fillcolor" Then
   Define 'f'
End If
If Exists 'f', 'a', or 'l' Then
  If "catnum" Then
     Setup category filter
  End If
  If 'f' and "fillcolor"  Then
     Fill labelled areas with "fillcolor" (filter by cats?)
  Else If 'f' Then
      Fill labelled areas with "color" (filter by cats?)
  End If
  If 'a' Then
     Draw labelled area boundaries using "color" (filter by cats?)
  End If
  If 'l' Then
     Draw labelled lines using "color" (filter by cats?)
  End If
Else
  If "catnum" Then
     Warn "Need to specify one or more of 'f', 'a', 'l'"
  End If
  Draw all lines using "color"
End If


It'd be on the user to understand that the same category number
can mean different things (area, line, point), so mixing 'f' or
'a' with 'l', might not make sense.

Also: Currently, d.vect falls back to just drawing lines if
level 2 support is not present.  I'm thinking it should
just exit with an error message ("Run v.support!").

$ d.vect help
  Draws vector maps

Usage: 
  d.vect -aflv map=name [color=name] [fillcolor=name] [catnum=value[,value,...]]

Flags:
  -a  Draw area boundaries with "color"
  -f  Fill areas with "fillcolor" (falls back to "color")
  -l  Draw labelled lines with "color"
  -v  Be verbose

Parameters:
      map  Name of existing vector map to display
    color  Color to draw with
           options: red,orange,yellow,green,blue,indigo,violet,white,black,
	            gray,brown,magenta,aqua,grey,R:G:B
           default: white
fillcolor  Draw filled areas with this color (implies -f)
           options: red,orange,yellow,green,blue,indigo,violet,white,black,
	            gray,brown,magenta,aqua,grey,R:G:B
   catnum  List of category number(s) to be displayed


I would still like to preserve some kind of "legend" file capability.
But, to have it be more generic, it'll need some extra sections or
ways be more specific about what is being specified:

defaults ::= line_color_spec?, area_color_spec?
line_color_spec ::= color_spec
area_color_spec ::= color_spec?, line_color_spec?
color_spec ::= named_color | rgb_triplet
rgb_triplet ::= "<red>:<green>:<blue>" (0-255)
named_color ::= Standard GRASS colors
area_spec ::= categories, area_color_spec
line_spec ::= categories, line_color_spec
categories ::= single_category | category_range | category_list
single_category ::= Integer > 0
category_range  ::= "single_category1-single_category2",
                     single_category2 > single_category1
category_list   ::= "single_category1,single_category2,...,single_categoryN"

Sorry for the Backus-Naur DTD mishmash ;-)

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list