17#include <grass/glocale.h>
19#include "parser_local_proto.h"
153 Opt->type = TYPE_STRING;
154 Opt->key_desc =
"sql_query";
156 Opt->label = _(
"SQL SELECT statement");
158 _(
"Example: select * from towns where population > 10000");
162 Opt->type = TYPE_STRING;
163 Opt->gisprompt =
"old,sql_query,sql_query";
164 Opt->key_desc =
"sql_query";
167 _(
"WHERE conditions of SQL statement without 'where' keyword");
168 Opt->description = _(
"Example: income < 1000 and population >= 10000");
172 Opt->type = TYPE_STRING;
173 Opt->key_desc =
"name";
176 Opt->description = _(
"Name of attribute table");
177 Opt->gisprompt =
"old,dbtable,dbtable";
179 case G_OPT_DB_DRIVER:
181 Opt->type = TYPE_STRING;
182 Opt->key_desc =
"name";
185 Opt->description = _(
"Name of database driver");
186 Opt->gisprompt =
"old,dbdriver,dbdriver";
188 case G_OPT_DB_DATABASE:
189 Opt->key =
"database";
190 Opt->type = TYPE_STRING;
191 Opt->key_desc =
"name";
194 Opt->description = _(
"Name of database");
195 Opt->gisprompt =
"old,dbname,dbname";
197 case G_OPT_DB_SCHEMA:
199 Opt->type = TYPE_STRING;
200 Opt->key_desc =
"name";
203 Opt->label = _(
"Database schema");
204 Opt->description = _(
"Do not use this option if schemas "
205 "are not supported by driver/database server");
207 case G_OPT_DB_COLUMN:
209 Opt->type = TYPE_STRING;
210 Opt->key_desc =
"name";
213 Opt->description = _(
"Name of attribute column");
214 Opt->gisprompt =
"old,dbcolumn,dbcolumn";
216 case G_OPT_DB_COLUMNS:
217 Opt->key =
"columns";
218 Opt->type = TYPE_STRING;
219 Opt->key_desc =
"name";
222 Opt->description = _(
"Name of attribute column(s)");
223 Opt->gisprompt =
"old,dbcolumn,dbcolumn";
225 case G_OPT_DB_KEYCOLUMN:
227 Opt->type = TYPE_STRING;
228 Opt->key_desc =
"name";
231 Opt->label = _(
"Name of key column");
232 Opt->description = _(
"Must refer to an integer column");
234 Opt->answer = GV_KEY_COLUMN;
240 Opt->type = TYPE_STRING;
241 Opt->key_desc =
"name";
243 Opt->gisprompt =
"old,group,group";
244 Opt->description = _(
"Name of input imagery group");
246 case G_OPT_I_SUBGROUP:
247 Opt->key =
"subgroup";
248 Opt->type = TYPE_STRING;
249 Opt->key_desc =
"name";
251 Opt->gisprompt =
"old,subgroup,subgroup";
252 Opt->description = _(
"Name of input imagery subgroup");
258 Opt->type = TYPE_INTEGER;
259 Opt->key_desc =
"memory in MB";
266 if (memstr && *memstr)
267 Opt->answer = memstr;
269 Opt->label = _(
"Maximum memory to be used (in MB)");
270 Opt->description = _(
"Cache size for raster rows");
274 Opt->type = TYPE_STRING;
275 Opt->key_desc =
"name";
277 Opt->gisprompt =
"old,cell,raster";
278 Opt->description = _(
"Name of input raster map");
282 Opt->type = TYPE_STRING;
283 Opt->key_desc =
"name";
286 Opt->gisprompt =
"old,cell,raster";
287 Opt->description = _(
"Name of input raster map(s)");
291 Opt->type = TYPE_STRING;
292 Opt->key_desc =
"name";
294 Opt->gisprompt =
"new,cell,raster";
295 Opt->description = _(
"Name for output raster map");
297 case G_OPT_R_OUTPUTS:
299 Opt->type = TYPE_STRING;
300 Opt->key_desc =
"name";
303 Opt->gisprompt =
"new,cell,raster";
304 Opt->description = _(
"Name for output raster map(s)");
308 Opt->type = TYPE_STRING;
309 Opt->key_desc =
"name";
311 Opt->gisprompt =
"old,cell,raster";
312 Opt->description = _(
"Name of raster map");
316 Opt->type = TYPE_STRING;
317 Opt->key_desc =
"name";
320 Opt->gisprompt =
"old,cell,raster";
321 Opt->description = _(
"Name of raster map(s)");
325 Opt->type = TYPE_STRING;
326 Opt->key_desc =
"name";
328 Opt->gisprompt =
"old,cell,raster";
329 Opt->description = _(
"Name of base raster map");
333 Opt->type = TYPE_STRING;
334 Opt->key_desc =
"name";
336 Opt->gisprompt =
"old,cell,raster";
337 Opt->description = _(
"Name of cover raster map");
340 Opt->key =
"elevation";
341 Opt->type = TYPE_STRING;
342 Opt->key_desc =
"name";
344 Opt->gisprompt =
"old,cell,raster";
345 Opt->description = _(
"Name of input elevation raster map");
348 Opt->key =
"elevation";
349 Opt->type = TYPE_STRING;
350 Opt->key_desc =
"name";
353 Opt->gisprompt =
"old,cell,raster";
354 Opt->description = _(
"Name of input elevation raster map(s)");
358 Opt->type = TYPE_STRING;
361 Opt->label = _(
"Type of raster map to be created");
362 Opt->description = _(
"Storage type for resultant raster map");
363 Opt->options =
"CELL,FCELL,DCELL";
364 G_asprintf((
char **)&(Opt->descriptions),
"CELL;%s;FCELL;%s;DCELL;%s",
365 _(
"Integer"), _(
"Single precision floating point"),
366 _(
"Double precision floating point"));
368 case G_OPT_R_INTERP_TYPE:
370 Opt->type = TYPE_STRING;
372 Opt->description = _(
"Sampling interpolation method");
373 Opt->options =
"nearest,bilinear,bicubic";
375 "nearest;%s;bilinear;%s;bicubic;%s",
376 _(
"Nearest-neighbor interpolation"),
377 _(
"Bilinear interpolation"), _(
"Bicubic interpolation"));
379 case G_OPT_R_BASENAME_INPUT:
381 Opt->type = TYPE_STRING;
382 Opt->key_desc =
"basename";
385 Opt->gisprompt =
"old,cell,raster";
386 Opt->description = _(
"Name of input basename raster map(s)");
388 case G_OPT_R_BASENAME_OUTPUT:
390 Opt->type = TYPE_STRING;
391 Opt->key_desc =
"basename";
394 Opt->gisprompt =
"new,cell,raster";
395 Opt->description = _(
"Name for output basename raster map(s)");
401 Opt->type = TYPE_STRING;
402 Opt->key_desc =
"name";
404 Opt->gisprompt =
"old,grid3,raster_3d";
405 Opt->description = _(
"Name of input 3D raster map");
407 case G_OPT_R3_INPUTS:
409 Opt->type = TYPE_STRING;
410 Opt->key_desc =
"name";
413 Opt->gisprompt =
"old,grid3,raster_3d";
414 Opt->description = _(
"Name of input 3D raster map(s)");
416 case G_OPT_R3_OUTPUT:
418 Opt->type = TYPE_STRING;
419 Opt->key_desc =
"name";
421 Opt->gisprompt =
"new,grid3,raster_3d";
422 Opt->description = _(
"Name for output 3D raster map");
426 Opt->type = TYPE_STRING;
427 Opt->key_desc =
"name";
429 Opt->gisprompt =
"old,grid3,raster_3d";
430 Opt->description = _(
"Name of 3D raster map");
434 Opt->type = TYPE_STRING;
435 Opt->key_desc =
"name";
438 Opt->gisprompt =
"old,grid3,raster_3d";
439 Opt->description = _(
"Name of 3D raster map(s)");
443 Opt->type = TYPE_STRING;
446 Opt->answer =
"default";
447 Opt->options =
"default,double,float";
448 Opt->description = _(
"Data type used in the output raster3d map");
450 case G_OPT_R3_PRECISION:
451 Opt->key =
"precision";
452 Opt->type = TYPE_STRING;
455 Opt->answer =
"default";
457 _(
"Number of digits used as mantissa in the internal map storage, "
458 "0 -23 for float, 0 - 52 for double, max or default");
460 case G_OPT_R3_COMPRESSION:
461 Opt->key =
"compression";
462 Opt->type = TYPE_STRING;
465 Opt->answer =
"default";
466 Opt->options =
"default,zip,none";
468 _(
"The compression method used in the output raster3d map");
470 case G_OPT_R3_TILE_DIMENSION:
471 Opt->key =
"tiledimension";
472 Opt->type = TYPE_STRING;
475 Opt->key_desc =
"XxYxZ";
476 Opt->answer =
"default";
477 Opt->description = _(
"The dimensions of the tiles used in the output "
478 "raster3d map (XxYxZ or default: 16x16x8)");
484 Opt->type = TYPE_STRING;
485 Opt->key_desc =
"name";
487 Opt->gisprompt =
"old,vector,vector";
488 Opt->label = _(
"Name of input vector map");
489 Opt->description = _(
"Or data source for direct OGR access");
493 Opt->type = TYPE_STRING;
494 Opt->key_desc =
"name";
497 Opt->gisprompt =
"old,vector,vector";
498 Opt->label = _(
"Name of input vector map(s)");
499 Opt->description = _(
"Or data source(s) for direct OGR access");
503 Opt->type = TYPE_STRING;
504 Opt->key_desc =
"name";
506 Opt->gisprompt =
"new,vector,vector";
507 Opt->description = _(
"Name for output vector map");
511 Opt->type = TYPE_STRING;
512 Opt->key_desc =
"name";
514 Opt->gisprompt =
"old,vector,vector";
515 Opt->label = _(
"Name of vector map");
516 Opt->description = _(
"Or data source for direct OGR access");
520 Opt->type = TYPE_STRING;
521 Opt->key_desc =
"name";
524 Opt->gisprompt =
"old,vector,vector";
525 Opt->description = _(
"Name of vector map(s)");
529 Opt->type = TYPE_STRING;
532 Opt->answer =
"point,line,boundary,centroid,area";
533 Opt->options =
"point,line,boundary,centroid,area";
534 Opt->description = _(
"Input feature type");
538 Opt->type = TYPE_STRING;
541 Opt->answer =
"point,line,boundary,centroid,area,face,kernel";
542 Opt->options =
"point,line,boundary,centroid,area,face,kernel";
543 Opt->description = _(
"Input feature type");
547 Opt->type = TYPE_STRING;
550 Opt->label = _(
"Layer number or name");
552 _(
"Vector features can have category values in different layers."
553 " This number determines which layer to use. "
554 "When used with direct OGR access this is the layer name.");
555 Opt->gisprompt =
"old,layer,layer";
557 case G_OPT_V_FIELD_ALL:
559 Opt->type = TYPE_STRING;
562 Opt->label = _(
"Layer number or name ('-1' for all layers)");
564 _(
"A single vector map can be connected to multiple database "
565 "tables. This number determines which table to use. "
566 "When used with direct OGR access this is the layer name.");
567 Opt->gisprompt =
"old,layer_all,layer";
571 Opt->type = TYPE_INTEGER;
573 Opt->description = _(
"Category value");
574 Opt->gisprompt =
"old,cat,cats";
578 Opt->type = TYPE_STRING;
579 Opt->key_desc =
"range";
581 Opt->label = _(
"Category values");
582 Opt->description = _(
"Example: 1,3,7-9,13");
583 Opt->gisprompt =
"old,cats,cats";
587 Opt->type = TYPE_INTEGER;
589 Opt->description = _(
"Feature id");
593 Opt->type = TYPE_STRING;
594 Opt->key_desc =
"range";
596 Opt->label = _(
"Feature ids");
597 Opt->description = _(
"Example: 1,3,7-9,13");
603 Opt->type = TYPE_STRING;
604 Opt->key_desc =
"name";
606 Opt->gisprompt =
"old,file,file";
607 Opt->description = _(
"Name of input file");
609 case G_OPT_F_BIN_INPUT:
611 Opt->type = TYPE_STRING;
612 Opt->key_desc =
"name";
614 Opt->gisprompt =
"old,bin,file";
615 Opt->description = _(
"Name of input file");
619 Opt->type = TYPE_STRING;
620 Opt->key_desc =
"name";
622 Opt->gisprompt =
"new,file,file";
623 Opt->description = _(
"Name for output file");
626 Opt->key =
"separator";
627 Opt->type = TYPE_STRING;
628 Opt->key_desc =
"character";
630 Opt->gisprompt =
"old,separator,separator";
631 Opt->answer =
"pipe";
632 Opt->label = _(
"Field separator");
634 _(
"Special characters: pipe, comma, space, tab, newline");
638 Opt->type = TYPE_STRING;
639 Opt->key_desc =
"name";
641 Opt->label = _(
"Output format");
642 Opt->answer =
"plain";
643 Opt->options =
"plain,json";
644 Opt->descriptions = _(
"plain;Plain text output;"
645 "json;JSON (JavaScript Object Notation);");
651 Opt->type = TYPE_STRING;
652 Opt->key_desc =
"name";
654 Opt->answer = DEFAULT_FG_COLOR;
655 Opt->gisprompt =
"old,color,color";
656 Opt->label = _(
"Color");
657 Opt->description = _(
"Either a standard color name or R:G:B triplet");
661 Opt->type = TYPE_STRING;
662 Opt->key_desc =
"name";
664 Opt->answer = DEFAULT_FG_COLOR;
665 Opt->gisprompt =
"old,color_none,color";
666 Opt->label = _(
"Color");
668 _(
"Either a standard color name, R:G:B triplet, or \"none\"");
671 Opt->key =
"color_format";
672 Opt->type = TYPE_STRING;
673 Opt->key_desc =
"name";
677 Opt->options =
"rgb,hex,hsv,triplet";
678 Opt->label = _(
"Color format");
679 Opt->description = _(
"Color format for output values.");
681 (
char **)&(Opt->descriptions),
"rgb;%s;hex;%s;hsv;%s;triplet;%s",
682 _(
"output color in RGB format"), _(
"output color in HEX format"),
683 _(
"output color in HSV format (experimental)"),
684 _(
"output color in colon-separated RGB format"));
691 Opt->type = TYPE_STRING;
692 Opt->key_desc =
"name";
694 Opt->gisprompt =
"old,dir,dir";
695 Opt->description = _(
"Name of input directory");
700 Opt->type = TYPE_STRING;
703 Opt->options =
"miles,feet,meters,kilometers,acres,hectares";
704 Opt->description = _(
"Units");
707 case G_OPT_M_DATATYPE:
709 Opt->key_desc =
"datatype";
710 Opt->type = TYPE_STRING;
713 Opt->description = _(
"Data type(s)");
718 Opt->type = TYPE_STRING;
721 Opt->key_desc =
"name";
722 Opt->gisprompt =
"old,mapset,mapset";
723 Opt->label = _(
"Name of mapset (default: current search path)");
724 Opt->description = _(
"'.' for current mapset");
727 case G_OPT_M_LOCATION:
728 Opt->key =
"project";
729 Opt->type = TYPE_STRING;
732 Opt->label = _(
"Project (location) name");
733 Opt->description = _(
"Project name (not path to project)");
734 Opt->gisprompt =
"old,location,location";
735 Opt->key_desc =
"name";
740 Opt->type = TYPE_STRING;
743 Opt->label = _(
"GRASS database directory");
744 Opt->description = _(
"Default: path to the current GRASS database");
745 Opt->gisprompt =
"old,dbase,dbase";
746 Opt->key_desc =
"path";
750 Opt->key =
"coordinates";
751 Opt->type = TYPE_DOUBLE;
754 Opt->key_desc =
"east,north";
755 Opt->gisprompt =
"old,coords,coords";
756 Opt->description = _(
"Coordinates");
761 Opt->key_desc =
"style";
762 Opt->type = TYPE_STRING;
765 Opt->description = _(
"Name of color table");
767 Opt->gisprompt =
"old,colortable,colortable";
770 case G_OPT_M_NULL_VALUE:
771 Opt->key =
"null_value";
772 Opt->key_desc =
"string";
773 Opt->type = TYPE_STRING;
776 Opt->description = _(
"String representing NULL value");
781 Opt->type = TYPE_STRING;
782 Opt->key_desc =
"name";
784 Opt->gisprompt =
"old,windows,region";
785 Opt->description = _(
"Name of saved region");
790 Opt->type = TYPE_INTEGER;
797 if (memstr && *memstr)
798 Opt->answer = memstr;
800 Opt->label = _(
"Number of threads for parallel computing");
801 Opt->description = _(
"0: use OpenMP default; >0: use nprocs; "
802 "<0: use MAX-nprocs");
807 Opt->type = TYPE_INTEGER;
809 Opt->label = _(
"Seed value for the random number generator");
811 _(
"Using the same seed ensures identical results, "
812 "while a randomly generated seed produces different outcomes "
817 case G_OPT_STDS_INPUT:
819 Opt->type = TYPE_STRING;
820 Opt->key_desc =
"name";
822 Opt->gisprompt =
"old,stds,stds";
823 Opt->description = _(
"Name of the input space time dataset");
825 case G_OPT_STDS_INPUTS:
827 Opt->type = TYPE_STRING;
828 Opt->key_desc =
"name";
831 Opt->gisprompt =
"old,stds,stds";
832 Opt->description = _(
"Name of the input space time datasets");
834 case G_OPT_STDS_OUTPUT:
836 Opt->type = TYPE_STRING;
837 Opt->key_desc =
"name";
839 Opt->gisprompt =
"new,stds,stds";
840 Opt->description = _(
"Name of the output space time dataset");
842 case G_OPT_STRDS_INPUT:
844 Opt->type = TYPE_STRING;
845 Opt->key_desc =
"name";
847 Opt->gisprompt =
"old,strds,strds";
848 Opt->description = _(
"Name of the input space time raster dataset");
850 case G_OPT_STRDS_INPUTS:
852 Opt->type = TYPE_STRING;
853 Opt->key_desc =
"name";
856 Opt->gisprompt =
"old,strds,strds";
857 Opt->description = _(
"Name of the input space time raster datasets");
859 case G_OPT_STRDS_OUTPUT:
861 Opt->type = TYPE_STRING;
862 Opt->key_desc =
"name";
864 Opt->gisprompt =
"new,strds,strds";
865 Opt->description = _(
"Name of the output space time raster dataset");
867 case G_OPT_STRDS_OUTPUTS:
868 Opt->key =
"outputs";
869 Opt->type = TYPE_STRING;
870 Opt->key_desc =
"name";
873 Opt->gisprompt =
"new,strds,strds";
874 Opt->description = _(
"Name of the output space time raster datasets");
876 case G_OPT_STVDS_INPUT:
878 Opt->type = TYPE_STRING;
879 Opt->key_desc =
"name";
881 Opt->gisprompt =
"old,stvds,stvds";
882 Opt->description = _(
"Name of the input space time vector dataset");
884 case G_OPT_STVDS_INPUTS:
886 Opt->type = TYPE_STRING;
887 Opt->key_desc =
"name";
890 Opt->gisprompt =
"old,stvds,stvds";
891 Opt->description = _(
"Name of the input space time vector datasets");
893 case G_OPT_STVDS_OUTPUT:
895 Opt->type = TYPE_STRING;
896 Opt->key_desc =
"name";
898 Opt->gisprompt =
"new,stvds,stvds";
899 Opt->description = _(
"Name of the output space time vector dataset");
901 case G_OPT_STR3DS_INPUT:
903 Opt->type = TYPE_STRING;
904 Opt->key_desc =
"name";
906 Opt->gisprompt =
"old,str3ds,str3ds";
907 Opt->description = _(
"Name of the input space time raster3d dataset");
909 case G_OPT_STR3DS_INPUTS:
911 Opt->type = TYPE_STRING;
912 Opt->key_desc =
"name";
915 Opt->gisprompt =
"old,str3ds,str3ds";
916 Opt->description = _(
"Name of the input space time raster3d datasets");
918 case G_OPT_STR3DS_OUTPUT:
920 Opt->type = TYPE_STRING;
921 Opt->key_desc =
"name";
923 Opt->gisprompt =
"new,str3ds,str3ds";
924 Opt->description = _(
"Name of the output space time raster3d dataset");
926 case G_OPT_STDS_TYPE:
928 Opt->type = TYPE_STRING;
929 Opt->key_desc =
"name";
931 Opt->answer =
"strds";
932 Opt->options =
"strds,stvds,str3ds";
933 Opt->description = _(
"Type of the input space time dataset");
935 case G_OPT_MAP_INPUT:
937 Opt->type = TYPE_STRING;
938 Opt->key_desc =
"name";
940 Opt->gisprompt =
"old,map,map";
941 Opt->description = _(
"Name of the input map");
943 case G_OPT_MAP_INPUTS:
945 Opt->type = TYPE_STRING;
946 Opt->key_desc =
"name";
949 Opt->gisprompt =
"old,map,map";
950 Opt->description = _(
"Name of the input maps");
954 Opt->type = TYPE_STRING;
955 Opt->key_desc =
"name";
957 Opt->answer =
"raster";
958 Opt->options =
"raster,vector,raster_3d";
959 Opt->description = _(
"Type of the input map");
963 Opt->type = TYPE_STRING;
964 Opt->key_desc =
"name";
966 Opt->answer =
"gran";
967 Opt->description = _(
"Suffix to add at basename: set "
968 "'gran' for granularity, "
969 "'time' for the full time format, "
970 "'num' for numerical suffix with "
971 "a specific number of digits (default %%05)");
974 Opt->key =
"temporaltype";
975 Opt->type = TYPE_STRING;
976 Opt->key_desc =
"name";
978 Opt->answer =
"absolute";
979 Opt->options =
"absolute,relative";
980 Opt->description = _(
"The temporal type of the space time dataset");
984 Opt->type = TYPE_STRING;
985 Opt->key_desc =
"sql_query";
987 Opt->label = _(
"WHERE conditions of SQL statement without 'where' "
988 "keyword used in the temporal GIS framework");
989 Opt->description = _(
"Example: start_time > '2001-01-01 12:30:00'");
992 Opt->key =
"sampling";
993 Opt->type = TYPE_STRING;
994 Opt->key_desc =
"name";
997 Opt->answer =
"start";
998 Opt->options =
"start,during,overlap,contain,equal,follows,precedes";
1000 _(
"The method to be used for sampling the input dataset");
1034 Flg->description = _(
"Do not create attribute table");
1038 Flg->label = _(
"Do not build topology");
1040 _(
"Advantageous when handling a large number of points");
int G_asprintf(char **out, const char *fmt,...)
char * G_color_rules_description_type(void)
Get color rules description for Option->descriptions.
char * G_color_rules_options(void)
Get list of color rules for Option->options.
const char * G_getenv_nofatal(const char *name)
Get environment variable.
struct Flag * G_define_flag(void)
Initializes a Flag struct.
struct Option * G_define_option(void)
Initializes an Option struct.
struct Option * G_define_standard_option(int opt)
Create standardised Option structure.
struct Flag * G_define_standard_flag(int flag)
Create standardised Flag structure.
char * G_store(const char *s)
Copy string to allocated memory.