[GRASS5] Re: Specifying 'database' in various modules

Michael Barton michael.barton at asu.edu
Mon Jan 24 09:10:21 EST 2005


This makes good sense.

Michael


On 1/24/05 2:54 AM, "Radim Blazek" <blazek at itc.it> wrote:

> Radim Blazek wrote:
>> Michael Barton wrote:
>> 
>>> Radim and Markus,
>>> 
>>> This is a request for a bit of fine tuning on the database modules. But I
>>> also want to see what everyone thinks about it as it wouldn't do to make
>>> things more difficult.
>>> 
>>> V.in.db and other database modules have a common format for specifying
>>> attribute tables--which is a very helpful thing. There are two fields to
>>> identify which table to use for attributes: one is called "database"
>>> and the
>>> other is called "table". In some cases, the "database" field is a
>>> host/database specification string (as in mysql). In other cases it is
>>> simply a path to a table location (as in ASCII or dbf tables). I'd
>>> like to
>>> suggest that the descriptive text that appears in the autogenerated
>>> GUI be
>>> called "specify database or path to data table". This will make it easier
>>> for new users (and forgetful old users like me) to know what to put in
>>> this
>>> field.
>>> 
>>> A browse button would be nice here too, though only useful for those
>>> cases
>>> where database is a path.
>>> 
>>> Thanks
>>> Michael
>> 
>> 
>> OK, note that you can use 'label' (name/short description) and
>> 'description' (long description), so something like
>> 
>> database_opt ->label       = "Database";
>> database_opt ->description = "For dbf driver the path to the directory..."
>> 
>> Radim
> 
> Better to add a new standard options to gislib, because both driver and
> database are reused in many modules. Look at G_define_standard_option()
> in lib/gis/parser.c, there is already G_OPT_WHERE.
> You have to define also new STD_OPT in include/gis.h, (G_OPT_DRIVER,
> G_OPT_DATABASE)
> Then in modules use just:
> 
> driver_opt = G_define_standard_option(G_OPT_DRIVER);
> database_opt = G_define_standard_option(G_OPT_DATABASE);
> 
> Radim

____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ  85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>




More information about the grass-dev mailing list