main.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /****************************************************************************
  2. *
  3. * MODULE: r.report
  4. * AUTHOR(S): Michael Shapiro, CERL (original contributor)
  5. * Roberto Flor <flor itc.it>
  6. * Jachym Cepicky <jachym les-ejk.cz>,
  7. * Jan-Oliver Wagner <jan intevation.de>
  8. * Sort option by Martin Landa <landa.martin gmail.com>
  9. * PURPOSE: Reports statistics for raster map(s).
  10. * COPYRIGHT: (C) 1999-2013 by the GRASS Development Team
  11. *
  12. * This program is free software under the GNU General
  13. * Public License (>=v2). Read the file COPYING that
  14. * comes with GRASS for details.
  15. *
  16. *****************************************************************************/
  17. #include <stdlib.h>
  18. #include <grass/glocale.h>
  19. #include "global.h"
  20. struct Cell_head window;
  21. LAYER *layers;
  22. int nlayers;
  23. GSTATS *Gstats;
  24. int nstats;
  25. UNITS unit[MAX_UNITS];
  26. int nunits;
  27. int page_width;
  28. int page_length;
  29. int masking = 1;
  30. int use_formfeed;
  31. int nlines;
  32. int with_headers = 1;
  33. int e_format;
  34. int no_nulls;
  35. int no_nulls_all;
  36. int do_sort = SORT_DEFAULT;
  37. char *stats_file;
  38. char *no_data_str;
  39. int stats_flag;
  40. int nsteps, cat_ranges, as_int;
  41. int *is_fp;
  42. DCELL *DMAX, *DMIN;
  43. int maskfd;
  44. CELL *mask;
  45. CELL NULL_CELL;
  46. int (*get_row)();
  47. char fs[2];
  48. struct Categories *labels;
  49. int main(int argc, char *argv[])
  50. {
  51. struct GModule *module;
  52. G_gisinit(argv[0]);
  53. module = G_define_module();
  54. G_add_keyword(_("raster"));
  55. G_add_keyword(_("statistics"));
  56. module->description = _("Reports statistics for raster maps.");
  57. parse_command_line(argc, argv);
  58. G_get_window(&window);
  59. get_stats();
  60. report();
  61. exit(EXIT_SUCCESS);
  62. }