|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
|
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. | |
| void | Vect_destroy_map_struct (struct Map_info *p) |
| Frees all memory associated with a Map_info structure, including the structure itself. | |
| int | Vect_copy (const char *in, const char *mapset, const char *out) |
| Copy vector map including attribute tables. | |
| int | Vect_rename (const char *in, const char *out) |
| Rename existing vector map (in the current mapset). | |
| int | Vect_delete (const char *map) |
| Delete vector map including attribute tables. | |
| int | Vect__delete (const char *map, int is_tmp) |
| Delete vector map (internal use only) | |
| void | Vect_set_release_support (struct Map_info *Map) |
| Set spatial index to be released when vector is closed. | |
| void | Vect_set_category_index_update (struct Map_info *Map) |
| Set category index to be updated when vector is changed. | |
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.
Delete vector map (internal use only)
| map | name of vector map to be delete |
| is_tmp | TRUE for temporary maps |
Definition at line 381 of file map.c.
References _, access, closedir(), db_delete_table(), DB_FAILED, db_table_exists(), F_OK, FALSE, G_debug(), G_mapset(), G_name_is_fully_qualified(), G_tempfile(), G_warning(), GMAPSET_MAX, GNAME_MAX, GPATH_MAX, GV_DBLN_ELEMENT, GV_FORMAT_NATIVE, NULL, opendir(), readdir(), rmdir, TRUE, unlink, Vect__get_element_path(), Vect__open_old(), Vect_close(), Vect_get_dblink(), Vect_get_num_dblinks(), and Vect_set_open_level().
Referenced by Vect_delete().
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 125 of file map.c.
References _, access, F_OK, Map_info::format, G_debug(), G_fatal_error(), G_file_name(), G_find_vector2(), G_make_mapset_dir_object(), G_mapset(), G_name_is_fully_qualified(), G_warning(), GMAPSET_MAX, GNAME_MAX, GPATH_MAX, GV_CIDX_ELEMENT, GV_COOR_ELEMENT, GV_DIRECTORY, GV_FORMAT_NATIVE, GV_FRMT_ELEMENT, GV_HEAD_ELEMENT, GV_HIST_ELEMENT, GV_SIDX_ELEMENT, GV_TOPO_ELEMENT, Map_info::mapset, NULL, Vect_close(), Vect_copy_tables(), Vect_delete(), Vect_legal_filename(), Vect_open_old_head(), Vect_open_update_head(), and Vect_set_open_level().
Referenced by M_do_copy().
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 367 of file map.c.
References FALSE, and Vect__delete().
Referenced by M_do_remove(), Vect_copy(), and Vect_rename().
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.
Rename existing vector map (in the current mapset).
Attribute tables are created in the same database where input tables were stored.
The original 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 233 of file map.c.
References _, db_close_database_shutdown_driver(), db_copy_table(), db_create_index2(), db_delete_table(), DB_FAILED, DB_OK, db_start_driver_open_database(), field_info::driver, G_debug(), G_fatal_error(), G_find_vector2(), G_free(), G_malloc, G_mapset(), G_name_is_fully_qualified(), G_rename(), G_warning(), GMAPSET_MAX, GNAME_MAX, GV_1TABLE, GV_DIRECTORY, GV_FORMAT_NATIVE, GV_MTABLE, AMI_STREAM< T >::name(), NULL, Map_info::type, Vect_close(), Vect_default_field_info(), Vect_delete(), Vect_get_dblink(), Vect_get_field(), Vect_get_num_dblinks(), Vect_legal_filename(), Vect_map_add_dblink(), Vect_map_del_dblink(), Vect_open_update_head(), Vect_set_open_level(), and Vect_subst_var().
Referenced by M_do_rename().
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 561 of file map.c.
References TRUE.