|
GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
Vector library - Manipulate vector map (copy, rename, delete) More...
#include <stdlib.h>#include <stdio.h>#include <dirent.h>#include <string.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <errno.h>#include <grass/glocale.h>#include <grass/vector.h>#include <grass/dbmi.h>#include "local_proto.h"
Go to the source code of this file.
Functions | |
| struct Map_info * | Vect_new_map_struct (void) |
| Creates and initializes Map_info structure. More... | |
| void | Vect_destroy_map_struct (struct Map_info *p) |
| Frees all memory associated with a Map_info structure, including the structure itself. More... | |
| int | Vect_copy (const char *in, const char *mapset, const char *out) |
| Copy vector map including attribute tables. More... | |
| int | Vect_rename (const char *in, const char *out) |
| Rename existing vector map (in the current mapset). More... | |
| int | Vect_delete (const char *map) |
| Delete vector map including attribute tables. More... | |
| int | Vect__delete (const char *map, int is_tmp) |
| Delete vector map (internal use only) More... | |
| void | Vect_set_release_support (struct Map_info *Map) |
| Set spatial index to be realease when vector is closed. More... | |
| void | Vect_set_category_index_update (struct Map_info *Map) |
| Set category index to be updated when vector is changed. More... | |
Vector library - Manipulate vector map (copy, rename, delete)
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2009, 2012 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 map.c.
| int Vect__delete | ( | const char * | map, |
| int | is_tmp | ||
| ) |
Delete vector map (internal use only)
| map | name of vector map to be delete |
| is_tmp | TRUE for temporary maps |
Definition at line 384 of file map.c.
References GMAPSET_MAX, GNAME_MAX, and GPATH_MAX.
Referenced by Vect_delete().
| int Vect_copy | ( | const char * | in, |
| const char * | mapset, | ||
| const char * | out | ||
| ) |
Copy vector map including attribute tables.
Note: Output vector map is overwritten if exists!
| in | name if vector map to be copied |
| mapset | mapset name where the input map is located |
| out | name for output vector map (new map is created in current mapset) |
Definition at line 124 of file map.c.
References _, G_debug(), G_fatal_error(), G_file_name(), G_find_vector2(), G_make_mapset_element(), G_mapset(), G_name_is_fully_qualified(), G_warning(), GMAPSET_MAX, GNAME_MAX, GPATH_MAX, GV_CIDX_ELEMENT, GV_COOR_ELEMENT, GV_DIRECTORY, GV_FRMT_ELEMENT, GV_HEAD_ELEMENT, GV_HIST_ELEMENT, GV_SIDX_ELEMENT, GV_TOPO_ELEMENT, NULL, Vect_delete(), and Vect_legal_filename().
Referenced by M_do_copy().
| int Vect_delete | ( | const char * | map | ) |
Delete vector map including attribute tables.
Vector map must be located in current mapset.
| map | name of vector map to be delete |
Definition at line 370 of file map.c.
References FALSE, and Vect__delete().
Referenced by M_do_remove(), and Vect_copy().
| void Vect_destroy_map_struct | ( | struct Map_info * | p | ) |
| struct Map_info* Vect_new_map_struct | ( | void | ) |
Creates and initializes Map_info structure.
To free allocated memory call Vect_destroy_map_struct().
Definition at line 41 of file map.c.
References _, G_fatal_error(), G_zero(), malloc(), and NULL.
| int Vect_rename | ( | const char * | in, |
| const char * | out | ||
| ) |
Rename existing vector map (in the current mapset).
Attribute tables are created in the same database where input tables were stored.
The origial format (native/OGR) is used.
Note: Output vector map is overwritten if exists!
| in | name of vector map to be renamed |
| out | name for output vector map |
Definition at line 234 of file map.c.
Referenced by M_do_rename().
| void Vect_set_category_index_update | ( | struct Map_info * | Map | ) |
Set category index to be updated when vector is changed.
By default, category index is not updated if vector is changed, this function sets category index update.
WARNING: currently only category for elements is updated not for areas
| Map | vector map |
Definition at line 560 of file map.c.
References Map_info::plus, TRUE, and Plus_head::update_cidx.
| void Vect_set_release_support | ( | struct Map_info * | Map | ) |
Set spatial index to be realease when vector is closed.
By default, the memory occupied by spatial index is not released.
| Map | vector map |
Definition at line 544 of file map.c.
References Map_info::plus, Plus_head::release_support, and TRUE.