main.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /****************************************************************************
  2. *
  3. * MODULE: r.distance
  4. *
  5. * AUTHOR(S): Michael Shapiro - CERL
  6. * Sort/reverse sort by distance by Huidae Cho
  7. *
  8. * PURPOSE: Locates the closest points between objects in two
  9. * raster maps.
  10. *
  11. * COPYRIGHT: (C) 2003-2014 by the GRASS Development Team
  12. *
  13. * This program is free software under the GNU General
  14. * Public License (>=v2). Read the file COPYING that
  15. * comes with GRASS for details.
  16. *
  17. ***************************************************************************/
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. #include "defs.h"
  21. #include <grass/gis.h>
  22. #include <grass/glocale.h>
  23. int main(int argc, char *argv[])
  24. {
  25. extern void parse();
  26. extern void find_edge_cells();
  27. extern void report();
  28. extern void read_labels();
  29. struct Parms parms;
  30. struct GModule *module;
  31. G_gisinit(argv[0]);
  32. /* Set description */
  33. module = G_define_module();
  34. G_add_keyword(_("raster"));
  35. G_add_keyword(_("distance"));
  36. module->description =
  37. _("Locates the closest points between objects in two raster maps.");
  38. parse(argc, argv, &parms);
  39. if (parms.labels) {
  40. read_labels(&parms.map1);
  41. read_labels(&parms.map2);
  42. }
  43. find_edge_cells(&parms.map1, parms.null);
  44. find_edge_cells(&parms.map2, parms.null);
  45. report(&parms);
  46. exit(EXIT_SUCCESS);
  47. }