GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71817
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
output2d.c
Go to the documentation of this file.
1 /*!
2  * \file output2d.c
3  *
4  * \author H. Mitasova, I. Kosinovsky, D. Gerdesm, Summer 1992 (original authors)
5  * \author modified by McCauley in August 1995
6  * \author modified by Mitasova in August 1995
7  * \author modified by Mitasova in August 1999 (fix for elev color)
8  * \author modified by Brown in September 1999 (fix for Timestamps)
9  * \author modified by Mitasova in Nov. 1999 (write given tension into hist)
10  *
11  * \copyright
12  * (C) 1992-2006 by Helena Mitasova and the GRASS Development Team
13  *
14  * \copyright
15  * This program is free software under the
16  * GNU General Public License (>=v2).
17  * Read the file COPYING that comes with GRASS for details.
18  */
19 
20 #include <stdio.h>
21 #include <math.h>
22 
23 #include <grass/gis.h>
24 #include <grass/raster.h>
25 #include <grass/bitmap.h>
26 #include <grass/linkm.h>
27 #include <grass/interpf.h>
28 #include <grass/glocale.h>
29 
30 #define MULT 100000
31 
32 static void do_history(const char *name, int vect, const char *input,
33  const struct interp_params *params)
34 {
35  struct History hist;
36 
37  Rast_short_history(name, "raster", &hist);
38  if (params->elev)
39  Rast_append_format_history(&hist, "The elevation map is %s",
40  params->elev);
41  Rast_format_history(&hist, HIST_DATSRC_1, "%s %s",
42  vect ? "vector map" : "site file",
43  input);
44 
45  Rast_command_history(&hist);
46  Rast_write_history(name, &hist);
47  if (params->ts)
48  G_write_raster_timestamp(name, params->ts);
49 
50  Rast_free_history(&hist);
51 }
52 
53 
54 /*!
55  * Creates output files as well as history files and color tables for them.
56  *
57  * *ertot* can be also called *RMS deviation of the interpolated surface*.
58  */
59 int IL_output_2d(struct interp_params *params,
60  struct Cell_head *cellhd, /*!< current region */
61  double zmin, double zmax, /*!< min,max input z-values */
62  double zminac, double zmaxac,
63  double c1min, double c1max, /*!< min,max interpolated values */
64  double c2min, double c2max,
65  double gmin, double gmax,
66  double ertot, /*!< total interpolating func. error */
67  char *input, /*!< input file name */
68  double dnorm, /*!< normalization factor */
69  int dtens, int vect, int n_points
70  )
71 {
72  FCELL *cell1;
73  int cf1 = -1, cf2 = -1, cf3 = -1, cf4 = -1, cf5 = -1, cf6 = -1;
74  int nrows, ncols;
75  int i, ii;
76  double zstep;
77  FCELL data1, data2;
78  struct Colors colors;
79  struct History hist;
80  char *type;
81  const char *mapset = NULL;
82  int cond1, cond2;
83  FCELL dat1, dat2;
84  CELL val1, val2;
85 
86  cond2 = ((params->pcurv != NULL) || (params->tcurv != NULL)
87  || (params->mcurv != NULL));
88  cond1 = ((params->slope != NULL) || (params->aspect != NULL) || cond2);
89 
90  Rast_set_window(cellhd);
91 
92  cell1 = Rast_allocate_f_buf();
93 
94  /*
95  * G_set_embedded_null_value_mode(1);
96  */
97  if (params->elev)
98  cf1 = Rast_open_new(params->elev, FCELL_TYPE);
99 
100  if (params->slope)
101  cf2 = Rast_open_new(params->slope, FCELL_TYPE);
102 
103  if (params->aspect)
104  cf3 = Rast_open_new(params->aspect, FCELL_TYPE);
105 
106  if (params->pcurv)
107  cf4 = Rast_open_new(params->pcurv, FCELL_TYPE);
108 
109  if (params->tcurv)
110  cf5 = Rast_open_new(params->tcurv, FCELL_TYPE);
111 
112  if (params->mcurv)
113  cf6 = Rast_open_new(params->mcurv, FCELL_TYPE);
114 
115  nrows = cellhd->rows;
116  if (nrows != params->nsizr) {
117  G_warning(_("First change your rows number to nsizr! %d %d"),
118  nrows, params->nsizr);
119  return -1;
120  }
121 
122  ncols = cellhd->cols;
123  if (ncols != params->nsizc) {
124  G_warning(_("First change your cols number to nsizc %d %d"),
125  ncols, params->nsizc);
126  return -1;
127  }
128 
129  if (params->elev != NULL) {
130  G_fseek(params->Tmp_fd_z, 0L, 0); /* seek to the beginning */
131  for (i = 0; i < params->nsizr; i++) {
132  /* seek to the right row */
133  G_fseek(params->Tmp_fd_z, (off_t) (params->nsizr - 1 - i) *
134  params->nsizc * sizeof(FCELL), 0);
135  ii = fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_z);
136  /*
137  * for(j=0;j<params->nsizc;j++) fprintf(stderr,"%f ",cell1[j]);
138  * fprintf(stderr,"\n");
139  */
140  Rast_put_f_row(cf1, cell1);
141 
142  }
143  }
144 
145  if (params->slope != NULL) {
146  G_fseek(params->Tmp_fd_dx, 0L, 0); /* seek to the beginning */
147  for (i = 0; i < params->nsizr; i++) {
148  /* seek to the right row */
149  G_fseek(params->Tmp_fd_dx, (off_t) (params->nsizr - 1 - i) *
150  params->nsizc * sizeof(FCELL), 0);
151  fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dx);
152  Rast_put_f_row(cf2, cell1);
153  }
154  }
155 
156  if (params->aspect != NULL) {
157  G_fseek(params->Tmp_fd_dy, 0L, 0); /* seek to the beginning */
158  for (i = 0; i < params->nsizr; i++) {
159  /* seek to the right row */
160  G_fseek(params->Tmp_fd_dy, (off_t) (params->nsizr - 1 - i) *
161  params->nsizc * sizeof(FCELL), 0);
162  fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_dy);
163  Rast_put_f_row(cf3, cell1);
164  }
165  }
166 
167  if (params->pcurv != NULL) {
168  G_fseek(params->Tmp_fd_xx, 0L, 0); /* seek to the beginning */
169  for (i = 0; i < params->nsizr; i++) {
170  /* seek to the right row */
171  G_fseek(params->Tmp_fd_xx, (off_t) (params->nsizr - 1 - i) *
172  params->nsizc * sizeof(FCELL), 0);
173  fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xx);
174  Rast_put_f_row(cf4, cell1);
175  }
176  }
177 
178  if (params->tcurv != NULL) {
179  G_fseek(params->Tmp_fd_yy, 0L, 0); /* seek to the beginning */
180  for (i = 0; i < params->nsizr; i++) {
181  /* seek to the right row */
182  G_fseek(params->Tmp_fd_yy, (off_t) (params->nsizr - 1 - i) *
183  params->nsizc * sizeof(FCELL), 0);
184  fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_yy);
185  Rast_put_f_row(cf5, cell1);
186  }
187  }
188 
189  if (params->mcurv != NULL) {
190  G_fseek(params->Tmp_fd_xy, 0L, 0); /* seek to the beginning */
191  for (i = 0; i < params->nsizr; i++) {
192  /* seek to the right row */
193  G_fseek(params->Tmp_fd_xy, (off_t) (params->nsizr - 1 - i) *
194  params->nsizc * sizeof(FCELL), 0);
195  fread(cell1, sizeof(FCELL), params->nsizc, params->Tmp_fd_xy);
196  Rast_put_f_row(cf6, cell1);
197  }
198  }
199 
200  if (cf1 >= 0)
201  Rast_close(cf1);
202  if (cf2 >= 0)
203  Rast_close(cf2);
204  if (cf3 >= 0)
205  Rast_close(cf3);
206  if (cf4 >= 0)
207  Rast_close(cf4);
208  if (cf5 >= 0)
209  Rast_close(cf5);
210  if (cf6 >= 0)
211  Rast_close(cf6);
212 
213 
214  /* colortable for elevations */
215  Rast_init_colors(&colors);
216  zstep = (FCELL) (zmaxac - zminac) / 5.;
217  for (i = 1; i <= 5; i++) {
218  data1 = (FCELL) (zminac + (i - 1) * zstep);
219  data2 = (FCELL) (zminac + i * zstep);
220  switch (i) {
221  case 1:
222  Rast_add_f_color_rule(&data1, 0, 191, 191,
223  &data2, 0, 255, 0, &colors);
224  break;
225  case 2:
226  Rast_add_f_color_rule(&data1, 0, 255, 0,
227  &data2, 255, 255, 0, &colors);
228  break;
229  case 3:
230  Rast_add_f_color_rule(&data1, 255, 255, 0,
231  &data2, 255, 127, 0, &colors);
232  break;
233  case 4:
234  Rast_add_f_color_rule(&data1, 255, 127, 0,
235  &data2, 191, 127, 63, &colors);
236  break;
237  case 5:
238  Rast_add_f_color_rule(&data1, 191, 127, 63,
239  &data2, 200, 200, 200, &colors);
240  break;
241  }
242  }
243 
244  if (params->elev != NULL) {
245  mapset = G_find_file("cell", params->elev, "");
246  if (mapset == NULL) {
247  G_warning(_("Raster map <%s> not found"), params->elev);
248  return -1;
249  }
250  Rast_write_colors(params->elev, mapset, &colors);
251  Rast_quantize_fp_map_range(params->elev, mapset,
252  (DCELL) zminac - 0.5, (DCELL) zmaxac + 0.5,
253  (CELL) (zminac - 0.5), (CELL) (zmaxac + 0.5));
254  }
255 
256  /* colortable for slopes */
257  if (cond1) {
258  if (!params->deriv) {
259  /*
260  * smin = (CELL) ((int)(gmin*scig)); smax = (CELL) gmax; fprintf
261  * (stderr, "min %d max %d \n", smin,smax); Rast_make_rainbow_colors
262  * (&colors,smin,smax);
263  */
264  Rast_init_colors(&colors);
265  val1 = 0;
266  val2 = 2;
267  Rast_add_c_color_rule(&val1, 255, 255, 255, &val2, 255, 255, 0, &colors);
268  val1 = 2;
269  val2 = 5;
270  Rast_add_c_color_rule(&val1, 255, 255, 0, &val2, 0, 255, 0, &colors);
271  val1 = 5;
272  val2 = 10;
273  Rast_add_c_color_rule(&val1, 0, 255, 0, &val2, 0, 255, 255, &colors);
274  val1 = 10;
275  val2 = 15;
276  Rast_add_c_color_rule(&val1, 0, 255, 255, &val2, 0, 0, 255, &colors);
277  val1 = 15;
278  val2 = 30;
279  Rast_add_c_color_rule(&val1, 0, 0, 255, &val2, 255, 0, 255, &colors);
280  val1 = 30;
281  val2 = 50;
282  Rast_add_c_color_rule(&val1, 255, 0, 255, &val2, 255, 0, 0, &colors);
283  val1 = 50;
284  val2 = 90;
285  Rast_add_c_color_rule(&val1, 255, 0, 0, &val2, 0, 0, 0, &colors);
286  }
287  else {
288  Rast_init_colors(&colors);
289  dat1 = (FCELL) - 5.0; /* replace by min dx, amin1 (c1min,
290  * c2min); */
291  dat2 = (FCELL) - 0.1;
292  Rast_add_f_color_rule(&dat1, 127, 0, 255,
293  &dat2, 0, 0, 255, &colors);
294  dat1 = dat2;
295  dat2 = (FCELL) - 0.01;
296  Rast_add_f_color_rule(&dat1, 0, 0, 255,
297  &dat2, 0, 127, 255, &colors);
298  dat1 = dat2;
299  dat2 = (FCELL) - 0.001;
300  Rast_add_f_color_rule(&dat1, 0, 127, 255,
301  &dat2, 0, 255, 255, &colors);
302  dat1 = dat2;
303  dat2 = (FCELL) 0.0;
304  Rast_add_f_color_rule(&dat1, 0, 255, 255,
305  &dat2, 200, 255, 200, &colors);
306  dat1 = dat2;
307  dat2 = (FCELL) 0.001;
308  Rast_add_f_color_rule(&dat1, 200, 255, 200,
309  &dat2, 255, 255, 0, &colors);
310  dat1 = dat2;
311  dat2 = (FCELL) 0.01;
312  Rast_add_f_color_rule(&dat1, 255, 255, 0,
313  &dat2, 255, 127, 0, &colors);
314  dat1 = dat2;
315  dat2 = (FCELL) 0.1;
316  Rast_add_f_color_rule(&dat1, 255, 127, 0,
317  &dat2, 255, 0, 0, &colors);
318  dat1 = dat2;
319  dat2 = (FCELL) 5.0; /* replace by max dx, amax1 (c1max,
320  * c2max); */
321  Rast_add_f_color_rule(&dat1, 255, 0, 0,
322  &dat2, 255, 0, 200, &colors);
323  }
324 
325  if (params->slope != NULL) {
326  mapset = G_find_file("cell", params->slope, "");
327  if (mapset == NULL) {
328  G_warning(_("Raster map <%s> not found"), params->slope);
329  return -1;
330  }
331  Rast_write_colors(params->slope, mapset, &colors);
332  Rast_quantize_fp_map_range(params->slope, mapset, 0., 90., 0, 90);
333 
334  do_history(params->slope, vect, input, params);
335  }
336 
337  /* colortable for aspect */
338  if (!params->deriv) {
339  Rast_init_colors(&colors);
340  val1 = 0;
341  val2 = 0;
342  Rast_add_c_color_rule(&val1, 255, 255, 255, &val2, 255, 255, 255, &colors);
343  val1 = 1;
344  val2 = 90;
345  Rast_add_c_color_rule(&val1, 255, 255, 0, &val2, 0, 255, 0, &colors);
346  val1 = 90;
347  val2 = 180;
348  Rast_add_c_color_rule(&val1, 0, 255, 0, &val2, 0, 255, 255, &colors);
349  val1 = 180;
350  val2 = 270;
351  Rast_add_c_color_rule(&val1, 0, 255, 255, &val2, 255, 0, 0, &colors);
352  val1 = 270;
353  val2 = 360;
354  Rast_add_c_color_rule(&val1, 255, 0, 0, &val2, 255, 255, 0, &colors);
355  }
356  else {
357  Rast_init_colors(&colors);
358  dat1 = (FCELL) - 5.0; /* replace by min dy, amin1 (c1min,
359  * c2min); */
360  dat2 = (FCELL) - 0.1;
361  Rast_add_f_color_rule(&dat1, 127, 0, 255,
362  &dat2, 0, 0, 255, &colors);
363  dat1 = dat2;
364  dat2 = (FCELL) - 0.01;
365  Rast_add_f_color_rule(&dat1, 0, 0, 255,
366  &dat2, 0, 127, 255, &colors);
367  dat1 = dat2;
368  dat2 = (FCELL) - 0.001;
369  Rast_add_f_color_rule(&dat1, 0, 127, 255,
370  &dat2, 0, 255, 255, &colors);
371  dat1 = dat2;
372  dat2 = (FCELL) 0.0;
373  Rast_add_f_color_rule(&dat1, 0, 255, 255,
374  &dat2, 200, 255, 200, &colors);
375  dat1 = dat2;
376  dat2 = (FCELL) 0.001;
377  Rast_add_f_color_rule(&dat1, 200, 255, 200,
378  &dat2, 255, 255, 0, &colors);
379  dat1 = dat2;
380  dat2 = (FCELL) 0.01;
381  Rast_add_f_color_rule(&dat1, 255, 255, 0,
382  &dat2, 255, 127, 0, &colors);
383  dat1 = dat2;
384  dat2 = (FCELL) 0.1;
385  Rast_add_f_color_rule(&dat1, 255, 127, 0,
386  &dat2, 255, 0, 0, &colors);
387  dat1 = dat2;
388  dat2 = (FCELL) 5.0; /* replace by max dy, amax1 (c1max,
389  * c2max); */
390  Rast_add_f_color_rule(&dat1, 255, 0, 0,
391  &dat2, 255, 0, 200, &colors);
392  }
393 
394  if (params->aspect != NULL) {
395  mapset = G_find_file("cell", params->aspect, "");
396  if (mapset == NULL) {
397  G_warning(_("Raster map <%s> not found"), params->aspect);
398  return -1;
399  }
400  Rast_write_colors(params->aspect, mapset, &colors);
401  Rast_quantize_fp_map_range(params->aspect, mapset, 0., 360., 0, 360);
402 
403  do_history(params->aspect, vect, input, params);
404  }
405 
406  /* colortable for curvatures */
407  if (cond2) {
408  Rast_init_colors(&colors);
409  dat1 = (FCELL) amin1(c1min, c2min); /* for derivatives use min
410  * dxx,dyy,dxy */
411  dat2 = (FCELL) - 0.01;
412  Rast_add_f_color_rule(&dat1, 127, 0, 255,
413  &dat2, 0, 0, 255, &colors);
414  dat1 = dat2;
415  dat2 = (FCELL) - 0.001;
416  Rast_add_f_color_rule(&dat1, 0, 0, 255,
417  &dat2, 0, 127, 255, &colors);
418  dat1 = dat2;
419  dat2 = (FCELL) - 0.00001;
420  Rast_add_f_color_rule(&dat1, 0, 127, 255,
421  &dat2, 0, 255, 255, &colors);
422  dat1 = dat2;
423  dat2 = (FCELL) 0.0;
424  Rast_add_f_color_rule(&dat1, 0, 255, 255,
425  &dat2, 200, 255, 200, &colors);
426  dat1 = dat2;
427  dat2 = (FCELL) 0.00001;
428  Rast_add_f_color_rule(&dat1, 200, 255, 200,
429  &dat2, 255, 255, 0, &colors);
430  dat1 = dat2;
431  dat2 = (FCELL) 0.001;
432  Rast_add_f_color_rule(&dat1, 255, 255, 0,
433  &dat2, 255, 127, 0, &colors);
434  dat1 = dat2;
435  dat2 = (FCELL) 0.01;
436  Rast_add_f_color_rule(&dat1, 255, 127, 0,
437  &dat2, 255, 0, 0, &colors);
438  dat1 = dat2;
439  dat2 = (FCELL) amax1(c1max, c2max); /* for derivatives use max
440  * dxx,dyy,dxy */
441  Rast_add_f_color_rule(&dat1, 255, 0, 0,
442  &dat2, 255, 0, 200, &colors);
443 
444  if (params->pcurv != NULL) {
445  mapset = G_find_file("cell", params->pcurv, "");
446  if (mapset == NULL) {
447  G_warning(_("Raster map <%s> not found"), params->pcurv);
448  return -1;
449  }
450  Rast_write_colors(params->pcurv, mapset, &colors);
451  Rast_quantize_fp_map_range(params->pcurv, mapset, dat1, dat2,
452  (CELL) (dat1 * MULT),
453  (CELL) (dat2 * MULT));
454 
455  do_history(params->pcurv, vect, input, params);
456  }
457 
458  if (params->tcurv != NULL) {
459  mapset = G_find_file("cell", params->tcurv, "");
460  if (mapset == NULL) {
461  G_warning(_("Raster map <%s> not found"), params->tcurv);
462  return -1;
463  }
464  Rast_write_colors(params->tcurv, mapset, &colors);
465  Rast_quantize_fp_map_range(params->tcurv, mapset, dat1, dat2,
466  (CELL) (dat1 * MULT),
467  (CELL) (dat2 * MULT));
468 
469  do_history(params->tcurv, vect, input, params);
470  }
471 
472  if (params->mcurv != NULL) {
473  mapset = G_find_file("cell", params->mcurv, "");
474  if (mapset == NULL) {
475  G_warning(_("Raster map <%s> not found"), params->mcurv);
476  return -1;
477  }
478  Rast_write_colors(params->mcurv, mapset, &colors);
479  Rast_quantize_fp_map_range(params->mcurv, mapset, dat1, dat2,
480  (CELL) (dat1 * MULT),
481  (CELL) (dat2 * MULT));
482 
483  do_history(params->mcurv, vect, input, params);
484  }
485  }
486  }
487 
488  if (params->elev != NULL) {
489  mapset = G_find_file("cell", params->elev, "");
490  if (mapset == NULL) {
491  G_warning(_("Raster map <%s> not found"), params->elev);
492  return -1;
493  }
494  type = "raster";
495  Rast_short_history(params->elev, type, &hist);
496 
497  params->dmin = sqrt(params->dmin);
498 
499  /*
500  * sprintf (hist.edhist[0], "tension=%f, smoothing=%f", params->fi *
501  * dnorm / 1000., params->rsm);
502  */
503 
504  if (dtens) {
505  if (params->rsm == -1)
507  &hist, "giventension=%f, smoothing att=%d",
508  params->fi * 1000. / dnorm, params->smatt);
509  else
511  &hist, "giventension=%f, smoothing=%f",
512  params->fi * 1000. / dnorm, params->rsm);
513  }
514  else {
515  if (params->rsm == -1)
517  &hist, "tension=%f, smoothing att=%d",
518  params->fi * 1000. / dnorm, params->smatt);
519  else
521  &hist, "tension=%f, smoothing=%f",
522  params->fi, params->rsm);
523  }
524 
526  &hist, "dnorm=%f, dmin=%f, zmult=%f",
527  dnorm, params->dmin, params->zmult);
528  /*
529  * sprintf(hist.edhist[2], "segmax=%d, npmin=%d, errtotal=%f",
530  * params->kmax,params->kmin,ertot);
531  */
532  /*
533  * sprintf (hist.edhist[2], "segmax=%d, npmin=%d, errtotal =%f",
534  * params->kmax, params->kmin, sqrt (ertot) / n_points);
535  */
536 
538  &hist, "segmax=%d, npmin=%d, rmsdevi=%f",
539  params->kmax, params->kmin, sqrt(ertot / n_points));
540 
542  &hist, "zmin_data=%f, zmax_data=%f", zmin, zmax);
544  &hist, "zmin_int=%f, zmax_int=%f", zminac, zmaxac);
545 
546  if ((params->theta) && (params->scalex))
548  &hist, "theta=%f, scalex=%f", params->theta,
549  params->scalex);
550 
551  Rast_format_history(&hist, HIST_DATSRC_1, "%s %s",
552  vect ? "vector map" : "site file",
553  input);
554 
555  Rast_command_history(&hist);
556  Rast_write_history(params->elev, &hist);
557  if (params->ts)
558  G_write_raster_timestamp(params->elev, params->ts);
559 
560  Rast_free_history(&hist);
561  }
562 
563  /*
564  * if (title) Rast_put_cell_title (output, title);
565  */
566  return 1;
567 }
void Rast_format_history(struct History *hist, int field, const char *fmt,...)
Definition: history.c:199
double rsm
Definition: interpf.h:83
double scalex
Definition: interpf.h:90
2D/3D raster map header (used also for region)
Definition: gis.h:390
void Rast_close(int fd)
Close a raster map.
Definition: raster/close.c:72
char * mcurv
Definition: interpf.h:84
void Rast_add_c_color_rule(const CELL *cat1, int r1, int g1, int b1, const CELL *cat2, int r2, int g2, int b2, struct Colors *colors)
Adds the integer color rule (CELL version)
Definition: color_rule.c:75
const char * G_find_file(const char *element, char *name, const char *mapset)
Searches for a file from the mapset search list or in a specified mapset.
Definition: find_file.c:203
double DCELL
Definition: gis.h:581
FILE * Tmp_fd_xy
Definition: interpf.h:92
void Rast_append_format_history(struct History *hist, const char *fmt,...)
Append a formatted string to a History structure.
Definition: history.c:45
FILE * Tmp_fd_yy
Definition: interpf.h:92
FCELL * Rast_allocate_f_buf(void)
Allocates memory for a raster map of type FCELL.
Definition: alloc_cell.c:95
double theta
Definition: interpf.h:89
double amax1(double, double)
Definition: minmax.c:54
char * elev
Definition: interpf.h:84
void Rast_quantize_fp_map_range(const char *name, const char *mapset, DCELL d_min, DCELL d_max, CELL min, CELL max)
Write quant rules (f_quant) for floating-point raster map.
Definition: quant_rw.c:124
char * pcurv
Definition: interpf.h:84
#define NULL
Definition: ccmath.h:32
void Rast_init_colors(struct Colors *colors)
Initialize color structure.
Definition: color_init.c:25
FILE * Tmp_fd_xx
Definition: interpf.h:92
#define MULT
Definition: output2d.c:30
int G_write_raster_timestamp(const char *name, const struct TimeStamp *ts)
Write timestamp of raster map.
Definition: timestamp.c:389
FILE * Tmp_fd_dx
Definition: interpf.h:92
void Rast_write_colors(const char *name, const char *mapset, struct Colors *colors)
Write map layer color table.
DCELL val1
Definition: raster3d/cats.c:83
char * aspect
Definition: interpf.h:84
void Rast_free_history(struct History *hist)
Definition: history.c:317
int IL_output_2d(struct interp_params *, struct Cell_head *, double, double, double, double, double, double, double, double, double, double, double, char *, double, int, int, int)
Definition: output2d.c:59
Raster history info (metadata)
Definition: raster.h:180
Description of original data source (two lines)
Definition: raster.h:170
double fi
Definition: interpf.h:80
void Rast_put_f_row(int fd, const FCELL *buf)
Writes the next row for fcell file (FCELL version)
void Rast_write_history(const char *name, struct History *hist)
Write raster history file.
Definition: history.c:158
float FCELL
Definition: gis.h:582
Definition: gis.h:626
double amin1(double, double)
Definition: minmax.c:67
char * tcurv
Definition: interpf.h:84
int cols
Number of columns for 2D data.
Definition: gis.h:409
DCELL val2
Definition: raster3d/cats.c:83
void G_fseek(FILE *fp, off_t offset, int whence)
Change the file position of the stream.
Definition: gis/seek.c:48
FILE * Tmp_fd_dy
Definition: interpf.h:92
double dmin
Definition: interpf.h:86
FILE * Tmp_fd_z
Definition: interpf.h:92
int CELL
Definition: gis.h:580
#define _(str)
Definition: glocale.h:13
#define FCELL_TYPE
Definition: raster.h:12
int Rast_open_new(const char *name, RASTER_MAP_TYPE wr_type)
Opens a new raster map.
Definition: raster/open.c:988
double zmult
Definition: interpf.h:70
void Rast_short_history(const char *name, const char *type, struct History *hist)
Initialize history structure.
Definition: history.c:226
void Rast_set_window(struct Cell_head *window)
Establishes &#39;window&#39; as the current working window.
void Rast_add_f_color_rule(const FCELL *cat1, int r1, int g1, int b1, const FCELL *cat2, int r2, int g2, int b2, struct Colors *colors)
Adds the floating-point color rule (FCELL version)
Definition: color_rule.c:55
struct TimeStamp * ts
Definition: interpf.h:91
const char * name
Definition: named_colr.c:7
int rows
Number of rows for 2D data.
Definition: gis.h:405
int Rast_command_history(struct History *hist)
Save command line to raster history structure.
Definition: history.c:272
void G_warning(const char *msg,...)
Print a warning message to stderr.
Definition: gis/error.c:203
char * slope
Definition: interpf.h:84