[GRASS-user] script option

Frank David frank.david at geophom.fr
Tue Jul 10 06:44:51 PDT 2018



Le 10/07/2018 à 12:25, Nikos Alexandris a écrit :
> * frank <frank.david at geophom.fr> [2018-07-10 08:05:29 +0200]:
>
>> Hi dear grass users,
>>
>> I'm trying to get two field name of an attribute table (ctx_map) by 
>> the options of the gui. But I can access only at the first one and I 
>> don't find why...??. See my code below :
>>
>> #%option G_OPT_V_MAP
>> #% key: ctx_map
>> #% description: vector data
>> #% required : yes
>> #% guidependency:layer,ctx_wf,ctx_wtg
>> #%end
>> #%option G_OPT_V_FIELD
>> #% key:ctx_layer
>> #% guidependency:ctx_wf,ctx_wtg
>> #%end
>> #%option G_OPT_DB_COLUMN
>> #% key:ctx_wf
>> #% description: wf name
>> #% required: yes
>> #%end
>> #%option G_OPT_DB_COLUMN
>> #% key:ctx_wtg
>> #% description: wtg name
>> #% required: yes
>> #%end
>>
>> Thank you for your help.
>> Frank
>
> Dear Frank,
Hello Nikos,
>
> if you refer to the last two "column" options,
> how do you try to access these, in the script?
>
> Like,
>
> options['ctx_wf']
> options['ctx_wtg']
Absolutely
>
> ?
>
> Also, what .xml does
>
> x.ScriptName --interface-description
>
> generate?
There is no error on compilation, and help tab display Flags and 
Parameters information, like (french accent are not well encoded):

Parameters:
obj_map=name [required]
Name of vector map
MH ou WTG projet
obj_layer=string
Layer number or name
Vector features can have category values in different layers. This 
number determines which layer to use. When used with direct OGR access 
this is the layer name.
Default: 1
obj_name=name [required]
Nom de l'objet
*ctx_map=name [required] **
**Name of vector map **
*Contexte éolien *
**ctx_layer=string **
**Layer number or name **
**Vector features can have category values in different layers. This 
number determines which layer to use. When used with direct OGR access 
this is the layer name. **
**Default: 1 **
**ctx_wf=name [required] **
*Nom du parc *
**ctx_wtg=name [required] **
*Identifiant éolienne
>
> Nikos
Frank



-- 
*Geophom*
327 rue de Vieille Cour 44521 OUDON
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06
www.geophom.fr
-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180710/84c6882c/attachment.html>


More information about the grass-user mailing list