[GRASS-dev] Re: Proof of concept for more complete database access in GRASS module [was: Re: [GRASS-user] RE: Problem querying layers other than '1' in gi s.m]

Trevor Wiens twiens at interbaun.com
Wed Oct 11 01:34:57 EDT 2006

On Tue, 10 Oct 2006 17:22:29 +0200
Moritz Lennert wrote:

> I don't want to break off another debate on layers, here, but I don't 
> think that the issue here really are the layers. It is the use of sql 
> within the module. As was stated several times before, you don't even 
> have to think about layers, if you don't want to in GRASS.
> However, some people have found applications of layers which they found 
> very useful, and I doubt that all of the can be solved by arbitrary SQL 
> queries, as some of them concern the underlying geometry, and not only 
> the attributes.
> But I'd rather think about the best way to implement arbitrary queries 
> in modules than continue this debate ;-)

Agreed. I was just thinking aloud about the benefits and short-comings
of arbitrary queries. My point being is that arbitrary queries although
very powerful and flexible will be daunting for some users. Based on
that I think we will need to have a few basic examples that can be
included in the help pages for modules where arbitrary queries will be
available as well as a link to an external SQL intro page or a brief
tutorial within GRASS on SQL usage. For the second case, I have a
reasonably human friendly into to SQL which I co-wrote some years
ago for an application which had both a query builder and the ability to
manually edit or create your own queries. I could probably adapt that
(after I find it) for GRASS use once we get that far.

In thinking of checks, probably you'll only need to check that the
query is returning all the fields needed. It would also be a good idea
to check the validity of the query as soon into the function as
possible and trap and report any exceptions so if something is funny it
will fail early and noisily.

Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)

More information about the grass-dev mailing list