16 #include <grass/gis.h>
17 #include <grass/glocale.h>
19 #include "parser_local_proto.h"
149 Opt->type = TYPE_STRING;
150 Opt->key_desc =
"sql_query";
152 Opt->label = _(
"SQL SELECT statement");
154 _(
"Example: select * from towns where population > 10000");
158 Opt->type = TYPE_STRING;
159 Opt->gisprompt =
"old,sql_query,sql_query";
160 Opt->key_desc =
"sql_query";
162 Opt->label = _(
"WHERE conditions of SQL statement without 'where' keyword");
163 Opt->description = _(
"Example: income < 1000 and population >= 10000");
167 Opt->type = TYPE_STRING;
168 Opt->key_desc =
"name";
171 Opt->description = _(
"Name of attribute table");
172 Opt->gisprompt =
"old,dbtable,dbtable";
174 case G_OPT_DB_DRIVER:
176 Opt->type = TYPE_STRING;
177 Opt->key_desc =
"name";
180 Opt->description = _(
"Name of database driver");
181 Opt->gisprompt =
"old,dbdriver,dbdriver";
183 case G_OPT_DB_DATABASE:
184 Opt->key =
"database";
185 Opt->type = TYPE_STRING;
186 Opt->key_desc =
"name";
189 Opt->description = _(
"Name of database");
190 Opt->gisprompt =
"old,dbname,dbname";
192 case G_OPT_DB_SCHEMA:
194 Opt->type = TYPE_STRING;
195 Opt->key_desc =
"name";
198 Opt->label = _(
"Database schema");
199 Opt->description = _(
"Do not use this option if schemas "
200 "are not supported by driver/database server");
202 case G_OPT_DB_COLUMN:
204 Opt->type = TYPE_STRING;
205 Opt->key_desc =
"name";
208 Opt->description = _(
"Name of attribute column");
209 Opt->gisprompt =
"old,dbcolumn,dbcolumn";
211 case G_OPT_DB_COLUMNS:
212 Opt->key =
"columns";
213 Opt->type = TYPE_STRING;
214 Opt->key_desc =
"name";
217 Opt->description = _(
"Name of attribute column(s)");
218 Opt->gisprompt =
"old,dbcolumn,dbcolumn";
220 case G_OPT_DB_KEYCOLUMN:
222 Opt->type = TYPE_STRING;
223 Opt->key_desc =
"name";
226 Opt->label = _(
"Name of key column");
227 Opt->description = _(
"Must refer to an integer column");
229 Opt->answer = GV_KEY_COLUMN;
235 Opt->type = TYPE_STRING;
236 Opt->key_desc =
"name";
238 Opt->gisprompt =
"old,group,group";
239 Opt->description = _(
"Name of input imagery group");
241 case G_OPT_I_SUBGROUP:
242 Opt->key =
"subgroup";
243 Opt->type = TYPE_STRING;
244 Opt->key_desc =
"name";
246 Opt->gisprompt =
"old,subgroup,subgroup";
247 Opt->description = _(
"Name of input imagery subgroup");
253 Opt->type = TYPE_INTEGER;
254 Opt->key_desc =
"memory in MB";
261 if (memstr && *memstr)
262 Opt->answer = memstr;
264 Opt->label = _(
"Maximum memory to be used (in MB)");
265 Opt->description = _(
"Cache size for raster rows");
269 Opt->type = TYPE_STRING;
270 Opt->key_desc =
"name";
272 Opt->gisprompt =
"old,cell,raster";
273 Opt->description = _(
"Name of input raster map");
277 Opt->type = TYPE_STRING;
278 Opt->key_desc =
"name";
281 Opt->gisprompt =
"old,cell,raster";
282 Opt->description = _(
"Name of input raster map(s)");
286 Opt->type = TYPE_STRING;
287 Opt->key_desc =
"name";
289 Opt->gisprompt =
"new,cell,raster";
290 Opt->description = _(
"Name for output raster map");
292 case G_OPT_R_OUTPUTS:
294 Opt->type = TYPE_STRING;
295 Opt->key_desc =
"name";
298 Opt->gisprompt =
"new,cell,raster";
299 Opt->description = _(
"Name for output raster map(s)");
303 Opt->type = TYPE_STRING;
304 Opt->key_desc =
"name";
306 Opt->gisprompt =
"old,cell,raster";
307 Opt->description = _(
"Name of raster map");
311 Opt->type = TYPE_STRING;
312 Opt->key_desc =
"name";
315 Opt->gisprompt =
"old,cell,raster";
316 Opt->description = _(
"Name of raster map(s)");
320 Opt->type = TYPE_STRING;
321 Opt->key_desc =
"name";
323 Opt->gisprompt =
"old,cell,raster";
324 Opt->description = _(
"Name of base raster map");
328 Opt->type = TYPE_STRING;
329 Opt->key_desc =
"name";
331 Opt->gisprompt =
"old,cell,raster";
332 Opt->description = _(
"Name of cover raster map");
335 Opt->key =
"elevation";
336 Opt->type = TYPE_STRING;
337 Opt->key_desc =
"name";
339 Opt->gisprompt =
"old,cell,raster";
340 Opt->description = _(
"Name of input elevation raster map");
343 Opt->key =
"elevation";
344 Opt->type = TYPE_STRING;
345 Opt->key_desc =
"name";
348 Opt->gisprompt =
"old,cell,raster";
349 Opt->description = _(
"Name of input elevation raster map(s)");
353 Opt->type = TYPE_STRING;
356 Opt->label = _(
"Type of raster map to be created");
357 Opt->description = _(
"Storage type for resultant raster map");
358 Opt->options =
"CELL,FCELL,DCELL";
360 "CELL;%s;FCELL;%s;DCELL;%s",
362 _(
"Single precision floating point"),
363 _(
"Double precision floating point"));
365 case G_OPT_R_INTERP_TYPE:
367 Opt->type = TYPE_STRING;
369 Opt->description = _(
"Sampling interpolation method");
370 Opt->options =
"nearest,bilinear,bicubic";
372 "nearest;%s;bilinear;%s;bicubic;%s",
373 _(
"Nearest-neighbor interpolation"),
374 _(
"Bilinear interpolation"),
375 _(
"Bicubic interpolation"));
377 case G_OPT_R_BASENAME_INPUT:
379 Opt->type = TYPE_STRING;
380 Opt->key_desc =
"basename";
383 Opt->gisprompt =
"old,cell,raster";
384 Opt->description = _(
"Name of input basename raster map(s)");
386 case G_OPT_R_BASENAME_OUTPUT:
388 Opt->type = TYPE_STRING;
389 Opt->key_desc =
"basename";
392 Opt->gisprompt =
"new,cell,raster";
393 Opt->description = _(
"Name for output basename raster map(s)");
399 Opt->type = TYPE_STRING;
400 Opt->key_desc =
"name";
402 Opt->gisprompt =
"old,grid3,raster_3d";
403 Opt->description = _(
"Name of input 3D raster map");
405 case G_OPT_R3_INPUTS:
407 Opt->type = TYPE_STRING;
408 Opt->key_desc =
"name";
411 Opt->gisprompt =
"old,grid3,raster_3d";
412 Opt->description = _(
"Name of input 3D raster map(s)");
414 case G_OPT_R3_OUTPUT:
416 Opt->type = TYPE_STRING;
417 Opt->key_desc =
"name";
419 Opt->gisprompt =
"new,grid3,raster_3d";
420 Opt->description = _(
"Name for output 3D raster map");
424 Opt->type = TYPE_STRING;
425 Opt->key_desc =
"name";
427 Opt->gisprompt =
"old,grid3,raster_3d";
428 Opt->description = _(
"Name of 3D raster map");
432 Opt->type = TYPE_STRING;
433 Opt->key_desc =
"name";
436 Opt->gisprompt =
"old,grid3,raster_3d";
437 Opt->description = _(
"Name of 3D raster map(s)");
441 Opt->type = TYPE_STRING;
444 Opt->answer =
"default";
445 Opt->options =
"default,double,float";
446 Opt->description = _(
"Data type used in the output raster3d map");
448 case G_OPT_R3_PRECISION:
449 Opt->key =
"precision";
450 Opt->type = TYPE_STRING;
453 Opt->answer =
"default";
455 _(
"Number of digits used as mantissa in the internal map storage, 0 -23 for float, 0 - 52 for double, max or default");
457 case G_OPT_R3_COMPRESSION:
458 Opt->key =
"compression";
459 Opt->type = TYPE_STRING;
462 Opt->answer =
"default";
463 Opt->options =
"default,zip,none";
465 _(
"The compression method used in the output raster3d map");
467 case G_OPT_R3_TILE_DIMENSION:
468 Opt->key =
"tiledimension";
469 Opt->type = TYPE_STRING;
472 Opt->key_desc =
"XxYxZ";
473 Opt->answer =
"default";
475 _(
"The dimensions of the tiles used in the output raster3d map (XxYxZ or default: 16x16x8)");
481 Opt->type = TYPE_STRING;
482 Opt->key_desc =
"name";
484 Opt->gisprompt =
"old,vector,vector";
485 Opt->label = _(
"Name of input vector map");
486 Opt->description = _(
"Or data source for direct OGR access");
490 Opt->type = TYPE_STRING;
491 Opt->key_desc =
"name";
494 Opt->gisprompt =
"old,vector,vector";
495 Opt->label = _(
"Name of input vector map(s)");
496 Opt->description = _(
"Or data source(s) for direct OGR access");
500 Opt->type = TYPE_STRING;
501 Opt->key_desc =
"name";
503 Opt->gisprompt =
"new,vector,vector";
504 Opt->description = _(
"Name for output vector map");
508 Opt->type = TYPE_STRING;
509 Opt->key_desc =
"name";
511 Opt->gisprompt =
"old,vector,vector";
512 Opt->label = _(
"Name of vector map");
513 Opt->description = _(
"Or data source for direct OGR access");
517 Opt->type = TYPE_STRING;
518 Opt->key_desc =
"name";
521 Opt->gisprompt =
"old,vector,vector";
522 Opt->description = _(
"Name of vector map(s)");
526 Opt->type = TYPE_STRING;
529 Opt->answer =
"point,line,boundary,centroid,area";
530 Opt->options =
"point,line,boundary,centroid,area";
531 Opt->description = _(
"Input feature type");
535 Opt->type = TYPE_STRING;
538 Opt->answer =
"point,line,boundary,centroid,area,face,kernel";
539 Opt->options =
"point,line,boundary,centroid,area,face,kernel";
540 Opt->description = _(
"Input feature type");
544 Opt->type = TYPE_STRING;
547 Opt->label = _(
"Layer number or name");
549 _(
"Vector features can have category values in different layers."
550 " This number determines which layer to use. "
551 "When used with direct OGR access this is the layer name.");
552 Opt->gisprompt =
"old,layer,layer";
554 case G_OPT_V_FIELD_ALL:
556 Opt->type = TYPE_STRING;
559 Opt->label = _(
"Layer number or name ('-1' for all layers)");
561 _(
"A single vector map can be connected to multiple database "
562 "tables. This number determines which table to use. "
563 "When used with direct OGR access this is the layer name.");
564 Opt->gisprompt =
"old,layer_all,layer";
568 Opt->type = TYPE_INTEGER;
570 Opt->description = _(
"Category value");
571 Opt->gisprompt =
"old,cat,cats";
575 Opt->type = TYPE_STRING;
576 Opt->key_desc =
"range";
578 Opt->label = _(
"Category values");
579 Opt->description = _(
"Example: 1,3,7-9,13");
580 Opt->gisprompt =
"old,cats,cats";
584 Opt->type = TYPE_INTEGER;
586 Opt->description = _(
"Feature id");
590 Opt->type = TYPE_STRING;
591 Opt->key_desc =
"range";
593 Opt->label = _(
"Feature ids");
594 Opt->description = _(
"Example: 1,3,7-9,13");
600 Opt->type = TYPE_STRING;
601 Opt->key_desc =
"name";
603 Opt->gisprompt =
"old,file,file";
604 Opt->description = _(
"Name of input file");
606 case G_OPT_F_BIN_INPUT:
608 Opt->type = TYPE_STRING;
609 Opt->key_desc =
"name";
611 Opt->gisprompt =
"old,bin,file";
612 Opt->description = _(
"Name of input file");
616 Opt->type = TYPE_STRING;
617 Opt->key_desc =
"name";
619 Opt->gisprompt =
"new,file,file";
620 Opt->description = _(
"Name for output file");
623 Opt->key =
"separator";
624 Opt->type = TYPE_STRING;
625 Opt->key_desc =
"character";
627 Opt->gisprompt =
"old,separator,separator";
628 Opt->answer =
"pipe";
629 Opt->label = _(
"Field separator");
630 Opt->description = _(
"Special characters: pipe, comma, space, tab, newline");
636 Opt->type = TYPE_STRING;
637 Opt->key_desc =
"name";
639 Opt->answer = DEFAULT_FG_COLOR;
640 Opt->gisprompt =
"old,color,color";
641 Opt->label = _(
"Color");
643 _(
"Either a standard color name or R:G:B triplet");
647 Opt->type = TYPE_STRING;
648 Opt->key_desc =
"name";
650 Opt->answer = DEFAULT_FG_COLOR;
651 Opt->gisprompt =
"old,color_none,color";
652 Opt->label = _(
"Color");
654 _(
"Either a standard color name, R:G:B triplet, or \"none\"");
661 Opt->type = TYPE_STRING;
662 Opt->key_desc =
"name";
664 Opt->gisprompt =
"old,dir,dir";
665 Opt->description = _(
"Name of input directory");
670 Opt->type = TYPE_STRING;
674 "miles,feet,meters,kilometers,acres,hectares";
675 Opt->description = _(
"Units");
678 case G_OPT_M_DATATYPE:
680 Opt->key_desc =
"datatype";
681 Opt->type = TYPE_STRING;
684 Opt->description = _(
"Data type(s)");
689 Opt->type = TYPE_STRING;
692 Opt->key_desc =
"name";
693 Opt->gisprompt =
"old,mapset,mapset";
694 Opt->label = _(
"Name of mapset (default: current search path)");
695 Opt->description = _(
"'.' for current mapset");
698 case G_OPT_M_LOCATION:
699 Opt->key =
"location";
700 Opt->type = TYPE_STRING;
703 Opt->label = _(
"Location name");
704 Opt->description = _(
"Location name (not location path)");
705 Opt->gisprompt =
"old,location,location";
706 Opt->key_desc =
"name";
711 Opt->type = TYPE_STRING;
714 Opt->label = _(
"GRASS GIS database directory");
715 Opt->description = _(
"Default: path to the current GRASS GIS database");
716 Opt->gisprompt =
"old,dbase,dbase";
717 Opt->key_desc =
"path";
721 Opt->key =
"coordinates";
722 Opt->type = TYPE_DOUBLE;
725 Opt->key_desc =
"east,north";
726 Opt->gisprompt =
"old,coords,coords";
727 Opt->description = _(
"Coordinates");
732 Opt->key_desc =
"style";
733 Opt->type = TYPE_STRING;
736 Opt->description = _(
"Name of color table");
738 Opt->gisprompt =
"old,colortable,colortable";
741 case G_OPT_M_NULL_VALUE:
742 Opt->key =
"null_value";
743 Opt->key_desc =
"string";
744 Opt->type = TYPE_STRING;
747 Opt->description = _(
"String representing NULL value");
752 Opt->type = TYPE_STRING;
753 Opt->key_desc =
"name";
755 Opt->gisprompt =
"old,windows,region";
756 Opt->description = _(
"Name of saved region");
761 Opt->type = TYPE_INTEGER;
768 if (memstr && *memstr)
769 Opt->answer = memstr;
771 Opt->description = _(
"Number of threads for parallel computing");
775 case G_OPT_STDS_INPUT:
777 Opt->type = TYPE_STRING;
778 Opt->key_desc =
"name";
780 Opt->gisprompt =
"old,stds,stds";
781 Opt->description = _(
"Name of the input space time dataset");
783 case G_OPT_STDS_INPUTS:
785 Opt->type = TYPE_STRING;
786 Opt->key_desc =
"name";
789 Opt->gisprompt =
"old,stds,stds";
790 Opt->description = _(
"Name of the input space time datasets");
792 case G_OPT_STDS_OUTPUT:
794 Opt->type = TYPE_STRING;
795 Opt->key_desc =
"name";
797 Opt->gisprompt =
"new,stds,stds";
798 Opt->description = _(
"Name of the output space time dataset");
800 case G_OPT_STRDS_INPUT:
802 Opt->type = TYPE_STRING;
803 Opt->key_desc =
"name";
805 Opt->gisprompt =
"old,strds,strds";
806 Opt->description = _(
"Name of the input space time raster dataset");
808 case G_OPT_STRDS_INPUTS:
810 Opt->type = TYPE_STRING;
811 Opt->key_desc =
"name";
814 Opt->gisprompt =
"old,strds,strds";
815 Opt->description = _(
"Name of the input space time raster datasets");
817 case G_OPT_STRDS_OUTPUT:
819 Opt->type = TYPE_STRING;
820 Opt->key_desc =
"name";
822 Opt->gisprompt =
"new,strds,strds";
823 Opt->description = _(
"Name of the output space time raster dataset");
825 case G_OPT_STRDS_OUTPUTS:
826 Opt->key =
"outputs";
827 Opt->type = TYPE_STRING;
828 Opt->key_desc =
"name";
831 Opt->gisprompt =
"new,strds,strds";
832 Opt->description = _(
"Name of the output space time raster datasets");
834 case G_OPT_STVDS_INPUT:
836 Opt->type = TYPE_STRING;
837 Opt->key_desc =
"name";
839 Opt->gisprompt =
"old,stvds,stvds";
840 Opt->description = _(
"Name of the input space time vector dataset");
842 case G_OPT_STVDS_INPUTS:
844 Opt->type = TYPE_STRING;
845 Opt->key_desc =
"name";
848 Opt->gisprompt =
"old,stvds,stvds";
849 Opt->description = _(
"Name of the input space time vector datasets");
851 case G_OPT_STVDS_OUTPUT:
853 Opt->type = TYPE_STRING;
854 Opt->key_desc =
"name";
856 Opt->gisprompt =
"new,stvds,stvds";
857 Opt->description = _(
"Name of the output space time vector dataset");
859 case G_OPT_STR3DS_INPUT:
861 Opt->type = TYPE_STRING;
862 Opt->key_desc =
"name";
864 Opt->gisprompt =
"old,str3ds,str3ds";
865 Opt->description = _(
"Name of the input space time raster3d dataset");
867 case G_OPT_STR3DS_INPUTS:
869 Opt->type = TYPE_STRING;
870 Opt->key_desc =
"name";
873 Opt->gisprompt =
"old,str3ds,str3ds";
874 Opt->description = _(
"Name of the input space time raster3d datasets");
876 case G_OPT_STR3DS_OUTPUT:
878 Opt->type = TYPE_STRING;
879 Opt->key_desc =
"name";
881 Opt->gisprompt =
"new,str3ds,str3ds";
882 Opt->description = _(
"Name of the output space time raster3d dataset");
884 case G_OPT_STDS_TYPE:
886 Opt->type = TYPE_STRING;
887 Opt->key_desc =
"name";
889 Opt->answer =
"strds";
890 Opt->options =
"strds,stvds,str3ds";
891 Opt->description = _(
"Type of the input space time dataset");
893 case G_OPT_MAP_INPUT:
895 Opt->type = TYPE_STRING;
896 Opt->key_desc =
"name";
898 Opt->gisprompt =
"old,map,map";
899 Opt->description = _(
"Name of the input map");
901 case G_OPT_MAP_INPUTS:
903 Opt->type = TYPE_STRING;
904 Opt->key_desc =
"name";
907 Opt->gisprompt =
"old,map,map";
908 Opt->description = _(
"Name of the input maps");
912 Opt->type = TYPE_STRING;
913 Opt->key_desc =
"name";
915 Opt->answer =
"raster";
916 Opt->options =
"raster,vector,raster_3d";
917 Opt->description = _(
"Type of the input map");
920 Opt->key =
"temporaltype";
921 Opt->type = TYPE_STRING;
922 Opt->key_desc =
"name";
924 Opt->answer =
"absolute";
925 Opt->options =
"absolute,relative";
926 Opt->description = _(
"The temporal type of the space time dataset");
930 Opt->type = TYPE_STRING;
931 Opt->key_desc =
"sql_query";
933 Opt->label = _(
"WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework");
934 Opt->description = _(
"Example: start_time > '2001-01-01 12:30:00'");
937 Opt->key =
"sampling";
938 Opt->type = TYPE_STRING;
939 Opt->key_desc =
"name";
942 Opt->answer =
"start";
943 Opt->options =
"start,during,overlap,contain,equal,follows,precedes";
944 Opt->description = _(
"The method to be used for sampling the input dataset");
978 Flg->description = _(
"Do not create attribute table");
982 Flg->label = _(
"Do not build topology");
983 Flg->description = _(
"Advantageous when handling a large number of points");
int G_asprintf(char **out, const char *fmt,...)
char * G_color_rules_options(void)
Get list of color rules for Option->options.
char * G_color_rules_description_type(void)
Get color rules description for Option->descriptions.
const char * G_getenv_nofatal(const char *name)
Get environment variable.
struct Option * G_define_option(void)
Initializes an Option struct.
struct Flag * G_define_flag(void)
Initializes a Flag 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.