Opened 22 months ago

Last modified 19 months ago

#3721 new defect

d.title with d.text does not insert title

Reported by: micha Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Display Version: 7.4.0
Keywords: title map display Cc:
CPU: Unspecified Platform: Linux

Description

When using d.title combined directly with d.text, no title appears on the map display. The d.title flag -d does not create the tmp file with title text, and piping the output of d.title into d.text does not create any title.

i.e.:

GRASS 7.4.0 (WGS84):~ > d.title -d map=srtm_negev_3arc color=red     #
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)

or

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 error but NO title appears

The only option that works is to redirect d.title into a text file, then run d.text:

GRASS 7.4.0 (WGS84):~ > d.title map=srtm_negev_3arc > my_title2.txt
GRASS 7.4.0 (WGS84):~ > d.text input=my_title2.txt color=red at=75,75
# Text appears as expected

Change History (7)

comment:1 Changed 22 months ago by neteler

Can you try

d.title map=srtm_negev_3arc color=red size=10 |
 d.text align=cc input=-

? I'm on mobile and cannot test at time

comment:2 Changed 22 months ago by micha

No difference on my setup. Using input=- does not give any error, but No title on the map display.

What works is redirecting d.title into a text file, then pointing to that file with d.text input=...

comment:3 Changed 22 months ago by hcho

There are two problems:

  1. d.title spawns d.text, but its input file gets deleted. d.text only creates a temp file for input=-, but not when a file is given. Please check r73883.
  1. d.text input=- doesn't work. Looking into it.

comment:4 Changed 22 months ago by hcho

One more problem:

d.mon start=wx0
d.text input=file

in one directory and change to another directory that has a different "file" and run

d.erase
d.text input=file

The monitor always picks up the file in the same directory where it got started.

I think this problem is GRASS_RENDER_IMMEDIATE vs. delegated rendering by render.py, but display modules should not care which renderer is being used.

Last edited 22 months ago by hcho (previous) (diff)

comment:5 Changed 22 months ago by hcho

For d.text input=-, please check r73884.

The last problem can be fixed by always creating a temporary file just like for stdin, but other display modules may have the same issue.

comment:6 Changed 22 months ago by neteler

Milestone: 7.4.47.4.5

Ticket retargeted after milestone closed

comment:7 Changed 19 months ago by micha

Milestone: 7.4.57.6.2

Checked on 7.6, the prob persists.

Note: See TracTickets for help on using tickets.