66 int operator,
struct Map_info * OMap)
107 int i, j, k, line, altype, bltype, oltype, area, centr;
110 struct ilist *AOList, *BOList;
128 _(
"Overlay: line/boundary types not supported by AND operator"));
132 _(
"Overlay: area x area types not supported by AND operator"));
140 G_debug(3,
"overlay: AND: point x point");
146 box.
E = box.
W = Points->
x[0];
147 box.
N = box.
S = Points->
y[0];
148 box.
T = box.
B = Points->
z[0];
162 for (k = 0; k < ACats->
n_cats; k++)
165 for (k = 0; k < BCats->
n_cats; k++)
183 G_debug(3,
"overlay: AND: point x area");
197 for (k = 0; k < ACats->
n_cats; k++)
203 for (k = 0; k < BCats->
n_cats; k++)
217 G_debug(3,
"overlay: AND: area x point");
231 for (k = 0; k < BCats->
n_cats; k++)
237 for (k = 0; k < ACats->
n_cats; k++)
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
plus_t Vect_get_num_lines(struct Map_info *)
Fetch number of features (points, lines, boundaries, centroids) in vector map.
int Vect_reset_cats(struct line_cats *)
Reset category structure to make sure cats structure is clean to be re-used.
int Vect_cat_set(struct line_cats *, int, int)
Add new field/cat to category structure if doesn't exist yet.
struct boxlist * Vect_new_boxlist(int)
Creates and initializes a struct boxlist.
void Vect_destroy_boxlist(struct boxlist *)
Frees all memory associated with a struct boxlist, including the struct itself.
void Vect_destroy_list(struct ilist *)
Frees all memory associated with a struct ilist, including the struct itself.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
struct ilist * Vect_new_list(void)
Creates and initializes a struct ilist.
off_t Vect_write_line(struct Map_info *, int, const struct line_pnts *, const struct line_cats *)
Writes a new feature.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_select_lines_by_box(struct Map_info *, const struct bound_box *, int, struct boxlist *)
Select lines with bounding boxes by box.
int Vect_val_in_list(const struct ilist *, int)
Find a given item in the list.
int Vect_get_area_centroid(struct Map_info *, int)
Returns centroid id for given area.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
#define GV_ON_AND
Overlay operators.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
int Vect_overlay_and(struct Map_info *, int, struct ilist *, struct ilist *, struct Map_info *, int, struct ilist *, struct ilist *, struct Map_info *)
int Vect_overlay_str_to_operator(const char *str)
Get operator code from string.
int Vect_overlay(struct Map_info *AMap, int atype, struct ilist *AList, struct ilist *AAList, struct Map_info *BMap, int btype, struct ilist *BList, struct ilist *BAList, int operator, struct Map_info *OMap)
Overlay 2 vector maps and create new one.
List of bounding boxes with id.
int n_values
Number of items in the list.
int * field
Array of layers (fields)
int * cat
Array of categories.
int n_cats
Number of categories attached to element.
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
double * x
Array of X coordinates.
double * z
Array of Z coordinates.