[GRASS-dev] why d.vect.thematic won't run on WinGRASS - d.mon problem

Moritz Lennert mlennert at club.worldonline.be
Thu Jan 24 04:08:18 EST 2008


On 24/01/08 04:54, Michael Barton wrote:
> 
> On Jan 23, 2008, at 6:42 PM, Glynn Clements wrote:
> 
>>
>> Michael Barton wrote:
>>
>>> In order for d.vect.thematic to run in the GUI (the only way it will
>>> work in WinGRASS), it has to start and stop the PNG monitor.
>>>
>>> To do this, it has to run d.mon--i.e., d.mon start=png and d.mon
>>> stop=png.
>>>
>>> However, d.mon will not run in WinGRASS, probably because it does not
>>> have x11. I am betting that d.mon ALWAYS checks for an x11 monitor
>>> when it attempts to do something.
>>
>> Nope. d.mon doesn't work in WinGRASS because monitors don't work in
>> WinGRASS. This isn't due to the lack of X11 (which only affects
>> XDRIVER), but the lack of Unix-style sockets (by which, I mean sockets
>> which work with read() and write(), not necessarily Unix-domain
>> sockets).
>>
>> I tried modifying the code to use TCP sockets, but I couldn't get it
>> to work. Well, using TCP sockets works on Unix, but the process of
>> converting the WinSock SOCKET to an fd which works with MSVCRT's
>> read() and write() didn't seem to work.
>>
>> So, unless someone is willing to invest the effort to replicate the
>> communication between libraster and the drivers, monitors will remain
>> unavailable in the native WinGRASS version.
> 
> I was afraid that you were going to say something like that
> 
>>
>> If you just want d.vect.thematic to work with WinGRASS, changing it to
>> use GRASS_RENDER_IMMEDIATE=TRUE instead of "d.mon start=PNG" would
>> probably be less work than getting monitors working.
> 
> In fact, we recently had to change d.vect.thematic to set 
> GRASS_RENDER_IMMEDIATE=FALSE so that it's multiple iterations of d.vect 
> would composite in the PNG monitor and then be output as a PNG to the GUI.

Maybe it would be possible to use GRASS_RENDER_IMMEDIATE=TRUE to create 
the different layers and then g.pnmcomp them ?

> 
> If we want it to work with Windows, it will take considerably more 
> coding. we have to set GRASS_RENDER_IMMEDIATE=TRUE, track all iterations 
> of d.vect and use g.pnmcomp to composite them all. It might be possible 
> to make use of existing TclTk code to do some of this, but I doubt it.

Actually, the best bet is to get the C-replacement of d.vect.thematic up 
and running. For area mapping, it is already in a fairly usable state 
(IMHO), the main drawback at this stage probably being the lack of 
automagic color choosing. I'll try to compile it in mingw and see if I 
can put a binary on the website. For the other objects (lines and 
points) this will have to wait until I find the time...

I guess I should probably put the current code into svn soon, so that 
others can more easily work with it...

Moritz


More information about the grass-dev mailing list