[GRASS-dev] Re: #339: d.mon doesn't work (WinGrass commandline)

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Oct 20 12:43:49 EDT 2008


On Mon, 20 Oct 2008, Glynn Clements wrote:

>
> Moritz Lennert wrote:
>
>>> How about for GRASS 7 on all platforms, turning d.mon into a script that
>>> runs an image display program that initialises the image it displays
>>> from GRASS_PNGFILE and automatically refreshes the display when the file
>>> is modified? If the display program was simple (I guess a very simple
>>> cross-platform PNG viewer might not be too difficult to implement?) it
>>> could be included in the GRASS source code and would be convenient for
>>> people to use all their favourite non-interactive d.* commands without
>>> having to run the GUI.
>>
>> Just to add my 2 cents: I've successfully used gqview [1] in that
>> manner, i.e. leaving it open and displaying map.png. It automatically
>> updates the images when it changes. I bet there must be several other
>> programs that do the same, so I don't think we really need to program
>> anything. Maybe just offer a list of programs that users might consider.
>
> Note that there's also visualisation/ximgview, which exists for this
> purpose (although more as a proof-of-concept than anything).

Ah yes - that's exactly the kind of thing I was thinking about.

> One limitation of ximgview is that it only works for mmap()d BMP
> files. The reason for this is so that it will never have to deal with
> an incomplete file.
>
> To use it:
>
> 	export GRASS_PNGFILE=map.bmp
> 	# create the file
> 	d.erase
> 	export GRASS_PNG_MAPPED=TRUE
> 	export GRASS_PNG_READ=TRUE
> 	ximgview map.bmp
>
> Also, you can set:
>
> 	export GRASS_NOTIFY="kill -USR1 `pidof ximgview`"
>
> This will cause R_close_driver() to send a signal to ximgview to
> update the display, rather than waiting for it to poll. In that
> situation, pass percent=1 to ximgview (percent=0 causes a
> divide-by-zero).

Something like the above wrapped up in a script called d.mon would I 
suspect go a reasonable way towards satisfying people looking for a 
quick-and-easy way of displaying a few maps.

Paul


More information about the grass-dev mailing list