[GRASS-user] d.title and d.text
Micha Silver
tsvibar at gmail.com
Sun Dec 9 23:16:25 PST 2018
In a recent thread [1] a user complained that he could not get d.title
to add a title to a map display.
I'd like to point out that the combination of d.title and d.text is not
working also on my system. I don't use the d.* modules much any more,
but after seeing the OP's post, I decided to test.
I'm using Linux Mint, and here's what I tried:
GRASS 7.4.0 (WGS84):~ > g.list rast
....
srtm_negev_3arc
....
GRASS 7.4.0 (WGS84):~ > g.region rast=srtm_negev_3arc
GRASS 7.4.0 (WGS84):~ > d.mon wx0 # empty monitor appears
GRASS 7.4.0 (WGS84):~ > d.rast srtm_negev_3arc # map displays OK
100%
# Now I try to add a title:
GRASS 7.4.0 (WGS84):~ > d.title -d map=srtm_negev_3arc color=red #
-d flag should display on wx0, but...
GRASS 7.4.0 (WGS84):~ > ERROR: Failed to run command 'd.text
input=/home/micha/GIS/grass/WGS84/PERMANENT/.tmp/TP480/11266.0
at=50,50'. Details:
GRASS_INFO_ERROR(11330,1): Unable to open input file
</home/micha/GIS/grass/WGS84/PERMANENT/.tmp/TP480/11266.0>
GRASS_INFO_END(11330,1)
# The tmp file is indeed missing:
GRASS 7.4.0 (WGS84):~ > ll /home/micha/GIS/grass/WGS84/PERMANENT/.tmp/TP480/
total 12
drwxr-xr-x 3 micha micha 4096 Dec 7 13:21 .
drwxr-xr-x 3 micha micha 4096 Dec 7 13:19 ..
-rw-r--r-- 1 micha micha 0 Dec 7 13:40 11143.0.leg
drwxr-xr-x 3 micha micha 4096 Dec 7 13:20 MONITORS
# Another try
GRASS 7.4.0 (WGS84):~ > d.title map=srtm_negev_3arc color=red size=10 |
d.text align=cc
GRASS 7.4.0 (WGS84):~ > # No title appears
# How about text without d.title
GRASS 7.4.0 (WGS84):~ > d.text text="My Title" color=red at=5,5
# Now text appears as expected!
GRASS 7.4.0 (WGS84):~ > echo "Second title" >> my_title.txt
GRASS 7.4.0 (WGS84):~ > d.text input=my_title.txt color=red at=25,25
# Again text appears
# And d.title piped into a file also works:
GRASS 7.4.0 (WGS84):~ > d.title map=srtm_negev_3arc > my_title2.txt
GRASS 7.4.0 (WGS84):~ > cat my_title2.txt
.C black
.S 4.000000
LOCATION: WGS84
srtm_negev_3arc in PERMANENT
North: 32.00 South: 29.00
West: 33.00 East: 36.00
Resolution: n-s: 0.00 e-w: 0.00
GRASS 7.4.0 (WGS84):~ > d.text input=my_title2.txt color=red at=75,75
# Text appears as expected
So maybe something is missing/not working in d.title | d.text combination ??
Regards, Micha
[1] https://lists.osgeo.org/pipermail/grass-user/2018-December/079778.html
--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
+972-523-665918
More information about the grass-user
mailing list