Vector library - Open vector map. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <grass/glocale.h>
#include <grass/gis.h>
#include <grass/Vect.h>
Go to the source code of this file.
Defines | |
#define | MAX_OPEN_LEVEL 2 |
Functions | |
int | Vect_set_open_level (int level) |
Predetermine level at which a map will be opened for reading. | |
int | Vect__open_old (struct Map_info *Map, const char *name, const char *mapset, int update, int head_only) |
Open old vector for reading. | |
int | Vect_open_old (struct Map_info *Map, const char *name, const char *mapset) |
Open existing vector for reading. | |
int | Vect_open_update (struct Map_info *Map, const char *name, const char *mapset) |
Open existing vector for reading/writing. | |
int | Vect_open_old_head (struct Map_info *Map, const char *name, const char *mapset) |
Reads only info about vector from headers of 'head', 'dbln', 'topo' and 'cidx' file. | |
int | Vect_open_update_head (struct Map_info *Map, const char *name, const char *mapset) |
Open old vector head for updating (mostly for database link updates). | |
int | Vect_open_new (struct Map_info *Map, const char *name, int with_z) |
Open new vector for reading/writing. | |
int | Vect_coor_info (struct Map_info *Map, struct Coor_info *Info) |
Update Coor_info structure. | |
const char * | Vect_maptype_info (struct Map_info *Map) |
Gets maptype (native, shape, postgis). | |
int | Vect_open_topo (struct Map_info *Map, int head_only) |
Open topo file. | |
int | Vect_open_spatial_index (struct Map_info *Map) |
Open spatial index file. |
Vector library - Open vector map.
Higher level functions for reading/writing/manipulating vectors.
(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 open.c.
#define MAX_OPEN_LEVEL 2 |
Definition at line 30 of file open.c.
Referenced by Vect_set_open_level().
int Vect__open_old | ( | struct Map_info * | Map, | |
const char * | name, | |||
const char * | mapset, | |||
int | update, | |||
int | head_only | |||
) |
Open old vector for reading.
In case of error, the functions respect fatal error settings.
[out] | Map | vector map |
[in] | name | name of vector map to open |
[in] | mapset | mapset name |
[in] | update | open for update |
[in] | head_only | read only header info from 'head', 'dbln', 'topo', 'cidx' is not opened. The header may be opened on level 2 only. |
Definition at line 125 of file open.c.
References dig_cidx_free(), dig_free_plus(), dig_init_plus(), dig_read_frmt_ascii(), dig_spidx_free(), Node::level, V2_open_old_ogr(), Vect__init_head(), Vect__read_head(), Vect_cidx_open(), Vect_get_fatal_error(), Vect_get_full_name(), Vect_hist_write(), Vect_new_dblinks_struct(), Vect_open_topo(), Vect_read_dblinks(), Vect_rewind(), and Vect_set_fatal_error().
Referenced by Vect_open_old(), Vect_open_old_head(), Vect_open_update(), and Vect_open_update_head().
int Vect_coor_info | ( | struct Map_info * | Map, | |
struct Coor_info * | Info | |||
) |
Update Coor_info structure.
[in] | Map | vector map |
[out] | Info | Coor_info structure |
Definition at line 611 of file open.c.
References dig_fseek(), and dig_ftell().
Referenced by V1_close_nat(), Vect_close(), and Vect_open_topo().
const char* Vect_maptype_info | ( | struct Map_info * | Map | ) |
int Vect_open_new | ( | struct Map_info * | Map, | |
const char * | name, | |||
int | with_z | |||
) |
Open new vector for reading/writing.
[out] | Map | vector map |
[in] | name | name of vector map |
[in] | with_z | 2D/3D vector map |
Definition at line 517 of file open.c.
References dig_init_plus(), V1_open_new_nat(), Vect__init_head(), Vect_delete(), Vect_get_fatal_error(), Vect_get_full_name(), Vect_legal_filename(), Vect_new_dblinks_struct(), and Vect_set_fatal_error().
int Vect_open_old | ( | struct Map_info * | Map, | |
const char * | name, | |||
const char * | mapset | |||
) |
Open existing vector for reading.
In case of error, the functions respect fatal error settings.
[out] | Map | vector map |
[in] | name | name of vector map |
[in] | mapset | mapset name |
Definition at line 413 of file open.c.
References Vect__open_old().
int Vect_open_old_head | ( | struct Map_info * | Map, | |
const char * | name, | |||
const char * | mapset | |||
) |
Reads only info about vector from headers of 'head', 'dbln', 'topo' and 'cidx' file.
In case of error, the functions respect fatal error settings.
[out] | Map | vector map |
[in] | name | name of vector map to read |
[in] | mapset | mapset name |
Definition at line 468 of file open.c.
References Vect__open_old().
Referenced by Vect_copy(), and Vect_delete().
int Vect_open_spatial_index | ( | struct Map_info * | Map | ) |
Open spatial index file.
[in,out] | Map | vector map |
Definition at line 770 of file open.c.
References dig_file_init(), dig_read_spidx(), and dig_spidx_init().
int Vect_open_topo | ( | struct Map_info * | Map, | |
int | head_only | |||
) |
Open topo file.
[in,out] | Map | vector map |
[in] | head_only | open only head |
Definition at line 689 of file open.c.
References dig_file_init(), dig_load_plus(), dig_Rd_Plus_head(), and Vect_coor_info().
Referenced by Vect__open_old().
int Vect_open_update | ( | struct Map_info * | Map, | |
const char * | name, | |||
const char * | mapset | |||
) |
Open existing vector for reading/writing.
In case of error, the functions respect fatal error settings.
[out] | Map | vector map |
[in] | name | name of vector map to update |
[in] | mapset | mapset name |
Definition at line 431 of file open.c.
References Vect__open_old(), and Vect_build_sidx_from_topo().
int Vect_open_update_head | ( | struct Map_info * | Map, | |
const char * | name, | |||
const char * | mapset | |||
) |
Open old vector head for updating (mostly for database link updates).
In case of error, the functions respect fatal error settings.
[out] | Map | vector map |
[in] | name | name of vector map to update |
[in] | mapset | mapset name |
Definition at line 486 of file open.c.
References Vect__open_old().
Referenced by Vect_copy(), and Vect_rename().
int Vect_set_open_level | ( | int | level | ) |
Predetermine level at which a map will be opened for reading.
If it can't open that level, the open will fail. The specified level must be set before any call to open. The default is to try to open the highest level possible, and keep stepping down until success.
NOTE!! This should only be used to set when you wish to force a lower level open. If you require a higher level, then just check the return to verify the level instead of forcing it. This is because future releases will have higher levels which will be downward compatible and which your programs should support by default.
[in] | level | vector (topo) level |
Definition at line 96 of file open.c.
References MAX_OPEN_LEVEL.
Referenced by Vect_copy(), Vect_delete(), and Vect_rename().