Opened 9 years ago

Closed 6 years ago

#2595 closed enhancement (invalid)

Extend r.out.file to PNG/PS monitors

Reported by: gisix Owned by: grass-dev@…
Priority: normal Milestone: 7.4.1
Component: Display Version: unspecified
Keywords: r.out.file, d.save, d.mon Cc:
CPU: Unspecified Platform: Unspecified

Description

Currently r.out.file only works for active X-monitors. Please extend for PNG/PS/etc monitors. This will enable the use in automated scripts and on systems without an X-Server.

Change History (13)

in reply to:  description comment:1 by martinl, 9 years ago

Replying to gisix:

Currently r.out.file only works for active X-monitors. Please extend for PNG/PS/etc monitors. This will enable the use in automated scripts and on systems without an X-Server.

There are no X-monitors in GRASS 7. Are you referring to wx0 (wxGUI) monitors?

comment:2 by martinl, 9 years ago

Component: DefaultDisplay
Keywords: r.out.file added

in reply to:  description comment:3 by martinl, 9 years ago

Replying to gisix:

Currently r.out.file only works for active X-monitors. Please extend for PNG/PS/etc monitors. This will enable the use in automated scripts and on systems without an X-Server.

btw, you don't need r.out.file for that. Using d.mon is enough, eg.

d.mon cairo out=/tmp/elev.png
d.rast elevation
d.mon -r

comment:4 by gisix, 9 years ago

The issue was first noticed in GRASS6.4.x, so apologies for the reference to x0 etc. There was an earlier discussion on the user list about this:

On Wed, Nov 12, 2014 at 4:13 AM, Glynn Clements <glynn at gclements.plus.com> wrote:

César Augusto Ramírez Franco wrote:

As far as I understand, d.out.file only works with X monitors,

This appears to be the case, although I have no idea why.

The basic operation of d.out.file is to run "d.save" to extract the list of commands used to generate the display, then replay those commands on a PNG/PS/cairo monitor.

The functionality on which d.save relies isn't specific to a particular driver.

-- Glynn Clements <glynn at gclements.plus.com>

It would be great if this could be fixed both in 6.4.5 and 7.0.1.

comment:5 by gisix, 9 years ago

martinl , thx for the workaround.

comment:6 by wenzeslaus, 9 years ago

Keywords: d.save d.mon added
Milestone: 7.0.17.1.0

Please, share the exact workflow and commands you are using or wish to use, so it is clear what you miss and what is your use case (which current system does not cover). Also, please test your workflow in both 6.4 and 7.0 and be specific about what works and what does not work in each of them. Ideally provide a simple shell script (minimal working example) which shows the requested functionality.

This looks like a feature which should be implemented for next version, so changing milestone.

comment:7 by gisix, 9 years ago

Intended workflow (Pseudocode):


1) The user provides custom mapping information as a d.save output file "FOO" (raster,vector,annotations,lettering,whatever)

2) The content of FOO is exported as the geotiff "BAZ" [conveniently provided via an extended r.out.file module..]

3) BAZ can be used by other software (like GMT)


Current ugly bash script. Works with GRASS 6.4.4. Code has not been implemented for GRASS 7.x

###########################################

# Start dummy-monitor to recreate user-sided monitor content # TBD: Why does d.out.file not cooperate with a PNG monitor ? d.mon start=x7 d.mon select=x7

########################################### # Execute user-provided monitor content in x7

sh ./$GRASS_MONITOR_DSAVE_FILE

########################################### # Failsafe: Remove precautiously d.out.file output as the script doesn't allow --o overwrite.

rm ${OUTPUT_FILE}

########################################### # Write out monitor content as Geotiff:

d.out.file output=${OUTPUT_FILE} format=geotiff resolution=1 size=$MONITOR_WIDTH,$MONITOR_HEIGHT

########################################## # Terminate monitor d.mon stop=x7

comment:8 by neteler, 8 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:9 by neteler, 7 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:10 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:11 by martinl, 7 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:12 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:13 by martinl, 6 years ago

Resolution: invalid
Status: newclosed

No activity, closing.

Note: See TracTickets for help on using tickets.