parser_standard_options.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. /*!
  2. \file lib/gis/parser_standard_options.c
  3. \brief GIS Library - Argument parsing functions (standard options)
  4. (C) 2001-2011 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Original author CERL
  8. \author Soeren Gebbert added Dec. 2009 WPS process_description document
  9. \author Luca Delucchi added Aug 2011 G_OPT_M_DIR
  10. */
  11. #include <grass/gis.h>
  12. #include <grass/glocale.h>
  13. #include "parser_local_proto.h"
  14. /*!
  15. \brief Create standardised Option structure.
  16. This function will create a standardised Option structure defined by
  17. parameter <i>opt</i>. A list of valid parameters bellow. It
  18. allocates memory for the Option structure and returns a pointer to
  19. this memory.
  20. If an invalid parameter was specified a empty Option structure will
  21. be returned (not NULL).
  22. - database:
  23. - G_OPT_DB_WHERE
  24. - G_OPT_DB_TABLE
  25. - G_OPT_DB_DRIVER
  26. - G_OPT_DB_DATABASE
  27. - G_OPT_DB_SCHEMA
  28. - G_OPT_DB_COLUMN
  29. - G_OPT_DB_COLUMNS
  30. - G_OPT_DB_KEYCOLUMN
  31. - imagery:
  32. - G_OPT_I_GROUP
  33. - G_OPT_I_SUBGROUP
  34. - raster:
  35. - G_OPT_R_INPUT
  36. - G_OPT_R_INPUTS
  37. - G_OPT_R_OUTPUT
  38. - G_OPT_R_MAP
  39. - G_OPT_R_MAPS
  40. - G_OPT_R_BASE
  41. - G_OPT_R_COVER
  42. - G_OPT_R_ELEV
  43. - G_OPT_R_ELEVS
  44. - raster3d:
  45. - G_OPT_R3_INPUT
  46. - G_OPT_R3_INPUTS
  47. - G_OPT_R3_OUTPUT
  48. - G_OPT_R3_MAP
  49. - G_OPT_R3_MAPS
  50. - vector:
  51. - G_OPT_V_INPUT
  52. - G_OPT_V_INPUTS
  53. - G_OPT_V_OUTPUT
  54. - G_OPT_V_MAP
  55. - G_OPT_V_MAPS
  56. - G_OPT_V_TYPE
  57. - G_OPT_V_FIELD
  58. - G_OPT_V_FIELD_ALL
  59. - G_OPT_V_CAT
  60. - G_OPT_V_CATS
  61. - G_OPT_V_ID
  62. - G_OPT_V_IDS
  63. - files
  64. - G_OPT_F_INPUT
  65. - G_OPT_F_OUTPUT
  66. - G_OPT_F_SEP
  67. - colors
  68. - G_OPT_C_FG
  69. - G_OPT_C_BG
  70. - misc
  71. - G_OPT_M_UNITS
  72. - G_OPT_M_DATATYPE
  73. - G_OPT_M_MAPSET
  74. - G_OPT_M_EN
  75. - G_OPT_M_COLR
  76. - G_OPT_M_DIR
  77. - temporal GIS framework
  78. - G_OPT_STDS_INPUT
  79. - G_OPT_STDS_INPUTS
  80. - G_OPT_STRDS_INPUT
  81. - G_OPT_STRDS_INPUTS
  82. - G_OPT_STRDS_OUTPUT
  83. - G_OPT_STR3DS_INPUT
  84. - G_OPT_STR3DS_INPUTS
  85. - G_OPT_STR3DS_OUTPUT
  86. - G_OPT_STVDS_INPUT
  87. - G_OPT_STVDS_INPUTS
  88. - G_OPT_STVDS_OUTPUT
  89. - G_OPT_MAP_INPUT
  90. - G_OPT_MAP_INPUTS
  91. - G_OPT_STDS_TYPE
  92. - G_OPT_MAP_TYPE
  93. - G_OPT_T_TYPE
  94. - G_OPT_T_WHERE
  95. \param opt type of Option struct to create
  96. \return pointer to an Option struct
  97. */
  98. struct Option *G_define_standard_option(int opt)
  99. {
  100. struct Option *Opt;
  101. Opt = G_define_option();
  102. switch (opt) {
  103. case G_OPT_DB_WHERE:
  104. Opt->key = "where";
  105. Opt->type = TYPE_STRING;
  106. Opt->key_desc = "sql_query";
  107. Opt->required = NO;
  108. Opt->label = _("WHERE conditions of SQL statement without 'where' keyword");
  109. Opt->description = _("Example: income < 1000 and inhab >= 10000");
  110. break;
  111. case G_OPT_DB_TABLE:
  112. Opt->key = "table";
  113. Opt->type = TYPE_STRING;
  114. Opt->key_desc = "name";
  115. Opt->required = NO;
  116. Opt->multiple = NO;
  117. Opt->description = _("Name of attribute table");
  118. Opt->gisprompt = "old,dbtable,dbtable";
  119. break;
  120. case G_OPT_DB_DRIVER:
  121. Opt->key = "driver";
  122. Opt->type = TYPE_STRING;
  123. Opt->key_desc = "name";
  124. Opt->required = NO;
  125. Opt->multiple = NO;
  126. Opt->description = _("Name of database driver");
  127. Opt->gisprompt = "old,dbdriver,dbdriver";
  128. break;
  129. case G_OPT_DB_DATABASE:
  130. Opt->key = "database";
  131. Opt->type = TYPE_STRING;
  132. Opt->key_desc = "name";
  133. Opt->required = NO;
  134. Opt->multiple = NO;
  135. Opt->description = _("Name of database");
  136. Opt->gisprompt = "old,dbname,dbname";
  137. break;
  138. case G_OPT_DB_SCHEMA:
  139. Opt->key = "schema";
  140. Opt->type = TYPE_STRING;
  141. Opt->key_desc = "name";
  142. Opt->required = NO;
  143. Opt->multiple = NO;
  144. Opt->label = _("Database schema");
  145. Opt->description = _("Do not use this option if schemas "
  146. "are not supported by driver/database server");
  147. break;
  148. case G_OPT_DB_COLUMN:
  149. Opt->key = "column";
  150. Opt->type = TYPE_STRING;
  151. Opt->key_desc = "name";
  152. Opt->required = NO;
  153. Opt->multiple = NO;
  154. Opt->description = _("Name of attribute column");
  155. Opt->gisprompt = "old,dbcolumn,dbcolumn";
  156. break;
  157. case G_OPT_DB_COLUMNS:
  158. Opt->key = "columns";
  159. Opt->type = TYPE_STRING;
  160. Opt->key_desc = "name";
  161. Opt->required = NO;
  162. Opt->multiple = YES;
  163. Opt->description = _("Name of attribute column(s)");
  164. Opt->gisprompt = "old,dbcolumn,dbcolumn";
  165. break;
  166. case G_OPT_DB_KEYCOLUMN:
  167. Opt->key = "key";
  168. Opt->type = TYPE_STRING;
  169. Opt->key_desc = "name";
  170. Opt->required = NO;
  171. Opt->multiple = NO;
  172. Opt->description = _("Name of key column");
  173. Opt->description = _("Must refer to an integer column");
  174. /* Opt->gisprompt = "old,dbcolumn,dbcolumn"; */
  175. Opt->answer = GV_KEY_COLUMN;
  176. break;
  177. /* imagery group */
  178. case G_OPT_I_GROUP:
  179. Opt->key = "group";
  180. Opt->type = TYPE_STRING;
  181. Opt->key_desc = "name";
  182. Opt->required = YES;
  183. Opt->gisprompt = "old,group,group";
  184. Opt->description = _("Name of input imagery group");
  185. break;
  186. case G_OPT_I_SUBGROUP:
  187. Opt->key = "subgroup";
  188. Opt->type = TYPE_STRING;
  189. Opt->key_desc = "name";
  190. Opt->required = YES;
  191. Opt->gisprompt = "old,subgroup,subgroup";
  192. Opt->description = _("Name of input imagery subgroup");
  193. break;
  194. /* raster maps */
  195. case G_OPT_R_INPUT:
  196. Opt->key = "input";
  197. Opt->type = TYPE_STRING;
  198. Opt->key_desc = "name";
  199. Opt->required = YES;
  200. Opt->gisprompt = "old,cell,raster";
  201. Opt->description = _("Name of input raster map");
  202. break;
  203. case G_OPT_R_INPUTS:
  204. Opt->key = "input";
  205. Opt->type = TYPE_STRING;
  206. Opt->key_desc = "name";
  207. Opt->required = YES;
  208. Opt->multiple = YES;
  209. Opt->gisprompt = "old,cell,raster";
  210. Opt->description = _("Name of input raster map(s)");
  211. break;
  212. case G_OPT_R_OUTPUT:
  213. Opt->key = "output";
  214. Opt->type = TYPE_STRING;
  215. Opt->key_desc = "name";
  216. Opt->required = YES;
  217. Opt->gisprompt = "new,cell,raster";
  218. Opt->description = _("Name for output raster map");
  219. break;
  220. case G_OPT_R_MAP:
  221. Opt->key = "map";
  222. Opt->type = TYPE_STRING;
  223. Opt->key_desc = "name";
  224. Opt->required = YES;
  225. Opt->gisprompt = "old,cell,raster";
  226. Opt->description = _("Name of raster map");
  227. break;
  228. case G_OPT_R_MAPS:
  229. Opt->key = "map";
  230. Opt->type = TYPE_STRING;
  231. Opt->key_desc = "name";
  232. Opt->required = YES;
  233. Opt->multiple = YES;
  234. Opt->gisprompt = "old,cell,raster";
  235. Opt->description = _("Name of raster map(s)");
  236. break;
  237. case G_OPT_R_BASE:
  238. Opt->key = "base";
  239. Opt->type = TYPE_STRING;
  240. Opt->key_desc = "name";
  241. Opt->required = YES;
  242. Opt->gisprompt = "old,cell,raster";
  243. Opt->description = _("Name of base raster map");
  244. break;
  245. case G_OPT_R_COVER:
  246. Opt->key = "cover";
  247. Opt->type = TYPE_STRING;
  248. Opt->key_desc = "name";
  249. Opt->required = YES;
  250. Opt->gisprompt = "old,cell,raster";
  251. Opt->description = _("Name of cover raster map");
  252. break;
  253. case G_OPT_R_ELEV:
  254. Opt->key = "elevation";
  255. Opt->type = TYPE_STRING;
  256. Opt->key_desc = "name";
  257. Opt->required = YES;
  258. Opt->gisprompt = "old,cell,raster";
  259. Opt->description = _("Name of input elevation raster map");
  260. break;
  261. case G_OPT_R_ELEVS:
  262. Opt->key = "elevation";
  263. Opt->type = TYPE_STRING;
  264. Opt->key_desc = "name";
  265. Opt->required = YES;
  266. Opt->multiple = YES;
  267. Opt->gisprompt = "old,cell,raster";
  268. Opt->description = _("Name of input elevation raster map(s)");
  269. break;
  270. /*g3d maps */
  271. case G_OPT_R3_INPUT:
  272. Opt->key = "input";
  273. Opt->type = TYPE_STRING;
  274. Opt->key_desc = "name";
  275. Opt->required = YES;
  276. Opt->gisprompt = "old,grid3,3d-raster";
  277. Opt->description = _("Name of input 3D raster map");
  278. break;
  279. case G_OPT_R3_INPUTS:
  280. Opt->key = "input";
  281. Opt->type = TYPE_STRING;
  282. Opt->key_desc = "name";
  283. Opt->required = YES;
  284. Opt->multiple = YES;
  285. Opt->gisprompt = "old,grid3,3d-raster";
  286. Opt->description = _("Name of input 3D raster map(s)");
  287. break;
  288. case G_OPT_R3_OUTPUT:
  289. Opt->key = "output";
  290. Opt->type = TYPE_STRING;
  291. Opt->key_desc = "name";
  292. Opt->required = YES;
  293. Opt->gisprompt = "new,grid3,3d-raster";
  294. Opt->description = _("Name for output 3D raster map");
  295. break;
  296. case G_OPT_R3_MAP:
  297. Opt->key = "map";
  298. Opt->type = TYPE_STRING;
  299. Opt->key_desc = "name";
  300. Opt->required = YES;
  301. Opt->gisprompt = "old,grid3,3d-raster";
  302. Opt->description = _("Name of 3D raster map");
  303. break;
  304. case G_OPT_R3_MAPS:
  305. Opt->key = "map";
  306. Opt->type = TYPE_STRING;
  307. Opt->key_desc = "name";
  308. Opt->required = YES;
  309. Opt->multiple = YES;
  310. Opt->gisprompt = "old,grid3,3d-raster";
  311. Opt->description = _("Name of 3D raster map(s)");
  312. break;
  313. case G_OPT_R3_TYPE:
  314. Opt->key = "type";
  315. Opt->type = TYPE_STRING;
  316. Opt->required = NO;
  317. Opt->multiple = NO;
  318. Opt->answer = "default";
  319. Opt->options = "default,double,float";
  320. Opt->description = _("Data type used in the output raster3d map");
  321. break;
  322. case G_OPT_R3_PRECISION:
  323. Opt->key = "precision";
  324. Opt->type = TYPE_STRING;
  325. Opt->required = NO;
  326. Opt->multiple = NO;
  327. Opt->answer = "default";
  328. Opt->description =
  329. _("Number of digits used as mantissa in the internal map storage, 0 -23 for float, 0 - 52 for double, max or default");
  330. break;
  331. case G_OPT_R3_COMPRESSION:
  332. Opt->key = "compression";
  333. Opt->type = TYPE_STRING;
  334. Opt->required = NO;
  335. Opt->multiple = NO;
  336. Opt->answer = "default";
  337. Opt->options = "default,rle,none";
  338. Opt->description =
  339. _("The compression method used in the output raster3d map");
  340. break;
  341. case G_OPT_R3_TILE_DIMENSION:
  342. Opt->key = "tiledimension";
  343. Opt->type = TYPE_STRING;
  344. Opt->required = NO;
  345. Opt->multiple = NO;
  346. Opt->key_desc = "XxYxZ";
  347. Opt->answer = "default";
  348. Opt->description =
  349. _("The dimensions of the tiles used in the output raster3d map (XxYxZ or default: 16x16x8)");
  350. break;
  351. /*vector maps */
  352. case G_OPT_V_INPUT:
  353. Opt->key = "input";
  354. Opt->type = TYPE_STRING;
  355. Opt->key_desc = "name";
  356. Opt->required = YES;
  357. Opt->gisprompt = "old,vector,vector";
  358. Opt->label = _("Name of input vector map");
  359. Opt->description = _("Or data source for direct OGR access");
  360. break;
  361. case G_OPT_V_INPUTS:
  362. Opt->key = "input";
  363. Opt->type = TYPE_STRING;
  364. Opt->key_desc = "name";
  365. Opt->required = YES;
  366. Opt->multiple = YES;
  367. Opt->gisprompt = "old,vector,vector";
  368. Opt->label = _("Name of input vector map(s)");
  369. Opt->description = _("Or data source(s) for direct OGR access");
  370. break;
  371. case G_OPT_V_OUTPUT:
  372. Opt->key = "output";
  373. Opt->type = TYPE_STRING;
  374. Opt->key_desc = "name";
  375. Opt->required = YES;
  376. Opt->gisprompt = "new,vector,vector";
  377. Opt->description = _("Name for output vector map");
  378. break;
  379. case G_OPT_V_MAP:
  380. Opt->key = "map";
  381. Opt->type = TYPE_STRING;
  382. Opt->key_desc = "name";
  383. Opt->required = YES;
  384. Opt->gisprompt = "old,vector,vector";
  385. Opt->label = _("Name of vector map");
  386. Opt->description = _("Or data source for direct OGR access");
  387. break;
  388. case G_OPT_V_MAPS:
  389. Opt->key = "map";
  390. Opt->type = TYPE_STRING;
  391. Opt->key_desc = "name";
  392. Opt->required = YES;
  393. Opt->multiple = YES;
  394. Opt->gisprompt = "old,vector,vector";
  395. Opt->description = _("Name of vector map(s)");
  396. break;
  397. case G_OPT_V_TYPE:
  398. Opt->key = "type";
  399. Opt->type = TYPE_STRING;
  400. Opt->required = NO;
  401. Opt->multiple = YES;
  402. Opt->answer = "point,line,boundary,centroid,area";
  403. Opt->options = "point,line,boundary,centroid,area";
  404. Opt->description = _("Feature type");
  405. break;
  406. case G_OPT_V3_TYPE:
  407. Opt->key = "type";
  408. Opt->type = TYPE_STRING;
  409. Opt->required = NO;
  410. Opt->multiple = YES;
  411. Opt->answer = "point,line,boundary,centroid,area,face,kernel";
  412. Opt->options = "point,line,boundary,centroid,area,face,kernel";
  413. Opt->description = _("Feature type");
  414. break;
  415. case G_OPT_V_FIELD:
  416. Opt->key = "layer";
  417. Opt->type = TYPE_STRING;
  418. Opt->required = YES;
  419. Opt->answer = "1";
  420. Opt->label = _("Layer number or name");
  421. Opt->description =
  422. _("A single vector map can be connected to multiple database "
  423. "tables. This number determines which table to use. "
  424. "When used with direct OGR access this is the layer name.");
  425. Opt->gisprompt = "old,layer,layer";
  426. break;
  427. case G_OPT_V_FIELD_ALL:
  428. Opt->key = "layer";
  429. Opt->type = TYPE_STRING;
  430. Opt->required = YES;
  431. Opt->answer = "-1";
  432. Opt->label = _("Layer number or name ('-1' for all layers)");
  433. Opt->description =
  434. _("A single vector map can be connected to multiple database "
  435. "tables. This number determines which table to use. "
  436. "When used with direct OGR access this is the layer name.");
  437. Opt->gisprompt = "old,layer,layer_all";
  438. break;
  439. case G_OPT_V_CAT:
  440. Opt->key = "cat";
  441. Opt->type = TYPE_INTEGER;
  442. Opt->required = NO;
  443. Opt->description = _("Category value");
  444. break;
  445. case G_OPT_V_CATS:
  446. Opt->key = "cats";
  447. Opt->type = TYPE_STRING;
  448. Opt->key_desc = "range";
  449. Opt->required = NO;
  450. Opt->label = _("Category values");
  451. Opt->description = _("Example: 1,3,7-9,13");
  452. break;
  453. case G_OPT_V_ID:
  454. Opt->key = "id";
  455. Opt->type = TYPE_INTEGER;
  456. Opt->required = NO;
  457. Opt->description = _("Feature id");
  458. break;
  459. case G_OPT_V_IDS:
  460. Opt->key = "ids";
  461. Opt->type = TYPE_STRING;
  462. Opt->key_desc = "range";
  463. Opt->required = NO;
  464. Opt->label = _("Feature ids");
  465. Opt->description = _("Example: 1,3,7-9,13");
  466. break;
  467. /* files */
  468. case G_OPT_F_INPUT:
  469. Opt->key = "input";
  470. Opt->type = TYPE_STRING;
  471. Opt->key_desc = "name";
  472. Opt->required = YES;
  473. Opt->gisprompt = "old,file,input";
  474. Opt->description = _("Name to input file");
  475. break;
  476. case G_OPT_F_OUTPUT:
  477. Opt->key = "output";
  478. Opt->type = TYPE_STRING;
  479. Opt->key_desc = "name";
  480. Opt->required = YES;
  481. Opt->gisprompt = "new,file,output";
  482. Opt->description = _("Name for output file");
  483. break;
  484. case G_OPT_F_SEP:
  485. Opt->key = "fs";
  486. Opt->type = TYPE_STRING;
  487. Opt->key_desc = "character";
  488. Opt->required = NO;
  489. Opt->answer = "|";
  490. Opt->label = _("Field separator");
  491. Opt->description = _("Special characters: newline, space, comma, tab");
  492. break;
  493. /* colors */
  494. case G_OPT_C_FG:
  495. Opt->key = "color";
  496. Opt->type = TYPE_STRING;
  497. Opt->key_desc = "name";
  498. Opt->required = NO;
  499. Opt->answer = DEFAULT_FG_COLOR;
  500. Opt->gisprompt = "old,color,color";
  501. Opt->label = _("Color");
  502. Opt->description = _("Either a standard color name or R:G:B triplet");
  503. break;
  504. case G_OPT_C_BG:
  505. Opt->key = "bgcolor";
  506. Opt->type = TYPE_STRING;
  507. Opt->key_desc = "name";
  508. Opt->required = NO;
  509. Opt->answer = DEFAULT_BG_COLOR;
  510. Opt->gisprompt = "old,color,color_none";
  511. Opt->label = _("Background color");
  512. Opt->description =
  513. _("Either a standard GRASS color, R:G:B triplet, or \"none\"");
  514. break;
  515. /* misc */
  516. case G_OPT_M_DIR:
  517. Opt->key = "input";
  518. Opt->type = TYPE_STRING;
  519. Opt->key_desc = "name";
  520. Opt->required = YES;
  521. Opt->gisprompt = "old,dir,input";
  522. Opt->description = _("Name to input directory");
  523. break;
  524. case G_OPT_M_UNITS:
  525. Opt->key = "units";
  526. Opt->type = TYPE_STRING;
  527. Opt->required = NO;
  528. Opt->multiple = NO;
  529. Opt->options =
  530. "miles,feet,meters,kilometers,acres,hectares";
  531. Opt->description = _("Units");
  532. break;
  533. case G_OPT_M_DATATYPE:
  534. Opt->key = "type";
  535. Opt->key_desc = "datatype";
  536. Opt->type = TYPE_STRING;
  537. Opt->required = YES;
  538. Opt->multiple = YES;
  539. Opt->description = _("Data type(s)");
  540. break;
  541. case G_OPT_M_MAPSET:
  542. Opt->key = "mapset";
  543. Opt->type = TYPE_STRING;
  544. Opt->required = NO;
  545. Opt->multiple = NO;
  546. Opt->key_desc = "name";
  547. Opt->gisprompt = "old,mapset,mapset";
  548. Opt->label = _("Name of mapset (default: current search path)");
  549. Opt->description = _("'.' for current mapset");
  550. break;
  551. case G_OPT_M_EN:
  552. Opt->key = "east_north";
  553. Opt->type = TYPE_DOUBLE;
  554. Opt->required = NO;
  555. Opt->multiple = YES;
  556. Opt->key_desc = "east,north";
  557. Opt->description = _("Coordinates");
  558. break;
  559. case G_OPT_M_COLR:
  560. Opt->key = "color";
  561. Opt->key_desc = "style";
  562. Opt->type = TYPE_STRING;
  563. Opt->required = NO;
  564. Opt->options = G_color_rules_options();
  565. Opt->description = _("Name of color table");
  566. Opt->descriptions = G_color_rules_descriptions();
  567. break;
  568. /* Spatio-temporal modules of the temporal GIS framework */
  569. case G_OPT_STDS_INPUT:
  570. Opt->key = "input";
  571. Opt->type = TYPE_STRING;
  572. Opt->key_desc = "name";
  573. Opt->required = YES;
  574. Opt->gisprompt = "old,stds,stds";
  575. Opt->description = _("Name of the input space time dataset");
  576. break;
  577. case G_OPT_STDS_INPUTS:
  578. Opt->key = "inputs";
  579. Opt->type = TYPE_STRING;
  580. Opt->key_desc = "name";
  581. Opt->required = YES;
  582. Opt->multiple = YES;
  583. Opt->gisprompt = "old,stds,stds";
  584. Opt->description = _("Name of the input space time datasets");
  585. break;
  586. case G_OPT_STRDS_INPUT:
  587. Opt->key = "input";
  588. Opt->type = TYPE_STRING;
  589. Opt->key_desc = "name";
  590. Opt->required = YES;
  591. Opt->gisprompt = "old,strds,strds";
  592. Opt->description = _("Name of the input space time raster dataset");
  593. break;
  594. case G_OPT_STRDS_INPUTS:
  595. Opt->key = "inputs";
  596. Opt->type = TYPE_STRING;
  597. Opt->key_desc = "name";
  598. Opt->required = YES;
  599. Opt->multiple = YES;
  600. Opt->gisprompt = "old,strds,strds";
  601. Opt->description = _("Name of the input space time raster datasets");
  602. break;
  603. case G_OPT_STRDS_OUTPUT:
  604. Opt->key = "output";
  605. Opt->type = TYPE_STRING;
  606. Opt->key_desc = "name";
  607. Opt->required = YES;
  608. Opt->gisprompt = "new,strds,strds";
  609. Opt->description = _("Name of the output space time raster dataset");
  610. break;
  611. case G_OPT_STVDS_INPUT:
  612. Opt->key = "input";
  613. Opt->type = TYPE_STRING;
  614. Opt->key_desc = "name";
  615. Opt->required = YES;
  616. Opt->gisprompt = "old,stvds,stvds";
  617. Opt->description = _("Name of the input space time vector dataset");
  618. break;
  619. case G_OPT_STVDS_INPUTS:
  620. Opt->key = "inputs";
  621. Opt->type = TYPE_STRING;
  622. Opt->key_desc = "name";
  623. Opt->required = YES;
  624. Opt->multiple = YES;
  625. Opt->gisprompt = "old,stvds,stvds";
  626. Opt->description = _("Name of the input space time vector datasets");
  627. break;
  628. case G_OPT_STVDS_OUTPUT:
  629. Opt->key = "output";
  630. Opt->type = TYPE_STRING;
  631. Opt->key_desc = "name";
  632. Opt->required = YES;
  633. Opt->gisprompt = "new,stvds,stvds";
  634. Opt->description = _("Name of the output space time vector dataset");
  635. break;
  636. case G_OPT_STR3DS_INPUT:
  637. Opt->key = "input";
  638. Opt->type = TYPE_STRING;
  639. Opt->key_desc = "name";
  640. Opt->required = YES;
  641. Opt->gisprompt = "old,str3ds,str3ds";
  642. Opt->description = _("Name of the input space time raster3d dataset");
  643. break;
  644. case G_OPT_STR3DS_INPUTS:
  645. Opt->key = "inputs";
  646. Opt->type = TYPE_STRING;
  647. Opt->key_desc = "name";
  648. Opt->required = YES;
  649. Opt->multiple = YES;
  650. Opt->gisprompt = "old,str3ds,str3ds";
  651. Opt->description = _("Name of the input space time raster3d datasets");
  652. break;
  653. case G_OPT_STR3DS_OUTPUT:
  654. Opt->key = "output";
  655. Opt->type = TYPE_STRING;
  656. Opt->key_desc = "name";
  657. Opt->required = YES;
  658. Opt->gisprompt = "new,str3ds,str3ds";
  659. Opt->description = _("Name of the output space time raster3d dataset");
  660. break;
  661. case G_OPT_STDS_TYPE:
  662. Opt->key = "type";
  663. Opt->type = TYPE_STRING;
  664. Opt->key_desc = "name";
  665. Opt->required = NO;
  666. Opt->answer = "strds";
  667. Opt->answer = "strds,stvds,str3ds";
  668. Opt->description = _("Type of the input space time dataset");
  669. break;
  670. case G_OPT_MAP_INPUT:
  671. Opt->key = "map";
  672. Opt->type = TYPE_STRING;
  673. Opt->key_desc = "name";
  674. Opt->required = YES;
  675. Opt->gisprompt = "old,map,map";
  676. Opt->description = _("Name of the input map");
  677. break;
  678. case G_OPT_MAP_INPUTS:
  679. Opt->key = "map";
  680. Opt->type = TYPE_STRING;
  681. Opt->key_desc = "name";
  682. Opt->required = YES;
  683. Opt->multiple = YES;
  684. Opt->gisprompt = "old,map,map";
  685. Opt->description = _("Name of the input maps");
  686. break;
  687. case G_OPT_MAP_TYPE:
  688. Opt->key = "type";
  689. Opt->type = TYPE_STRING;
  690. Opt->key_desc = "name";
  691. Opt->required = NO;
  692. Opt->answer = "rast";
  693. Opt->answer = "rast,vect,rast3d";
  694. Opt->description = _("Type of the input map");
  695. break;
  696. case G_OPT_T_TYPE:
  697. Opt->key = "t_type";
  698. Opt->type = TYPE_STRING;
  699. Opt->key_desc = "name";
  700. Opt->required = NO;
  701. Opt->answer = "absolute";
  702. Opt->answer = "absolute,relative";
  703. Opt->description = _("The temporal type of the space time dataset");
  704. break;
  705. case G_OPT_T_WHERE:
  706. Opt->key = "t_where";
  707. Opt->type = TYPE_STRING;
  708. Opt->key_desc = "sql_query";
  709. Opt->required = NO;
  710. Opt->label = _("WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework");
  711. Opt->description = _("Example: start_time > '2001-01-01 12:30:00'");
  712. break;
  713. }
  714. return Opt;
  715. }
  716. /*!
  717. \brief Create standardised Flag structure.
  718. This function will create a standardised Flag structure defined by
  719. parameter <i>flag</i>. A list of valid parameters bellow. It
  720. allocates memory for the Flag structure and returns a pointer to
  721. this memory.
  722. If an invalid parameter was specified a empty Flag structure will be
  723. returned (not NULL).
  724. - G_FLG_DB_TABLE
  725. \param flag type of Flag struct to create
  726. \return pointer to an Flag struct
  727. */
  728. struct Flag *G_define_standard_flag(int flag)
  729. {
  730. struct Flag *Flg;
  731. Flg = G_define_flag();
  732. switch (flag) {
  733. case G_FLG_DB_TABLE:
  734. Flg->key = 't';
  735. Flg->description = _("Do not create attribute table");
  736. break;
  737. }
  738. return Flg;
  739. }