[GRASS-dev] [GRASS GIS] #600: d.vect: add new size_column=, rotation_column= options

#600: d.vect: add new size_column=, rotation_column= options
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Keywords: d.vect | Platform: All
      Cpu: All |
-------------------------+--------------------------------------------------
Hi,

it would be nice if d.vect had two new options for display of
points/icons: size_column= and rotation_column=.

I think to do it we'd just have to clone the code from the existing
rgb_column=, wcolumn= options, then: (as in d.graph)

{{{
- S_stroke(Symb, size, 0.0, 0);
+ S_stroke(Symb, size, double rotation, 0);
}}}

angle is measured in degrees CCW from East.

we'd have to verify that cats with NULL attributes for rotation angle use
rotation=0.0 and not just whatever the angle of the last cat was. I guess
that the wcolumn= option already has code to check that the given column
is numeric.

workaround using d.graph:
{{{
#spearfish dataset
#create example values using the cat number for angle
# rotation is measured in degrees CCW from East

g.copy vect=archsites,test_rotate
v.db.addcol test_rotate column='rotation double precision'
v.db.update test_rotate column=rotation value='CAT'

v.out.ascii test_rotate column=rotation | \
    awk -F'|' '{printf("rotation %s\nsymbol geology/strike_triangle 12 %s
%s black black\n", $4, $1, $2)}' \
    > test_rotate_graph.rules

d.graph -m test_rotate_graph.rules
d.vect test_rotate disp=cat yref=top
}}}

thanks,
Hamish

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

On 12/05/09 09:23, GRASS GIS wrote:

#600: d.vect: add new size_column=, rotation_column= options
-------------------------+--------------------------------------------------
Reporter: hamish | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new Priority: normal | Milestone: 6.5.0 Component: Vector | Version: svn-develbranch6 Keywords: d.vect | Platform: All Cpu: All | -------------------------+--------------------------------------------------
Hi,

it would be nice if d.vect had two new options for display of
points/icons: size_column= and rotation_column=.

I think to do it we'd just have to clone the code from the existing
rgb_column=, wcolumn= options, then: (as in d.graph)

Or use the code for size_column in d.vect.chart

Moritz

#600: d.vect: add new size_column=, rotation_column= options
--------------------------+-------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: d.vect
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):

implemented in devbr6/trunk with r38508/r38509.

please test -- I'm a bit concerned about a possible double-free() in
source:grass/trunk/display/d.vect/plot1.c@38509#L542

The effect of S_stroke() seems to be cumulative, so we need to re-read in
the symbol each time to reset it. Maybe a better way would be to read in a
master copy then memcpy() SYMBOL *Symb to a disposable copy and
S_stroke()+D_symbol()+G_free() the disposable version?

spearfish example:
  d.vect -c archsites icon=basic/triangle rot_col=cat size_col=cat

Hamish

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

#600: d.vect: add new size_column=, rotation_column= options
--------------------------+-------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: d.vect
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by hamish):

todo for GRASS 7: change S_stroke()'s size parameter to take double
instead of int.

Hamish

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

#600: d.vect: add new size_column=, rotation_column= options
--------------------------+-------------------------------------------------
  Reporter: hamish | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Resolution: fixed | Keywords: d.vect
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => fixed

Comment:

S_stroke() updated in trink to take doubles for size. closing wish.

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