GRASS Programmer's Manual  6.4.1(2011)
rewind_ogr.c
Go to the documentation of this file.
00001 
00002 /****************************************************************************
00003 *
00004 * MODULE:       Vector library 
00005 *               
00006 * AUTHOR(S):    Radim Blazek, Piero Cavalieri 
00007 *
00008 * PURPOSE:      Higher level functions for reading/writing/manipulating vectors.
00009 *
00010 * COPYRIGHT:    (C) 2001 by the GRASS Development Team
00011 *
00012 *               This program is free software under the GNU General Public
00013 *               License (>=v2). Read the file COPYING that comes with GRASS
00014 *               for details.
00015 *
00016 *****************************************************************************/
00017 #include <grass/gis.h>
00018 #include <grass/Vect.h>
00019 
00020 #ifdef HAVE_OGR
00021 #include <ogr_api.h>
00022 
00023 /* Rewind vector data file to cause reads to start at beginning. 
00024  ** returns 0 on success
00025  **        -1 on error
00026  */
00027 int V1_rewind_ogr(struct Map_info *Map)
00028 {
00029     G_debug(2, "V1_rewind_ogr(): name = %s", Map->name);
00030 
00031     Map->fInfo.ogr.lines_num = 0;
00032     Map->fInfo.ogr.lines_next = 0;
00033 
00034     OGR_L_ResetReading(Map->fInfo.ogr.layer);
00035 
00036     return 0;
00037 }
00038 
00039 int V2_rewind_ogr(struct Map_info *Map)
00040 {
00041     G_debug(2, "V2_rewind_ogr(): name = %s", Map->name);
00042 
00043     Map->next_line = 1;
00044 
00045     return 0;
00046 }
00047 
00048 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines