[GRASS-dev] symbol rotation is go

Hamish hamish_nospam at yahoo.com
Thu Apr 26 09:51:00 EDT 2007


I have just added a new libgis function: G_rotate_around_pt() in 6.3cvs.
 (make distclean, yet again)

It rotates a point around a given center coord by a given angle.

this enables a few things--

Anything that uses D_symbol() can now pass S_stroke() a rotation angle.
(and have it do something, the stub was already there)

d.graph: you can now rotate symbols. for example, a sideways mushroom-
 echo -e "rotation 45\nsymbol demo/muchomurka 120 50 50 black red" | \

ps.map: label boxes are now padded slightly from the point coord.
  (matches what d.labels did already; rotation safe)

possibility for wind-barb or arrow symbols to be rendered at arbitrary
angles, e.g. angle taken from an attribute column, with less low-level
display lib C coding. I've been thinking about a wind-barb fn for a
while:  D_barb(double velocity, double angle) [which would need low-
level display lib C, but that's ok]

possibility for d.rast.arrow code simplification.

I've had this in d.labels as a local fn for the last week or two to
help with its label rotation code.

maybe missing: any const needed in the fn prototype?? Happy to fix that,
but no idea.

It works on integer coords, as that's all I needed for the display and
ps.map coords. It would be easy enough to add a version that takes
doubles, but I had no need for that. If needed, perhaps make the int
version a wrapper around the FP version. Don't know how much of a
performance hit that would be-- d.vect for a vector map with 2 million
points can hit D_symbol() pretty hard and take a while to run already..


More information about the grass-dev mailing list