parser_standard_options.c 22 KB

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