[GRASS-dev] [GRASS GIS] #2595: Extend r.out.file to PNG/PS monitors

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Default | Version: unspecified
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Default | Version: unspecified
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [ticket:2595 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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: unspecified
Keywords: r.out.file | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by martinl):

  * keywords: => r.out.file
  * component: Default => Display

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: unspecified
Keywords: r.out.file | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [ticket:2595 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
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: unspecified
Keywords: r.out.file | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by gisix):

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
-------------------------+--------------------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.1
Component: Display | Version: unspecified
Keywords: r.out.file | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by gisix):

martinl ,
thx for the workaround.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
---------------------------------------+------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.1.0
Component: Display | Version: unspecified
Keywords: r.out.file, d.save, d.mon | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------+------------------------------------
Changes (by wenzeslaus):

  * keywords: r.out.file => r.out.file, d.save, d.mon
  * milestone: 7.0.1 => 7.1.0

Comment:

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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2595#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#2595: Extend r.out.file to PNG/PS monitors
---------------------------------------+------------------------------------
Reporter: gisix | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.1.0
Component: Display | Version: unspecified
Keywords: r.out.file, d.save, d.mon | Platform: Unspecified
      Cpu: Unspecified |
---------------------------------------+------------------------------------

Comment(by gisix):

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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2595#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>