GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Vector library - Open PostGIS layer as vector map layer. More...
#include <string.h>
#include <stdlib.h>
#include <grass/vector.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
#include "local_proto.h"
#include "pg_local_proto.h"
Go to the source code of this file.
Macros | |
#define | NOPG_UNUSED |
Functions | |
int | V1_open_old_pg (struct Map_info *Map NOPG_UNUSED, int update NOPG_UNUSED) |
Open vector map - PostGIS feature table on non-topological level. More... | |
int | V2_open_old_pg (struct Map_info *Map NOPG_UNUSED) |
Open vector map - PostGIS feature table on topological level. More... | |
int | V1_open_new_pg (struct Map_info *Map NOPG_UNUSED, const char *name NOPG_UNUSED, int with_z NOPG_UNUSED) |
Prepare PostGIS database for creating new feature table (level 1) More... | |
int | Vect__open_topo_pg (struct Map_info *Map NOPG_UNUSED, int head_only NOPG_UNUSED, int update NOPG_UNUSED) |
Read full-topology for PostGIS links. More... | |
int | Vect__load_plus_head (struct Map_info *Map) |
Read topo from PostGIS topology schema – header info only. More... | |
int | Vect__load_plus_pg (struct Map_info *Map, int head_only) |
Read topo info from PostGIS topology schema. More... | |
int | Vect__load_map_nodes_pg (struct Map_info *Map, int geom_only) |
Read nodes from DB. More... | |
int | Vect__load_map_lines_pg (struct Map_info *Map) |
Read features from DB. More... | |
void | notice_processor (void *arg UNUSED, const char *message) |
Vector library - Open PostGIS layer as vector map layer.
Higher level functions for reading/writing/manipulating vectors.
(C) 2011-2013 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file open_pg.c.
void notice_processor | ( | void *arg | UNUSED, |
const char * | message | ||
) |
Definition at line 1752 of file open_pg.c.
References G_verbose(), and G_verbose_std().
int V1_open_new_pg | ( | struct Map_info *Map | NOPG_UNUSED, |
const char *name | NOPG_UNUSED, | ||
int with_z | NOPG_UNUSED | ||
) |
Prepare PostGIS database for creating new feature table (level 1)
New PostGIS table is created when writing features by Vect_wrile_line().
[out] | Map | pointer to Map_info structure |
name | name of PostGIS feature table to create | |
with_z | WITH_Z for 3D vector data otherwise WITHOUT_Z |
Definition at line 225 of file open_pg.c.
References _, Format_info_pg::conninfo, DB_SQL_MAX, G_debug(), G_warning(), name, Format_info_pg::res, and Format_info_pg::table_name.
int V1_open_old_pg | ( | struct Map_info *Map | NOPG_UNUSED, |
int update | NOPG_UNUSED | ||
) |
Open vector map - PostGIS feature table on non-topological level.
[in,out] | Map | pointer to Map_info structure |
update | TRUE for write mode, otherwise read-only |
Definition at line 73 of file open_pg.c.
References _, Format_info_pg::conn, Format_info_pg::conninfo, DB_SQL_MAX, G_debug(), G_warning(), and Format_info_pg::table_name.
int V2_open_old_pg | ( | struct Map_info *Map | NOPG_UNUSED | ) |
Open vector map - PostGIS feature table on topological level.
Simple feature access:
[in,out] | Map | pointer to Map_info structure |
Definition at line 166 of file open_pg.c.
References _, Format_info_pg::conn, DB_SQL_MAX, G_debug(), G_fatal_error(), G_warning(), G_zero(), Format_info_pg::offset, Format_info_pg::res, Format_info_pg::toposchema_id, Format_info_pg::toposchema_name, Vect_get_full_name(), and Vect_open_fidx().
int Vect__load_map_lines_pg | ( | struct Map_info * | Map | ) |
Read features from DB.
Map | pointer to Map_info struct |
Definition at line 1557 of file open_pg.c.
References _, Format_info_pg::conn, DB_SQL_MAX, dig_alloc_lines(), Format_info_pg::fid_column, Map_info::fInfo, G_debug(), G_warning(), G_zero(), Plus_head::Line, Plus_head::n_lines, Plus_head::n_plines, Format_info_pg::offset, Format_info::pg, Map_info::plus, Format_info_pg::schema_name, Format_info_pg::table_name, Format_info_pg::topo_geo_only, Format_info_pg::topogeom_column, and Format_info_pg::toposchema_name.
int Vect__load_map_nodes_pg | ( | struct Map_info * | Map, |
int | geom_only | ||
) |
Read nodes from DB.
Map | pointer to Map_info struct |
geom_only | read only node's geometry |
Definition at line 1484 of file open_pg.c.
References _, Format_info_offset::array, Format_info_offset::array_alloc, Format_info_offset::array_num, Format_info_pg::conn, DB_SQL_MAX, dig_alloc_nodes(), Map_info::fInfo, G_debug(), G_malloc, G_warning(), Plus_head::n_nodes, Format_info_pg::offset, Format_info::pg, Map_info::plus, Format_info_pg::topo_geo_only, and Format_info_pg::toposchema_name.
int Vect__load_plus_head | ( | struct Map_info * | Map | ) |
Read topo from PostGIS topology schema – header info only.
[in,out] | plus | pointer to Plus_head struct |
Definition at line 1125 of file open_pg.c.
References _, Format_info_pg::conn, DB_SQL_MAX, Map_info::fInfo, G_debug(), G_warning(), Plus_head::off_t_size, Format_info::pg, Map_info::plus, Format_info_pg::schema_name, Format_info_pg::table_name, Format_info_pg::topogeom_column, and Format_info_pg::toposchema_id.
int Vect__load_plus_pg | ( | struct Map_info * | Map, |
int | head_only | ||
) |
Read topo info from PostGIS topology schema.
pg_info | pointer to Format_info_pg | |
[in,out] | plus | pointer to Plus_head struct |
head_only | TRUE to read only header info |
int Vect__open_topo_pg | ( | struct Map_info *Map | NOPG_UNUSED, |
int head_only | NOPG_UNUSED, | ||
int update | NOPG_UNUSED | ||
) |
Read full-topology for PostGIS links.
Note: Only 2D topological primitives are currently supported
[in,out] | Map | pointer to Map_info structure |
head_only | TRUE to read only header | |
update | TRUE to clean GRASS topology in update mode |
Definition at line 326 of file open_pg.c.
References VECT_OPEN_CODE.