vect.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /****************************************************************************
  2. *
  3. * MODULE: r.carve
  4. *
  5. * AUTHOR(S): Original author Bill Brown, UIUC GIS Laboratory
  6. * Brad Douglas <rez touchofmadness com>
  7. *
  8. * PURPOSE: Takes vector stream data, converts it to 3D raster and
  9. * subtracts a specified depth
  10. *
  11. * COPYRIGHT: (C) 2006 by the GRASS Development Team
  12. *
  13. * This program is free software under the GNU General Public
  14. * License (>=v2). Read the file COPYING that comes with GRASS
  15. * for details.
  16. *
  17. ****************************************************************************/
  18. #include <stdio.h>
  19. #include <grass/gis.h>
  20. #include <grass/glocale.h>
  21. #include "enforce.h"
  22. /*
  23. * open_new_vect - opens new vector map for writing
  24. */
  25. int open_new_vect(struct Map_info *map, char *vect)
  26. {
  27. if (Vect_open_new(map, vect, 1) < 0)
  28. G_fatal_error(_("Unable to create vector map <%s>"), vect);
  29. Vect_set_map_name(map, vect);
  30. Vect_set_comment(map, G_recreate_command());
  31. Vect_hist_command(map);
  32. return 1;
  33. }
  34. /*
  35. * close_vect - builds vector support and frees up resources
  36. */
  37. int close_vect(struct Map_info *map, const int build_support)
  38. {
  39. if (build_support)
  40. Vect_build(map);
  41. Vect_set_release_support(map);
  42. Vect_close(map);
  43. return 1;
  44. }