main.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /****************************************************************************
  2. *
  3. * MODULE: r.distance
  4. *
  5. * AUTHOR(S): Michael Shapiro - CERL
  6. *
  7. * PURPOSE: Locates the closest points between objects in two
  8. * raster maps.
  9. *
  10. * COPYRIGHT: (C) 2003, 2012 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 <stdio.h>
  19. #include "defs.h"
  20. #include <grass/gis.h>
  21. #include <grass/glocale.h>
  22. int main(int argc, char *argv[])
  23. {
  24. extern void parse();
  25. extern void find_edge_cells();
  26. extern void report();
  27. extern void read_labels();
  28. struct Parms parms;
  29. struct GModule *module;
  30. G_gisinit(argv[0]);
  31. /* Set description */
  32. module = G_define_module();
  33. G_add_keyword(_("raster"));
  34. G_add_keyword(_("distance"));
  35. module->description =
  36. _("Locates the closest points between objects in two raster maps.");
  37. parse(argc, argv, &parms);
  38. if (parms.labels) {
  39. read_labels(&parms.map1);
  40. read_labels(&parms.map2);
  41. }
  42. find_edge_cells(&parms.map1);
  43. find_edge_cells(&parms.map2);
  44. report(&parms);
  45. exit(EXIT_SUCCESS);
  46. }