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