GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rewind_ogr.c
Go to the documentation of this file.
1 
2 /****************************************************************************
3 *
4 * MODULE: Vector library
5 *
6 * AUTHOR(S): Radim Blazek, Piero Cavalieri
7 *
8 * PURPOSE: Higher level functions for reading/writing/manipulating vectors.
9 *
10 * COPYRIGHT: (C) 2001 by the GRASS Development Team
11 *
12 * This program is free software under the GNU General Public
13 * License (>=v2). Read the file COPYING that comes with GRASS
14 * for details.
15 *
16 *****************************************************************************/
17 #include <grass/gis.h>
18 #include <grass/Vect.h>
19 
20 #ifdef HAVE_OGR
21 #include <ogr_api.h>
22 
23 /* Rewind vector data file to cause reads to start at beginning.
24  ** returns 0 on success
25  ** -1 on error
26  */
27 int V1_rewind_ogr(struct Map_info *Map)
28 {
29  G_debug(2, "V1_rewind_ogr(): name = %s", Map->name);
30 
31  Map->fInfo.ogr.lines_num = 0;
32  Map->fInfo.ogr.lines_next = 0;
33 
34  OGR_L_ResetReading(Map->fInfo.ogr.layer);
35 
36  return 0;
37 }
38 
39 int V2_rewind_ogr(struct Map_info *Map)
40 {
41  G_debug(2, "V2_rewind_ogr(): name = %s", Map->name);
42 
43  Map->next_line = 1;
44 
45  return 0;
46 }
47 
48 #endif
int V2_rewind_ogr(struct Map_info *Map)
Definition: rewind_ogr.c:39
int V1_rewind_ogr(struct Map_info *Map)
Definition: rewind_ogr.c:27
tuple Map
Definition: render.py:1310
int G_debug(int level, const char *msg,...)
Print debugging message.
Definition: gis/debug.c:51