[GRASS-user] Display output question

Moritz Lennert mlennert at club.worldonline.be
Wed Feb 18 05:40:43 EST 2009


On 17/02/09 02:42, Michael Barton wrote:
> 
> 
> On Feb 16, 2009, at 6:34 PM, <grass-user-request at lists.osgeo.org> wrote:
> 
>> Date: Tue, 17 Feb 2009 10:40:52 +1100
>> From: Richard Chirgwin <rchirgwin at ozemail.com.au>
>> Subject: [GRASS-user] Display output question
>> To: GRASS user list <grass-user at lists.osgeo.org>
>> Message-ID: <4999F984.9060605 at 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



More information about the grass-user mailing list