GRASS GIS 7 Programmer's Manual  7.9.dev(2020)-164b658f1
gis.h
Go to the documentation of this file.
1 /*
2  *****************************************************************************
3  *
4  * MODULE: Grass Include Files
5  * AUTHOR(S): Original author unknown - probably CERL
6  * Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
7  * PURPOSE: This file contains definitions of variables and data types
8  * for use with most, if not all, Grass programs. This file is
9  * usually included in every Grass program.
10  * COPYRIGHT: (C) 2000-2011 by the GRASS Development Team
11  *
12  * This program is free software under the GNU General Public
13  * License (>=v2). Read the file COPYING that comes with GRASS
14  * for details.
15  *
16  *****************************************************************************/
17 
18 #ifndef GRASS_GIS_H
19 #define GRASS_GIS_H
20 
21 /*============================= Include Files ==============================*/
22 
23 /* System include files */
24 #include <stdio.h>
25 #include <stdarg.h>
26 
27 /* Grass and local include files */
28 #include <grass/config.h>
29 #include <grass/datetime.h>
30 #include <grass/version.h>
31 
32 /*=========================== Constants/Defines ============================*/
33 
34 #if !defined __GNUC__ || __GNUC__ < 2
35 #undef __attribute__
36 #define __attribute__(x)
37 #endif
38 
39 static const char *GRASS_copyright __attribute__ ((unused))
40  = "GRASS GNU GPL licensed Software";
41 
42 /* GRASS version, GRASS date, git short hash of last change in GRASS headers
43  * (and anything else in include)
44  */
45 #define GIS_H_VERSION GRASS_HEADERS_VERSION
46 /* git date of last change in GRASS headers
47  * (and anything else in include)
48  */
49 #define GIS_H_DATE GRASS_HEADERS_DATE
50 
51 #define G_gisinit(pgm) G__gisinit(GIS_H_VERSION, (pgm))
52 #define G_no_gisinit() G__no_gisinit(GIS_H_VERSION)
53 
54 /* Define TRUE and FALSE for boolean comparisons */
55 #ifndef TRUE
56 #define TRUE 1
57 #endif
58 
59 #ifndef FALSE
60 #define FALSE 0
61 #endif
62 
63 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
64 #define PRI_OFF_T "lld"
65 #else
66 #define PRI_OFF_T "ld"
67 #endif
68 
69 /*! \brief Cross-platform Newline Character */
70 #define NEWLINE '\n'
71 #ifdef __MINGW32__
72 # define HOST_NEWLINE "\r\n"
73 #else
74 # define HOST_NEWLINE "\n"
75 #endif
76 
77 /*! \brief Generate warning if function return value is unused */
78 #if __GNUC__ && (__GNUC__ >= 3 && __GNUC_MINOR__ >= 4)
79 # define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
80 #else
81 # define WARN_UNUSED_RESULT
82 #endif
83 
84 /*!
85  \brief List of units
86 */
87 #define U_UNDEFINED -1
88 #define U_UNKNOWN 0
89 #define U_ACRES 1
90 #define U_HECTARES 2
91 #define U_KILOMETERS 3
92 #define U_METERS 4
93 #define U_MILES 5
94 #define U_FEET 6
95 #define U_RADIANS 7
96 #define U_DEGREES 8
97 #define U_USFEET 9
98 /* Temporal units from the datetime library */
99 #define U_YEARS DATETIME_YEAR
100 #define U_MONTHS DATETIME_MONTH
101 #define U_DAYS DATETIME_DAY
102 #define U_HOURS DATETIME_HOUR
103 #define U_MINUTES DATETIME_MINUTE
104 #define U_SECONDS DATETIME_SECOND
105 
106 /*! \brief Projection code - XY coordinate system (unreferenced data) */
107 #define PROJECTION_XY 0
108 /*! \brief Projection code - UTM */
109 #define PROJECTION_UTM 1
110 /*! \brief Projection code - State Plane */
111 #define PROJECTION_SP 2
112 /*! \brief Projection code - Latitude-Longitude */
113 #define PROJECTION_LL 3
114 /*! \brief Projection code - other projection (other then noted above) */
115 #define PROJECTION_OTHER 99
116 
117 #define PROJECTION_FILE "PROJ_INFO"
118 #define UNIT_FILE "PROJ_UNITS"
119 #define EPSG_FILE "PROJ_EPSG"
120 
121 #ifdef __MINGW32__
122 #define CONFIG_DIR "GRASS7"
123 #else
124 #define CONFIG_DIR ".grass7"
125 #endif
126 
127 /* define PI and friends */
128 #undef M_PI
129 #define M_PI 3.14159265358979323846 /* pi */
130 
131 #undef M_PI_2
132 #define M_PI_2 1.57079632679489661923 /* pi/2 */
133 
134 #undef M_PI_4
135 #define M_PI_4 0.78539816339744830962 /* pi/4 */
136 
137 #undef M_R2D
138 #define M_R2D 57.295779513082320877 /* 180/pi */
139 
140 #undef M_D2R
141 #define M_D2R 0.017453292519943295769 /* pi/180 */
142 
143 /* epsilon (IEEE: 2.220446e-16) */
144 #define GRASS_EPSILON 1.0e-15
145 
146 /* Location of envariment variables */
147 #define G_VAR_GISRC 0
148 #define G_VAR_MAPSET 1
149 
150 /* Where to find/store variables */
151 #define G_GISRC_MODE_FILE 0 /* files */
152 #define G_GISRC_MODE_MEMORY 1 /* memory only */
153 
154 /* for G_parser() */
155 #define TYPE_INTEGER 1
156 #define TYPE_DOUBLE 2
157 #define TYPE_STRING 3
158 #define YES 1
159 #define NO 0
160 
161 /* File/directory name lengths */
162 #define GNAME_MAX 256
163 #define GMAPSET_MAX 256
164 
165 #define GPATH_MAX 4096
166 
167 /* Basename default separator */
168 #define GBASENAME_SEP "_"
169 
170 /* Macros for type size independent integers */
171 /* Use these for portability to ensure integers are truly 32bit */
172 /* and are handled in a uniform manner */
173 
174 /* Convert integer to 4 bytes - little endian */
175 #define serialize_int32_le(buf, x) do { \
176  (buf)[0] = ((x) >> 0) & 0xFF; \
177  (buf)[1] = ((x) >> 8) & 0xFF; \
178  (buf)[2] = ((x) >> 16) & 0xFF; \
179  (buf)[3] = ((x) >> 24) & 0xFF; \
180 } while(0)
181 
182 /* Convert 4 bytes to an integer - little endian */
183 #define deserialize_int32_le(buf) (((buf)[0] << 0) | \
184  ((buf)[1] << 8) | \
185  ((buf)[2] << 16) | \
186  ((buf)[3] << 24))
187 
188 /* Convert integer to 4 bytes - big endian */
189 #define serialize_int32_be(buf, x) do { \
190  (buf)[0] = ((x) >> 24) & 0xFF; \
191  (buf)[1] = ((x) >> 16) & 0xFF; \
192  (buf)[2] = ((x) >> 8) & 0xFF; \
193  (buf)[3] = ((x) >> 0) & 0xFF; \
194 } while(0)
195 
196 /* Convert 4 bytes to an integer - big endian */
197 #define deserialize_int32_be(buf) (((buf)[0] << 24) | \
198  ((buf)[1] << 16) | \
199  ((buf)[2] << 8) | \
200  ((buf)[3] << 0))
201 
202 /* Cross-platform Directory Separator Character and null device stuff */
203 #define GRASS_DIRSEP '/'
204 #ifdef __MINGW32__
205 # define HOST_DIRSEP '\\'
206 # define G_DEV_NULL "NUL:"
207 #else
208 # define HOST_DIRSEP '/'
209 # define G_DEV_NULL "/dev/null"
210 #endif
211 
212 /*!
213  \typedef STD_OPT
214  \brief Standard option identifiers (enum)
215 
216  Identifies of all recognized standard options.
217 
218  The term <em>old</em> in the descriptions means existing map which
219  is supposed to exist before the module is called.
220  On the other hand, the term <em>new</em> in the descriptions means
221  that the map is not supposed to exist and that module will create one.
222 
223  Used by the G_parser() system.
224 
225  IMPORTANT NOTE: when adding new item to STD_OPT you should also
226  update STD_OPT_STRINGS array in general/g.parser/standard_option.c.
227 
228 */
229 typedef enum
230 {
232  G_OPT_DB_SQL, /*!< SQL statements */
233  G_OPT_DB_WHERE, /*!< SQL where conditions */
234  G_OPT_DB_TABLE, /*!< table name */
235  G_OPT_DB_DRIVER, /*!< driver name */
236  G_OPT_DB_DATABASE, /*!< database name */
237  G_OPT_DB_SCHEMA, /*!< database schema */
238  G_OPT_DB_COLUMN, /*!< one attr column */
239  G_OPT_DB_COLUMNS, /*!< one or more attr columns */
240  G_OPT_DB_KEYCOLUMN, /*!< key column */
241 
242  G_OPT_I_GROUP, /*!< old input imagery group */
243  G_OPT_I_SUBGROUP, /*!< old input imagery subgroup */
244 
245  G_OPT_MEMORYMB, /*!< Maximum memory to be used (in MB): cache size for raster rows */
246  G_OPT_R_INPUT, /*!< old input raster map */
247  G_OPT_R_INPUTS, /*!< old input raster maps */
248  G_OPT_R_OUTPUT, /*!< new output raster map */
249  G_OPT_R_OUTPUTS, /*!< new output raster maps */
250  G_OPT_R_MAP, /*!< old input raster map */
251  G_OPT_R_MAPS, /*!< old input rasters map */
252  G_OPT_R_BASE, /*!< old input base raster map */
253  G_OPT_R_COVER, /*!< old input cover raster map */
254  G_OPT_R_ELEV, /*!< old input elevation raster map */
255  G_OPT_R_ELEVS, /*!< old input elevation raster maps */
256  G_OPT_R_TYPE, /*!< raster map type */
257  G_OPT_R_INTERP_TYPE, /*!< interpolation type */
258  G_OPT_R_BASENAME_INPUT, /*!< old input basename raster maps */
259  G_OPT_R_BASENAME_OUTPUT, /*!< new output basename raster maps */
260 
261  G_OPT_R3_INPUT, /*!< old input raster3d map */
262  G_OPT_R3_INPUTS, /*!< old input raster3d maps */
263  G_OPT_R3_OUTPUT, /*!< new output raster3d map */
264  G_OPT_R3_MAP, /*!< old input raster3d map */
265  G_OPT_R3_MAPS, /*!< old input raster3d maps */
266  G_OPT_R3_TYPE, /*!< Type (FCELL or DCELL) of a new created raster3d map */
267  G_OPT_R3_PRECISION, /*!< The precision of the new generated raster3d map */
268  G_OPT_R3_TILE_DIMENSION, /*!< The tile dimension of a new generated raster3d map */
269  G_OPT_R3_COMPRESSION, /*!< The kind of compression of a new created raster3d map */
270 
271  G_OPT_V_INPUT, /*!< old input vector map */
272  G_OPT_V_INPUTS, /*!< old input vector maps */
273  G_OPT_V_OUTPUT, /*!< new output vector map */
274  G_OPT_V_MAP, /*!< old input vector map */
275  G_OPT_V_MAPS, /*!< old input vector maps */
276  G_OPT_V_TYPE, /*!< primitive type */
277  G_OPT_V3_TYPE, /*!< primitive type, 2D and 3D */
278  G_OPT_V_FIELD, /*!< layer number (layers used to be called fields) */
279  G_OPT_V_FIELD_ALL, /*!< layer number (layers used to be called fields) */
280  G_OPT_V_CAT, /*!< one category */
281  G_OPT_V_CATS, /*!< more categories */
282  G_OPT_V_ID, /*!< one feature id */
283  G_OPT_V_IDS, /*!< more feature ids */
284 
285  G_OPT_F_INPUT, /*!< old input file */
286  G_OPT_F_BIN_INPUT, /*!< old binary input file */
287  G_OPT_F_OUTPUT, /*!< new output file */
288  G_OPT_F_SEP, /*!< data field separator */
289 
290  G_OPT_C, /*!< color */
291  G_OPT_CN, /*!< color or none */
292 
293  G_OPT_M_UNITS, /*!< units */
294  G_OPT_M_DATATYPE, /*!< datatype */
295  G_OPT_M_MAPSET, /*!< mapset */
296  G_OPT_M_LOCATION, /*!< location */
297  G_OPT_M_DBASE, /*!< dbase */
298  G_OPT_M_COORDS, /*!< coordinates */
299  G_OPT_M_COLR, /*!< color rules */
300  G_OPT_M_DIR, /*!< directory input */
301  G_OPT_M_REGION, /*!< saved region */
302  G_OPT_M_NULL_VALUE, /*!< null value string */
303 
304  G_OPT_STDS_INPUT, /*!< old input space time dataset of type strds, str3ds or stvds */
305  G_OPT_STDS_INPUTS, /*!< old input space time datasets */
306  G_OPT_STDS_OUTPUT, /*!< new output space time dataset */
307  G_OPT_STRDS_INPUT, /*!< old input space time raster dataset */
308  G_OPT_STRDS_INPUTS, /*!< old input space time raster datasets */
309  G_OPT_STRDS_OUTPUT, /*!< new output space time raster dataset */
310  G_OPT_STRDS_OUTPUTS, /*!< new output space time raster datasets */
311  G_OPT_STR3DS_INPUT, /*!< old input space time raster3d dataset */
312  G_OPT_STR3DS_INPUTS, /*!< old input space time raster3d datasets */
313  G_OPT_STR3DS_OUTPUT, /*!< new output space time raster3d dataset */
314  G_OPT_STVDS_INPUT, /*!< old input space time vector dataset */
315  G_OPT_STVDS_INPUTS, /*!< old input space time vector datasets */
316  G_OPT_STVDS_OUTPUT, /*!< new output space time vector dataset */
317  G_OPT_MAP_INPUT, /*!< old input map of type raster, vector or raster3d */
318  G_OPT_MAP_INPUTS, /*!< old input maps of type raster, vector or raster3d */
319  G_OPT_STDS_TYPE, /*!< the type of a space time dataset: strds, str3ds, stvds */
320  G_OPT_MAP_TYPE, /*!< The type of an input map: raster, vect, rast3d */
321  G_OPT_T_TYPE, /*!< The temporal type of a space time dataset */
322  G_OPT_T_WHERE, /*!< A temporal GIS framework SQL WHERE statement */
323  G_OPT_T_SAMPLE /*!< Temporal sample methods */
324 
325 } STD_OPT;
326 
327 /*!
328  \typedef STD_FLG
329  \brief Standard flag identifiers (enum)
330 
331  Identifies of all recognized standard flags.
332 
333  Used by the G_parser() system.
334 */
335 
336 /**/ typedef enum
337 {
339  G_FLG_V_TABLE, /*!< do not create attribute table */
340  G_FLG_V_TOPO /*!< do not build topology */
341 } STD_FLG;
342 
343 /* Parser rules for G__option_rule() */
344 enum rule_type {
351 };
352 
353 /* Message format */
354 #define G_INFO_FORMAT_STANDARD 0 /* GRASS_MESSAGE_FORMAT=standard or not defined */
355 #define G_INFO_FORMAT_GUI 1 /* GRASS_MESSAGE_FORMAT=gui */
356 #define G_INFO_FORMAT_SILENT 2 /* GRASS_MESSAGE_FORMAT=silent */
357 #define G_INFO_FORMAT_PLAIN 3 /* GRASS_MESSAGE_FORMAT=plain */
358 
359 /* Icon types */
360 #define G_ICON_CROSS 0
361 #define G_ICON_BOX 1
362 #define G_ICON_ARROW 2
363 
364 /* default colors */
365 #define DEFAULT_FG_COLOR "black"
366 #define DEFAULT_BG_COLOR "white"
367 #define DEFAULT_COLOR_TABLE "viridis"
368 
369 /* error codes */
370 #define G_FATAL_EXIT 0
371 #define G_FATAL_PRINT 1
372 #define G_FATAL_RETURN 2
373 
374 /*! \brief Endian check */
375 #define ENDIAN_LITTLE 0
376 #define ENDIAN_BIG 1
377 #define ENDIAN_OTHER 2
378 
379 /* for vector maps */
380 /*!
381  \brief Name of default key column
382 */
383 #define GV_KEY_COLUMN "cat"
384 
385 /*!
386  \brief Element types identifiers (enum)
387 
388  Identifies various element types. Element can be raster map,
389  vector map, etc.
390 */
391 enum
392 { /* Dir */
393  G_ELEMENT_RASTER = 1, /*!< raster */
394  G_ELEMENT_RASTER3D = 2, /*!< 3d raster */
395  G_ELEMENT_VECTOR = 3, /*!< vector */
396  G_ELEMENT_ASCIIVECTOR = 4, /*!< ASCII vector */
397  G_ELEMENT_LABEL = 5, /*!< labels */
398  G_ELEMENT_REGION = 6, /*!< region */
399  G_ELEMENT_GROUP = 7 /*!< group */
400 };
401 
402 /*=========================== Typedefs/Structures ==========================*/
403 
404 /*!
405  \brief 2D/3D raster map header (used also for region)
406 */
407 struct Cell_head
408 {
409  /*! \brief Max number of bytes per raster data value minus 1 (raster header only)
410 
411  Note: -1 for FP raster maps
412  */
413  int format;
414  /*! \brief Compression mode (raster header only)
415 
416  - 0: uncompressed
417  - 1: compressed
418  - -1: pre GRASS 3.0
419  */
421  /*! \brief Number of rows for 2D data */
422  int rows;
423  /*! \brief Number of rows for 3D data */
424  int rows3;
425  /*! \brief Number of columns for 2D data */
426  int cols;
427  /*! \brief Number of columns for 3D data */
428  int cols3;
429  /*! \brief number of depths for 3D data */
430  int depths;
431  /*! \brief Projection code
432 
433  - PROJECTION_XY
434  - PROJECTION_UTM
435  - PROJECTION_SP
436  - PROJECTION_LL
437  - PROJECTION_OTHER
438  */
439  int proj;
440  /*! \brief Projection zone (UTM) */
441  int zone;
442  /*! \brief Resolution - east to west cell size for 2D data */
443  double ew_res;
444  /*! \brief Resolution - east to west cell size for 3D data */
445  double ew_res3;
446  /*! \brief Resolution - north to south cell size for 2D data */
447  double ns_res;
448  /*! \brief Resolution - north to south cell size for 3D data */
449  double ns_res3;
450  /*! \brief Resolution - top to bottom cell size for 3D data */
451  double tb_res;
452  /*! \brief Extent coordinates (north) */
453  double north;
454  /*! \brief Extent coordinates (south) */
455  double south;
456  /*! \brief Extent coordinates (east) */
457  double east;
458  /*! \brief Extent coordinates (west) */
459  double west;
460  /*! \brief Extent coordinates (top) - 3D data*/
461  double top;
462  /*! \brief Extent coordinates (bottom) - 3D data */
463  double bottom;
464 };
465 
466 /*
467  ** Structure for I/O of 3dview files (view.c)
468  */
469 struct G_3dview
470 {
471  char pgm_id[40]; /* user-provided identifier */
472  float from_to[2][3]; /* eye position & lookat position */
473  float fov; /* field of view */
474  float twist; /* right_hand rotation about from_to */
475  float exag; /* terrain elevation exageration */
476  int mesh_freq; /* cells per grid line */
477  int poly_freq; /* cells per polygon */
478  int display_type; /* 1 for mesh, 2 for poly, 3 for both */
479  int lightson; /* boolean */
480  int dozero; /* boolean */
481  int colorgrid; /* boolean */
482  int shading; /* boolean */
483  int fringe; /* boolean */
484  int surfonly; /* boolean */
485  int doavg; /* boolean */
486  char grid_col[40]; /* colors */
487  char bg_col[40]; /* colors */
488  char other_col[40]; /* colors */
489  float lightpos[4]; /* east, north, height, 1.0 for local 0.0 infin */
490  float lightcol[3]; /* values between 0.0 to 1.0 for red, grn, blu */
491  float ambient;
492  float shine;
493  struct Cell_head vwin;
494 };
495 
496 struct Key_Value
497 {
498  int nitems;
499  int nalloc;
500  char **key;
501  char **value;
502 };
503 
504 /*!
505  \brief Structure that stores option information
506 
507  The descriptions member contains pairs of option and option
508  descriptions separated by semicolon ';'.
509  For example, when options member is set using:
510  \code
511  opt->options = "break,rmdupl"
512  \endcode
513  the descriptions member should be set to:
514  \verbatim
515  "break;break lines on intersections;"
516  "rmdupl;remove duplicates"
517  \endverbatim
518 
519  Parsed descriptions are stored in the same order as options.
520 
521  GUI dependency is a list of options (separated by commas) to be updated
522  if the value is changed.
523 
524  Used by the G_parser() system.
525 */
526 struct Option
527 {
528  const char *key; /*!< Key word used on command line */
529  int type; /*!< Option type */
530  int required; /*!< REQUIRED or OPTIONAL */
531  int multiple; /*!< Multiple entries OK */
532  const char *options; /*!< Approved values or range or NULL */
533  const char **opts; /*!< NULL or NULL terminated array of parsed options */
534  const char *key_desc; /*!< one word describing the key */
535  const char *label; /*!< Optional short label, used in GUI as item label */
536  const char *description; /*!< String describing option */
537  const char *descriptions; /*!< ';' separated pairs of option and option descriptions */
538  const char **descs; /*!< parsed descriptions, array of either NULL or string */
539  char *answer; /*!< Option answer */
540  const char *def; /*!< Where original answer gets saved */
541  char **answers; /*!< Option answers (for multiple=YES) */
542  struct Option *next_opt; /*!< Pointer to next option struct */
543  const char *gisprompt; /*!< Interactive prompt guidance */
544  const char *guisection; /*!< GUI Layout guidance: ';' delimited hierarchical tree position */
545  const char *guidependency; /*!< GUI dependency */
546  int (*checker)(const char *);/*!< Routine to check answer or NULL */
547  int count;
548 };
549 
550 /*!
551  \brief Structure that stores flag info
552 
553  Used by the G_parser() system.
554 */
555 struct Flag
556 {
557  char key; /*!< Key char used on command line */
558  char answer; /*!< Stores flag state: 0/1 */
559  char suppress_required; /*!< Suppresses checking of required options */
560  char suppress_overwrite; /*!< Suppresses checking of existing output */
561  const char *label; /*!< Optional short label, used in GUI as item label */
562  const char *description; /*!< String describing flag meaning */
563  const char *guisection; /*!< GUI Layout guidance: ';' delimited hierarchical tree position */
564  struct Flag *next_flag; /*!< Pointer to next flag struct */
565 };
566 
567 /*!
568  \brief Structure that stores module info
569 
570  Used by the G_parser() system.
571 */
572 struct GModule
573 {
574  const char *label; /*!< Optional short description for GUI */
575  const char *description; /*!< String describing module */
576  const char **keywords; /*!< Keywords describing module */
577  /* further items are possible: author(s), version, year */
578  int overwrite; /*!< overwrite old files */
579  int verbose; /*!< print all information about progress and so on */
580 };
581 
582 struct TimeStamp
583 {
584  DateTime dt[2]; /* two datetimes */
585  int count;
586 };
587 
588 struct Counter {
589  int value;
590 };
591 
592 struct Popen {
593  FILE *fp;
594  int pid;
595 };
596 
597 typedef int CELL;
598 typedef double DCELL;
599 typedef float FCELL;
600 
601 /* 64 bit signed integer */
602 #if HAVE_INT64_T
603 #include <sys/types.h>
604 typedef int64_t grass_int64;
605 #elif defined(__MINGW32__)
606 typedef __int64 grass_int64;
607 #elif HAVE_LONG_LONG_INT
608 typedef long long int grass_int64;
609 #elif HAVE_LARGEFILES
610 typedef off_t grass_int64;
611 #else
612 #error "no 64 bit integer available"
613 #endif
614 
615 /* LCELL = large CELL, proposed new raster data type */
616 typedef grass_int64 LCELL;
617 
619 {
620  DCELL value;
621  unsigned char red;
622  unsigned char grn;
623  unsigned char blu;
624 };
625 
627 {
628  struct _Color_Value_ low, high;
631 };
632 
634 {
636  int n_rules;
637 
638  struct
639  {
640  unsigned char *red;
641  unsigned char *grn;
642  unsigned char *blu;
643  unsigned char *set;
644  int nalloc;
645  int active;
646  } lookup;
647 
648  struct
649  {
650  DCELL *vals;
651  /* pointers to color rules corresponding to the intervals btwn vals */
652  struct _Color_Rule_ **rules;
653  int nalloc;
654  int active;
655  } fp_lookup;
656 
657  DCELL min, max;
658 };
659 
660 struct Colors
661 {
662  int version; /* set by read_colors: -1=old,1=new */
663  DCELL shift;
664  int invert;
665  int is_float; /* defined on floating point raster data? */
666  int null_set; /* the colors for null are set? */
667  unsigned char null_red;
668  unsigned char null_grn;
669  unsigned char null_blu;
670  int undef_set; /* the colors for cells not in range are set? */
671  unsigned char undef_red;
672  unsigned char undef_grn;
673  unsigned char undef_blu;
674  struct _Color_Info_ fixed;
675  struct _Color_Info_ modular;
676  DCELL cmin;
677  DCELL cmax;
679 };
680 
681 /*!
682  \brief List of integers
683 */
684 struct ilist
685 {
686  /*!
687  \brief Array of values
688  */
689  int *value;
690  /*!
691  \brief Number of values in the list
692  */
693  int n_values;
694  /*!
695  \brief Allocated space for values
696  */
698 };
699 
700 /*============================== Prototypes ================================*/
701 
702 /* Since there are so many prototypes for the gis library they are stored */
703 /* in the file gisdefs.h */
704 #include <grass/defs/gis.h>
705 
706 #endif /* GRASS_GIS_H */
const char ** opts
Definition: gis.h:533
int colorgrid
Definition: gis.h:481
int null_set
Definition: gis.h:666
const char * guidependency
Definition: gis.h:545
unsigned char null_blu
Definition: gis.h:669
int count
Definition: gis.h:547
unsigned char * blu
Definition: gis.h:642
float twist
Definition: gis.h:474
DCELL shift
Definition: gis.h:663
unsigned char * red
Definition: gis.h:640
char answer
Definition: gis.h:558
2D/3D raster map header (used also for region)
Definition: gis.h:407
struct _Color_Rule_ ** rules
Definition: gis.h:652
const char ** keywords
Definition: gis.h:576
int version
Definition: gis.h:662
double west
Extent coordinates (west)
Definition: gis.h:459
unsigned char null_grn
Definition: gis.h:668
double DCELL
Definition: gis.h:598
int poly_freq
Definition: gis.h:477
const char * label
Definition: gis.h:574
const char * descriptions
Definition: gis.h:537
DCELL cmax
Definition: gis.h:677
int fringe
Definition: gis.h:483
Definition: gis.h:588
int n_values
Number of values in the list.
Definition: gis.h:693
unsigned char undef_red
Definition: gis.h:671
struct _Color_Rule_ * next
Definition: gis.h:629
int doavg
Definition: gis.h:485
rule_type
Definition: gis.h:344
unsigned char * grn
Definition: gis.h:641
int is_float
Definition: gis.h:665
int nalloc
Definition: gis.h:644
Structure that stores module info.
Definition: gis.h:572
int display_type
Definition: gis.h:478
float ambient
Definition: gis.h:491
float shine
Definition: gis.h:492
int format
Max number of bytes per raster data value minus 1 (raster header only)
Definition: gis.h:413
#define max(x, y)
Definition: draw2.c:32
DCELL * vals
Definition: gis.h:650
Definition: gis.h:291
const char * def
Definition: gis.h:540
int cols3
Number of columns for 3D data.
Definition: gis.h:428
int pid
Definition: gis.h:594
int shading
Definition: gis.h:482
double top
Extent coordinates (top) - 3D data.
Definition: gis.h:461
grass_int64 LCELL
Definition: gis.h:616
int dozero
Definition: gis.h:480
DCELL cmin
Definition: gis.h:676
const char * guisection
Definition: gis.h:563
const char * description
Definition: gis.h:536
int type
Definition: gis.h:529
DCELL min
Definition: gis.h:657
int verbose
Definition: gis.h:579
int compressed
Compression mode (raster header only)
Definition: gis.h:420
double north
Extent coordinates (north)
Definition: gis.h:453
double ns_res3
Resolution - north to south cell size for 3D data.
Definition: gis.h:449
int organizing
Definition: gis.h:678
int rows3
Number of rows for 3D data.
Definition: gis.h:424
Definition: gis.h:592
char ** value
Definition: gis.h:501
char * answer
Definition: gis.h:539
double south
Extent coordinates (south)
Definition: gis.h:455
DCELL value
Definition: gis.h:620
int mesh_freq
Definition: gis.h:476
const char * guisection
Definition: gis.h:544
int multiple
Definition: gis.h:531
int zone
Projection zone (UTM)
Definition: gis.h:441
Structure that stores flag info.
Definition: gis.h:555
float fov
Definition: gis.h:473
int lightson
Definition: gis.h:479
char key
Definition: gis.h:557
int required
Definition: gis.h:530
double bottom
Extent coordinates (bottom) - 3D data.
Definition: gis.h:463
int value
Definition: gis.h:589
char ** key
Definition: gis.h:500
char suppress_overwrite
Definition: gis.h:560
int depths
number of depths for 3D data
Definition: gis.h:430
int proj
Projection code.
Definition: gis.h:439
struct Flag * next_flag
Definition: gis.h:564
int alloc_values
Allocated space for values.
Definition: gis.h:697
unsigned char null_red
Definition: gis.h:667
Definition: gis.h:496
float FCELL
Definition: gis.h:599
Definition: gis.h:660
const char * label
Definition: gis.h:561
int nalloc
Definition: gis.h:499
int active
Definition: gis.h:645
Definition: gis.h:469
const char * label
Definition: gis.h:535
const char ** descs
Definition: gis.h:538
int n_rules
Definition: gis.h:636
int cols
Number of columns for 2D data.
Definition: gis.h:426
unsigned char undef_blu
Definition: gis.h:673
unsigned char undef_grn
Definition: gis.h:672
double ns_res
Resolution - north to south cell size for 2D data.
Definition: gis.h:447
int invert
Definition: gis.h:664
char suppress_required
Definition: gis.h:559
int CELL
Definition: gis.h:597
unsigned char red
Definition: gis.h:621
int undef_set
Definition: gis.h:670
Structure that stores option information.
Definition: gis.h:526
double east
Extent coordinates (east)
Definition: gis.h:457
STD_FLG
Standard flag identifiers (enum)
Definition: gis.h:336
List of integers.
Definition: gis.h:684
unsigned char blu
Definition: gis.h:623
int nitems
Definition: gis.h:498
const char * description
Definition: gis.h:562
Definition: gis.h:582
int * value
Array of values.
Definition: gis.h:689
Definition: gis.h:290
int(* checker)(const char *)
Definition: gis.h:546
char ** answers
Definition: gis.h:541
float exag
Definition: gis.h:475
const char * key
Definition: gis.h:528
const char * description
Definition: gis.h:575
const char * gisprompt
Definition: gis.h:543
unsigned char grn
Definition: gis.h:622
const char * options
Definition: gis.h:532
double ew_res
Resolution - east to west cell size for 2D data.
Definition: gis.h:443
int count
Definition: gis.h:585
double tb_res
Resolution - top to bottom cell size for 3D data.
Definition: gis.h:451
int surfonly
Definition: gis.h:484
int rows
Number of rows for 2D data.
Definition: gis.h:422
struct _Color_Rule_ * prev
Definition: gis.h:630
const char * key_desc
Definition: gis.h:534
int overwrite
Definition: gis.h:578
#define __attribute__(x)
Definition: gis.h:36
FILE * fp
Definition: gis.h:593
STD_OPT
Standard option identifiers (enum)
Definition: gis.h:229
double ew_res3
Resolution - east to west cell size for 3D data.
Definition: gis.h:445
struct Option * next_opt
Definition: gis.h:542
struct _Color_Rule_ * rules
Definition: gis.h:635