[GRASS-dev] Re: [GRASS-user] interactive multiple selection

Glynn Clements glynn at gclements.plus.com
Fri Jan 23 13:05:31 EST 2009


Hamish wrote:

> slightly-related, but before I forget, I had an idea about the "adding
> where= SQL queries to all vector modules in gr7" wish. hijack the parser
> with a semi-colon.
> 
> for example:
>   v.module input="roads; WHERE surface IS 'gravel'"
> 
> the standard FS is a comma, but the semi-colon allows you still have
> multiple inputs. I guess we'd need some new libgis function to tokenize
> the option list (or can G_tokenize() be run nested with a programmer
> specified delim? [upon quick look, yes, I think it can])

Are you talking about making the module handle the query, or extending
Vect_open_old() to accept a map+query so that the module doesn't need
to do anything?

> Glynn had a similar idea about the parser options for r.series(?) with
> passing maps & methods with in=mapname1,method1,mapname2,method2[,...]
> or so. I am not so sold on that idea, I would prefer like in=map1,map2,map3
> meth=n,sum,mean as it is more clear.

Also slightly related, the interface used by g.copy and g.rename is
broken. They both use opt->gisprompt = "old,...", although the
destination doesn't exist.

In the absence of a real type system for options, the interface needs
to change from:

	g.copy rast=oldmap,newmap

to e.g.:

	g.copy type=rast from=oldmap to=newmap

so that from= and to= can be typed correctly.

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


More information about the grass-dev mailing list