rewind_ogr.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*!
  2. \file rewind.c
  3. \brief Vector library - rewind data (native format)
  4. Higher level functions for reading/writing/manipulating vectors.
  5. (C) 2001-2009 by the GRASS Development Team
  6. This program is free software under the GNU General Public License
  7. (>=v2). Read the file COPYING that comes with GRASS for details.
  8. \author Radim Blazek, Piero Cavalieri
  9. */
  10. #include <grass/gis.h>
  11. #include <grass/Vect.h>
  12. #ifdef HAVE_OGR
  13. #include <ogr_api.h>
  14. /*!
  15. \brief Rewind vector data file to cause reads to start at beginning (level 1)
  16. \param Map vector map
  17. \return 0 on success
  18. \return -1 on error
  19. */
  20. int V1_rewind_ogr(struct Map_info *Map)
  21. {
  22. G_debug(2, "V1_rewind_ogr(): name = %s", Map->name);
  23. Map->fInfo.ogr.lines_num = 0;
  24. Map->fInfo.ogr.lines_next = 0;
  25. OGR_L_ResetReading(Map->fInfo.ogr.layer);
  26. return 0;
  27. }
  28. /*!
  29. \brief Rewind vector data file to cause reads to start at beginning (level 2)
  30. \param Map vector map
  31. \return 0 on success
  32. \return -1 on error
  33. */
  34. int V2_rewind_ogr(struct Map_info *Map)
  35. {
  36. G_debug(2, "V2_rewind_ogr(): name = %s", Map->name);
  37. Map->next_line = 1;
  38. return 0;
  39. }
  40. #endif