On Feb 18, 2009, at 7:55 AM, <grass-user-request@lists.osgeo.org> wrote:
Date: Wed, 18 Feb 2009 11:40:43 +0100
From: Moritz Lennert <mlennert@club.worldonline.be>
Subject: Re: [GRASS-user] Display output question
To: grass-user@lists.osgeo.org
Message-ID: <499BE5AB.4060907@club.worldonline.be>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 17/02/09 02:42, Michael Barton wrote:
On Feb 16, 2009, at 6:34 PM, <grass-user-request@lists.osgeo.org> wrote:
Date: Tue, 17 Feb 2009 10:40:52 +1100
From: Richard Chirgwin <rchirgwin@ozemail.com.au>
Subject: [GRASS-user] Display output question
To: GRASS user list <grass-user@lists.osgeo.org>
Message-ID: <4999F984.9060605@ozemail.com.au>
Content-Type: text/plain; charset=ISO-8859-1
Hi all,
What's the command-line equivalent to using the JPG export in the
display manager? (I would like to script outputs from a number of
workspace - GRC - files).
Cheers,
Richard
What happens in TclTk is that the display output is set to a PPM file
instead of monitor. Then any d.* command creates a graphic file. The
display graphic file is then converted to a jpeg. The latter can be done
by a variety of programs, including gdal-translate.
In wxPython, the display can be saved in a number of different formats
using wxPython drivers.
Yes, but AFAIK, you cannot easily use the contents of a .grc or .gxw
file for scripting. You would have to parse the file with relevant tools
(awk, sed or an xml parser for gxw) and then apply these options to the
d.* commands using the cairo or PNG "monitor" to create a PNG file.
In the TclTk GUI, you could save the content of the Output window after
having displayed your workspace and filter out the d.* commands. In the
wxGUI this is not possible anymore, AFAICT.
It might be worth thinking about a module that translates workspace
files into d.* commands...
Moritz
If you want to replicate a complex display with overlaying maps it is more complicated than this even. The maps need to be composited. We use g.pnmcomp. The input is a series of PNM maps and optionally their transparency masks; the output is a single, composite PNM file. I assumed (incorrectly perhaps?) that Richard was asking how to send a d.* output to a file instead of a display. Glynn has discussed adding an output argument to d.* commands for GRASS 7 to make this easier for scripting and command line work. AFAICT, this is not yet implemented.
On Feb 18, 2009, at 7:55 AM, <grass-user-request@lists.osgeo.org> wrote:
Date: Wed, 18 Feb 2009 11:40:43 +0100
From: Moritz Lennert <mlennert@club.worldonline.be>
Subject: Re: [GRASS-user] Display output question
To: grass-user@lists.osgeo.org
Message-ID: <499BE5AB.4060907@club.worldonline.be>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 17/02/09 02:42, Michael Barton wrote:
On Feb 16, 2009, at 6:34 PM, <grass-user-request@lists.osgeo.org> wrote:
Date: Tue, 17 Feb 2009 10:40:52 +1100
From: Richard Chirgwin <rchirgwin@ozemail.com.au>
Subject: [GRASS-user] Display output question
To: GRASS user list <grass-user@lists.osgeo.org>
Message-ID: <4999F984.9060605@ozemail.com.au>
Content-Type: text/plain; charset=ISO-8859-1
Hi all,
What's the command-line equivalent to using the JPG export in the
display manager? (I would like to script outputs from a number of
workspace - GRC - files).
Cheers,
Richard
What happens in TclTk is that the display output is set to a PPM file
instead of monitor. Then any d.* command creates a graphic file. The
display graphic file is then converted to a jpeg. The latter can be done
by a variety of programs, including gdal-translate.
In wxPython, the display can be saved in a number of different formats
using wxPython drivers.
Yes, but AFAIK, you cannot easily use the contents of a .grc or .gxw
file for scripting. You would have to parse the file with relevant tools
(awk, sed or an xml parser for gxw) and then apply these options to the
d.* commands using the cairo or PNG "monitor" to create a PNG file.
In the TclTk GUI, you could save the content of the Output window after
having displayed your workspace and filter out the d.* commands. In the
wxGUI this is not possible anymore, AFAICT.
It might be worth thinking about a module that translates workspace
files into d.* commands...
Moritz
If you want to replicate a complex display with overlaying maps it is more complicated than this even. The maps need to be composited. We use g.pnmcomp. The input is a series of PNM maps and optionally their transparency masks; the output is a single, composite PNM file. I assumed (incorrectly perhaps?) that Richard was asking how to send a d.* output to a file instead of a display.
Well, if that's it, than it is very easy, and, as long as you don't need transparency, very easy, no need to mess with g.pnmcomp:
If you want to replicate a complex display with overlaying
maps it is more complicated than this even. The maps need to
be composited. We use g.pnmcomp. The input is a series of
PNM maps and optionally their transparency masks; the output
is a single, composite PNM file.
.... which can be Save As..'d from the menu.
if there path to that file was known, the user could also copy it away
(probably passing it through pnmtopng) to save a few mouse clicks.
but I don't think batch workspace file -> image is possible without some
custom hacking of the python code by the user. (probably not too hard)
me, I like xwd | xwdtopnm | pnmtopng > screenshot.png