[GRASS-dev] Re: thematic mapping scripts

On Oct 6, 2008, at 9:00 AM, <grass-dev-request@lists.osgeo.org> <grass-dev-request@lists.osgeo.org > wrote:

Date: Mon, 06 Oct 2008 12:19:38 +0200
From: Moritz Lennert <mlennert@club.worldonline.be>
Subject: Re: [GRASS-dev] porting r.in.wms to python
To: hamish_b@yahoo.com
Cc: Glynn Clements <glynn@gclements.plus.com>, grass-dev
  <grass-dev@lists.osgeo.org>
Message-ID: <48E9E63A.3030908@club.worldonline.be>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 06/10/08 04:16, Hamish wrote:

Glynn wrote:

  d.vect.thematic (d.mon)

(somewhat replaced d.thematic.area,v.class? any thoughts Moritz/Michael?)

d.thematic.area works for me, but I have not had any testing feedback
from anyone else.
I still need to finish "d.thematic.points_and_lines" (still need to find
a good name for it, or split it into two d.thematic.points and
d.thematic.lines). Probably "just" a 1-2 days job for me (1-2 hours for
others :wink: ), but I need a full stretch of time to be able to
concentrate on it, and this is a very rare commodity in my life at this
time (and has been for a while).

I've tried working with the thematic area C-module. I think the last time I tried it, I hit a bug, Moritz fixed it, and I haven't had a chance to try it again. This is much preferable over the very complex bash script I wrote and others have enhanced. As Moritz says, it needs testing and the points/lines version needs to be finished. Porting the existing script is not terribly hard (though it would be time consuming) and the display section needs rewriting to deal with the demise of d.mon.

However, the C-modules are better and should replace the script.

Michael

Moritz

Michael Barton wrote:

Porting the existing script is not terribly hard (though it would be
time consuming)

Actually, porting non-trivial bash scripts can be quite difficult.

The main problem is that the only data type is a string. So when some
calculation is performed with e.g. 'echo $var | sed ...', figuring out
what the command is supposed to be doing depends upon knowing what
$var is supposed to contain at that point. Writing such code is much
easier than reading it.

It gets even worse when variables contain the names of other variables
or other shell syntax, for use with eval; both r.in.wms and r.tileset
do a lot of this.

--
Glynn Clements <glynn@gclements.plus.com>