2
\file lib/vector/Vlib/rewind_pg.c
4
\brief Vector library - rewind data (PostGIS layers)
6
Higher level functions for reading/writing/manipulating vectors.
8
(C) 2011-2012 by the GRASS Development Team
10
This program is free software under the GNU General Public License
11
(>=v2). Read the file COPYING that comes with GRASS for details.
13
\author Martin Landa <landa.martin gmail.com>
16
#include <grass/vector.h>
17
#include <grass/glocale.h>
19
#include "local_proto.h"
22
#include "pg_local_proto.h"
26
\brief Rewind vector map (PostGIS layer) to cause reads to start
27
at beginning (level 1)
29
\param Map pointer to Map_info structure
34
int V1_rewind_pg(struct Map_info *Map)
36
G_debug(2, "V1_rewind_pg(): name = %s", Map->name);
39
struct Format_info_pg *pg_info;
41
pg_info = &(Map->fInfo.pg);
44
pg_info->next_line = 0;
47
if (pg_info->cache.ctype != CACHE_MAP) {
48
pg_info->cache.lines_num = 0;
49
pg_info->cache.fid = -1;
51
pg_info->cache.lines_next = 0;
53
/* close DB cursor if necessary */
54
return Vect__close_cursor_pg(pg_info);
56
G_fatal_error(_("GRASS is not compiled with PostgreSQL support"));
62
\brief Rewind vector map (PostGIS layer) to cause reads to start
63
at beginning on topological level (level 2)
65
\param Map pointer to Map_info structure
70
int V2_rewind_pg(struct Map_info *Map)
72
G_debug(2, "V2_rewind_pg(): name = %s", Map->name);
81
G_fatal_error(_("GRASS is not compiled with PostgreSQL support"));