[GRASS-user] Labels On Maps

Rich Shepard rshepard at appl-ecosys.com
Sun Jan 3 13:35:54 EST 2010

On Sat, 2 Jan 2010, Hamish wrote:

> you should use the v.label module if you want advanced placement control.
> it is one case when you are encouraged to hack the x,y offsets in the
> $MAPSET/paint/labels/ text file by hand. It goes well with unix power-
> tools. Use d.labels + d.redraw while tweaking the labels file in a text
> editor in another window.
> for automatic overlap conflict-resolution you can try the v.label.sa
> module.


   v.label.sa works just fine for labeling the project-specific points of
interest. Thank you.

   Now I need to find the way to place a label without reference to a
specific table and attribute column. d.label displays the labels created
with v.label[.sa], and displays _all_ stream names visible in the region.
This would not normally be an issue, but within the one basin, each
tributary is given the same name as the main creek, and all I want is a
single label I can place along the mainstem of the drainage.

   d.text seems to be the appropriate module, but I've bumped into an
interesting situation with it. Here's the command:

d.text text="Abernethy Creek" size=2 color=blue bgcolor=white at=50,70 \
     align=lr rotation=-45 font=DejaVuSerif-Bold

   The above displays the creek name in blue, rotated, and the background
rectangle in white, horizontal, and outside the string itself. Yet, when I
remove the bgcolor= option, the text does not display. Check mate.

   How can I get either 1) the background color box to match the alignment
and rotation of the text or b) leave the background color box off while
allowing the text to display?


More information about the grass-user mailing list