[GRASS-user] ps.map & arrow head

Hamish hamish_b at yahoo.com
Fri Oct 28 00:51:06 EDT 2011

Vincent wrote:
> a bit of squeezed with ps.map : is there a simple way to
> draw arrowheads on top of vector lines in a map composition ?

you mean like 'd.vect disp=dir' ?  if so, not that I know of.

> I did not find any option in vlines instruction. Did I miss
> it ?
> Perhaps should I extract tnodes (or fnodes) from the source
> lines vector, then print arrowheads as symbols with vpoints
> instruction.

you should make a new ">" symbol without a tail in case the
rotational alignment is not perfect, with the center at the
arrow point.

> But I can't figure out how I can obtain the angle to rotate
> symbols the right way, ie finding the azimuth of the last (or
> first) segment of each line...

perhaps 'v.to.points dmax=' or v.lrs to set the along-line
node points. unfortunately there is no doffset= option to go
with v.to.point's dmax=, as it would be nice to do like
 dmax=100 doffset=50
to get midpoints of 100m segments (see also the more complicated
v.segment module)

once 100m line segments are created (sorry no exact recipe for
that comes to mind but it must be possible; maybe together with
the v.to.points nodes?) you can use v.to.db to get azimuth of
the line segments uploaded to the line segment vector's DB, then
use db.execute to attach those to the point vector map, and any
+90 degree rotation if it is needed. 
(typically grass uses degrees CCW from the +x axis for rotation)

> If anyone experienced this, I would be glad to know how you
> proceeded.

hopefully the above gives you enough to figure something out.
if so, please add the trick to the wiki, or maybe we could
make a script. (ISTR there is something similar for ps.map
there already, it would be good for things like railroad -+--+-

even better is if there is a postscript trick for this, then
we could add


somehow, like adding a  direction=No|yes|tick  instruction to
vlines. if so we probably want to add a tick_spacing instruction
too, probably using points as the distance unit for that, 
defaulting to something like 8mm.


More information about the grass-user mailing list