GRASS Programmer's Manual 6.4.1(2011)
|
Vector library - field(layer) related fns. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <grass/glocale.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/Vect.h>
#include <gdal_version.h>
#include <ogr_api.h>
Go to the source code of this file.
Functions | |
struct dblinks * | Vect_new_dblinks_struct (void) |
Create and init new dblinks ctructure. | |
void | Vect_reset_dblinks (struct dblinks *p) |
Reset dblinks structure. | |
int | Vect_map_add_dblink (struct Map_info *Map, int number, const char *name, const char *table, const char *key, const char *db, const char *driver) |
Add new db connection to Map_info structure. | |
int | Vect_map_del_dblink (struct Map_info *Map, int field) |
Delete db connection from Map_info structure. | |
int | Vect_map_check_dblink (struct Map_info *Map, int field) |
Check if db connection exists in dblinks structure. | |
int | Vect_check_dblink (struct dblinks *p, int field) |
Check if db connection exists in dblinks structure. | |
int | Vect_add_dblink (struct dblinks *p, int number, const char *name, const char *table, const char *key, const char *db, const char *driver) |
Add new db connection to dblinks structure. | |
struct field_info * | Vect_default_field_info (struct Map_info *Map, int field, const char *field_name, int type) |
Get default information about link to database for new dblink. | |
struct field_info * | Vect_get_dblink (struct Map_info *Map, int link) |
Get information about link to database. | |
struct field_info * | Vect_get_field (struct Map_info *Map, int field) |
Get information about link to database. | |
int | Vect_read_dblinks (struct Map_info *Map) |
Read dblinks to existing structure. | |
int | Vect_write_dblinks (struct Map_info *Map) |
Write dblinks to file. | |
char * | Vect_subst_var (const char *in, struct Map_info *Map) |
Substitute variable in string. | |
void | Vect_set_db_updated (struct Map_info *Map) |
Rewrite 'dbln' file. |
Vector library - field(layer) related fns.
Higher level functions for reading/writing/manipulating vectors.
TODO: see Vect_read_dblinks; activate auto-FID detection once OGR_L_GetFIDColumn() is working or solution found if FID not available
(C) 2001-2008 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 field.c.
int Vect_add_dblink | ( | struct dblinks * | p, |
int | number, | ||
const char * | name, | ||
const char * | table, | ||
const char * | key, | ||
const char * | db, | ||
const char * | driver | ||
) |
Add new db connection to dblinks structure.
p | pointer to existing dblinks structure |
number | layer number |
name | layer name |
key | key name |
db | database name |
driver | driver name |
Definition at line 214 of file field.c.
References Vect_check_dblink().
Referenced by Vect_map_add_dblink(), and Vect_read_dblinks().
int Vect_check_dblink | ( | struct dblinks * | p, |
int | field | ||
) |
Check if db connection exists in dblinks structure.
p | pointer to existing dblinks structure |
field | layer number |
Definition at line 185 of file field.c.
Referenced by Vect_add_dblink(), and Vect_map_check_dblink().
struct field_info* Vect_default_field_info | ( | struct Map_info * | Map, |
int | field, | ||
const char * | field_name, | ||
int | type | ||
) | [read] |
Get default information about link to database for new dblink.
Map | vector map |
field | layer number |
field_name | layer name |
type | how many tables are linked to map: GV_1TABLE / GV_MTABLE |
Definition at line 278 of file field.c.
Referenced by Vect_copy(), Vect_copy_table_by_cats(), Vect_copy_tables(), and Vect_rename().
struct field_info* Vect_get_dblink | ( | struct Map_info * | Map, |
int | link | ||
) | [read] |
Get information about link to database.
Variables are substituted by values, link is index to array of dblinks
Map | vector map |
link | link id |
Definition at line 364 of file field.c.
References Vect_subst_var().
Referenced by Vect_copy(), Vect_copy_tables(), Vect_delete(), Vect_get_field(), and Vect_rename().
struct field_info* Vect_get_field | ( | struct Map_info * | Map, |
int | field | ||
) | [read] |
Get information about link to database.
Variables are substituted by values, field is number of requested field
Map | vector map |
field | layer number |
Definition at line 404 of file field.c.
References Vect_get_dblink().
Referenced by Vect_copy_table_by_cats(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), Vect_rename(), and Vect_set_varray_from_db().
int Vect_map_add_dblink | ( | struct Map_info * | Map, |
int | number, | ||
const char * | name, | ||
const char * | table, | ||
const char * | key, | ||
const char * | db, | ||
const char * | driver | ||
) |
Add new db connection to Map_info structure.
Map | vector map |
number | layer number |
name | layer name |
table | table name |
key | key name |
db | database name |
driver | driver name |
Definition at line 86 of file field.c.
References Vect_add_dblink(), and Vect_write_dblinks().
Referenced by Vect_copy(), Vect_copy_table_by_cats(), Vect_copy_tables(), and Vect_rename().
int Vect_map_check_dblink | ( | struct Map_info * | Map, |
int | field | ||
) |
Check if db connection exists in dblinks structure.
Map | vector map |
field | layer number |
Definition at line 171 of file field.c.
References Vect_check_dblink().
int Vect_map_del_dblink | ( | struct Map_info * | Map, |
int | field | ||
) |
Delete db connection from Map_info structure.
Map | vector map |
field | layer number |
Definition at line 125 of file field.c.
References Vect_write_dblinks().
Referenced by Vect_rename().
struct dblinks* Vect_new_dblinks_struct | ( | void | ) | [read] |
Create and init new dblinks ctructure.
void |
Definition at line 45 of file field.c.
Referenced by Vect__open_old(), and Vect_open_new().
int Vect_read_dblinks | ( | struct Map_info * | Map | ) |
Read dblinks to existing structure.
Variables are not substituted by values.
Map | vector map |
Definition at line 431 of file field.c.
References FALSE, Vect_add_dblink(), and Vect_reset_dblinks().
Referenced by Vect__open_old().
void Vect_reset_dblinks | ( | struct dblinks * | p | ) |
Reset dblinks structure.
p | pointer to existing dblinks structure |
Definition at line 66 of file field.c.
Referenced by Vect_read_dblinks().
void Vect_set_db_updated | ( | struct Map_info * | Map | ) |
Rewrite 'dbln' file.
Should be used by GRASS modules which update database tables, so that other applications know that tables were changed and can reload data.
Map | vector map |
Definition at line 801 of file field.c.
References Vect_write_dblinks().
char* Vect_subst_var | ( | const char * | in, |
struct Map_info * | Map | ||
) |
Substitute variable in string.
in | current string |
Map | vector map |
Definition at line 741 of file field.c.
Referenced by Vect_copy(), Vect_copy_table_by_cats(), Vect_copy_tables(), Vect_get_dblink(), and Vect_rename().
int Vect_write_dblinks | ( | struct Map_info * | Map | ) |
Write dblinks to file.
Map | vector map |
Definition at line 690 of file field.c.
Referenced by V1_close_nat(), Vect_map_add_dblink(), Vect_map_del_dblink(), and Vect_set_db_updated().