GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
Vector library - category array. More...
Go to the source code of this file.
Functions | |
struct varray * | Vect_new_varray (int size) |
Create new struct varray and allocate space for given number of items. More... | |
int | Vect_set_varray_from_cat_string (struct Map_info *Map, int field, const char *cstring, int type, int value, struct varray *varray) |
Set values in 'varray' to 'value' from category string. More... | |
int | Vect_set_varray_from_cat_list (struct Map_info *Map, int field, struct cat_list *clist, int type, int value, struct varray *varray) |
Set values in 'varray' to 'value' from category list. More... | |
int | Vect_set_varray_from_db (struct Map_info *Map, int field, const char *where, int type, int value, struct varray *varray) |
Set values in 'varray' to 'value' from DB (where statement) More... | |
Vector library - category array.
Higher level functions for reading/writing/manipulating vectors.
(C) 2001-2009 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 array.c.
struct varray* Vect_new_varray | ( | int | size | ) |
Create new struct varray and allocate space for given number of items.
Space allocated is 'size + 1' so that lines are accessed by line id. Array values are set to 0.
size | size of array |
Definition at line 39 of file array.c.
References varray::c, G_calloc, G_free(), G_malloc, NULL, and varray::size.
Referenced by NetA_initialise_varray().
int Vect_set_varray_from_cat_list | ( | struct Map_info * | Map, |
int | field, | ||
struct cat_list * | clist, | ||
int | type, | ||
int | value, | ||
struct varray * | varray | ||
) |
Set values in 'varray' to 'value' from category list.
If category of object of given type is in clist (category list). type may be either: GV_AREA or: GV_POINT | GV_LINE | GV_BOUNDARY | GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are overwritten. Array must be initialised by Vect_new_varray() call.
Map | vector map | |
field | layer number | |
clist | list of categories | |
type | feature type | |
value | value to set up | |
[out] | varray | varray structure to modify |
int Vect_set_varray_from_cat_string | ( | struct Map_info * | Map, |
int | field, | ||
const char * | cstring, | ||
int | type, | ||
int | value, | ||
struct varray * | varray | ||
) |
Set values in 'varray' to 'value' from category string.
If category of object of given type is in cstring (string representing category list like: '1,3,5-7'). type may be either: GV_AREA or: GV_POINT | GV_LINE | GV_BOUNDARY | GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are overwritten. Array must be initialised by Vect_new_varray() call.
Map | vector map | |
field | layer number | |
cstring | pointer to string with categories | |
type | feature type | |
value | value to set up | |
[out] | varray | varray structure to modify |
Definition at line 79 of file array.c.
Referenced by NetA_initialise_varray().
int Vect_set_varray_from_db | ( | struct Map_info * | Map, |
int | field, | ||
const char * | where, | ||
int | type, | ||
int | value, | ||
struct varray * | varray | ||
) |
Set values in 'varray' to 'value' from DB (where statement)
I category of object of given type is in categories selected from DB based on where statement (given without where). type may be either: GV_AREA or: GV_POINT | GV_LINE | GV_BOUNDARY | GV_CENTROID
Array is not reset to zero before, but old values (if any > 0) are overwritten. Array must be initialised by Vect_new_varray() call.
Map | vector map | |
field | layer number | |
where | where statement | |
type | feature type | |
value | value to set up | |
[out] | varray | varray structure to modify |
Definition at line 242 of file array.c.
Referenced by NetA_initialise_varray().