GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Vector library - constraints for reading features. More...
Go to the source code of this file.
Functions | |
int | Vect_set_constraint_region (struct Map_info *Map, double n, double s, double e, double w, double t, double b) |
Set constraint region. More... | |
int | Vect_get_constraint_box (struct Map_info *Map, struct bound_box *Box) |
Get constraint box. More... | |
int | Vect_set_constraint_type (struct Map_info *Map, int type) |
Set constraint type. More... | |
void | Vect_remove_constraints (struct Map_info *Map) |
Remove all constraints. More... | |
int | Vect_set_constraint_field (struct Map_info *Map, int field) |
Set constraint field. More... | |
Vector library - constraints for reading features.
Higher level functions for reading/writing/manipulating vectors.
These routines can affect the Vect_read_next_line() functions by restricting what they return. They are applied on a per map basis.
These do not affect the lower level direct read functions.
Normally, all 'Alive' lines will be returned unless overridden by this function. You can specified all the types you are interested in (by oring their types together). You can use this to say exclude 'boundary' type features.
By default all DEAD lines are ignored by the Vect_read_next_line() functions. This too can be overridden by including their types.
(C) 2001-2009, 2011-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 constraint.c.
Get constraint box.
Constraint box can be defined by Vect_set_constraint_region().
Map | vector map | |
[out] | Box | bounding box |
Definition at line 79 of file constraint.c.
References bound_box::B, Map_info::box, Box, Map_info::constraint, bound_box::E, bound_box::N, Map_info::region_flag, bound_box::S, bound_box::T, and bound_box::W.
Referenced by V1_read_next_line_nat().
void Vect_remove_constraints | ( | struct Map_info * | Map | ) |
Remove all constraints.
Map | pointer to Map_info struct |
Definition at line 122 of file constraint.c.
References Map_info::constraint, FALSE, Map_info::field_flag, Map_info::region_flag, and Map_info::type_flag.
int Vect_set_constraint_field | ( | struct Map_info * | Map, |
int | field | ||
) |
Set constraint field.
Vect_read_next_line() will read only features of given type. Note that categories must be read otherwise this constraint is ignored. Constraint is ignored for random access - Vect_read_line().
Ignored for non-native vector formats.
Note: Field is called layer on user level.
Map | pointer to Map_info struct |
field | field number (-1 for all fields) |
Definition at line 147 of file constraint.c.
References _, Map_info::constraint, FALSE, Map_info::field, Map_info::field_flag, Map_info::format, G_warning(), GV_FORMAT_NATIVE, and TRUE.
int Vect_set_constraint_region | ( | struct Map_info * | Map, |
double | n, | ||
double | s, | ||
double | e, | ||
double | w, | ||
double | t, | ||
double | b | ||
) |
Set constraint region.
Vect_read_next_line() will read only features inside of given region or features with overlapping bounding box.
Map | pointer to Map_info struct |
n,s,e,w,t,b | bbox definition (north, south, east, west, top, and bottom coordinates) |
Definition at line 48 of file constraint.c.
int Vect_set_constraint_type | ( | struct Map_info * | Map, |
int | type | ||
) |
Set constraint type.
Vect_read_next_line() will read only features of given type. Constraint is ignored for random access - Vect_read_line().
Map | pointer to Map_info struct |
type | constraint feature type (GV_POINT, GV_LINE, ...) |
Definition at line 106 of file constraint.c.