67 for (area = 1; area <=
nareas; area++) {
99 for (i = 0; i <
List->n_values; i++) {
102 line =
List->value[i];
113 G_debug(4,
" line = %d left = %d right = %d neighbour = %d", line,
124 for (i = 0; i <
AList->n_values; i++) {
131 for (
j = 0;
j <
List->n_values;
j++) {
134 line =
List->value[
j];
156 for (i = 0; i <
List->n_values; i++) {
159 line =
List->value[i];
174 for (i = 0; i <
AList->n_values; i++) {
177 line =
AList->value[i];
229 for (area = 1; area <=
nareas; area++) {
231 double length,
l, size;
263 for (i = 0; i <
List->n_values; i++) {
265 line =
List->value[i];
276 G_debug(4,
" line = %d left = %d right = %d neighbour = %d", line,
288 if ((centroid != 0) + (
ncentroid != 0) != 1)
295 if (
AList->n_values == 1)
302 for (i = 0; i <
AList->n_values; i++) {
319 if ((centroid != 0) + (
ncentroid != 0) == 1)
323 for (
j = 0;
j <
List->n_values;
j++) {
326 line =
List->value[
j];
353 for (i = 0; i <
List->n_values; i++) {
355 line =
List->value[i];
370 G_debug(3,
"remove %d of %d boundaries",
AList->n_values,
376 for (i = 0; i <
nisles; i++) {
382 for (i = 0; i <
AList->n_values; i++) {
385 line =
AList->value[i];
404 G_debug(3,
"dissolve with neighbour area");
411 for (i = 0; i <
nnisles; i++) {
425 for (i = 0; i <
AList->n_values; i++) {
429 line =
AList->value[i];
430 topo = (
struct P_topo_b *)
Map->plus.Line[line]->topo;
431 Node =
Map->plus.Node[topo->
N1];
435 for (i = 0; i <
BList->n_values; i++) {
439 line =
BList->value[i];
440 topo =
Map->plus.Line[
abs(line)]->topo;
442 if (topo->
left == 0 || topo->
right == 0) {
448 "has already been created");
454 Map->plus.Line[centroid]->topo;
472 _(
"Dissolve with neighbour area: corrupt topology"));
475 for (i = 0; i <
NList->n_values; i++) {
478 line =
NList->value[i];
482 topo =
Map->plus.Line[
abs(line)]->topo;
484 if (topo->
left == 0 || topo->
right == 0) {
492 "has already been created");
498 Map->plus.Line[centroid]->topo;
514 _(
"Dissolve with neighbour area: corrupt topology"));
520 G_debug(3,
"dissolve with outer isle");
532 for (i = 0; i <
AList->n_values; i++) {
536 line =
AList->value[i];
537 topo = (
struct P_topo_b *)
Map->plus.Line[line]->topo;
538 Node =
Map->plus.Node[topo->
N1];
542 for (i = 0; i <
BList->n_values; i++) {
545 line =
BList->value[i];
546 topo =
Map->plus.Line[
abs(line)]->topo;
548 if (topo->
left == 0 || topo->
right == 0) {
564 _(
"Dissolve with outer isle: corrupt topology"));
568 for (i = 0; i <
NList->n_values; i++) {
571 line =
NList->value[i];
575 topo =
Map->plus.Line[
abs(line)]->topo;
577 if (topo->
left == 0 || topo->
right == 0) {
593 _(
"Dissolve with outer isle: corrupt topology"));
603 for (i = 0; i <
IList->n_values; i++) {
604 if (!
Map->plus.Isle[
IList->value[i]])
void G_percent(long, long, int)
Print percent complete messages.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_message(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.
double Vect_line_length(const struct line_pnts *)
Calculate line length, 3D-length in case of 3D vector line.
plus_t Vect_get_num_areas(struct Map_info *)
Get number of areas in vector map.
int Vect_area_alive(struct Map_info *, int)
Check if area is alive or dead (topological level required)
int Vect_build_line_area(struct Map_info *, int, int)
Build area on given side of line (GV_LEFT or GV_RIGHT)
int Vect_get_area_boundaries(struct Map_info *, int, struct ilist *)
Creates list of boundaries for given area.
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_get_area_isle(struct Map_info *, int, int)
Returns isle id for area.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int Vect_get_area_num_isles(struct Map_info *, int)
Returns number of isles for given area.
int Vect_line_alive(struct Map_info *, int)
Check if feature is alive or dead (topological level required)
int Vect_get_isle_boundaries(struct Map_info *, int, struct ilist *)
Creates list of boundaries for given isle.
int Vect_delete_line(struct Map_info *, off_t)
Delete existing feature (topological level required)
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
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.
int Vect_get_area_centroid(struct Map_info *, int)
Returns centroid id for given area.
double Vect_get_area_area(struct Map_info *, int)
Returns area of area without areas of isles.
int V1_delete_line_nat(struct Map_info *, off_t)
Deletes feature at level 1 (internal use only)
int Vect_get_line_areas(struct Map_info *, int, int *, int *)
Get area id on the left and right side of the boundary.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
int Vect_get_isle_area(struct Map_info *, int)
Returns area id for isle.
#define GV_LEFT
Boundary side indicator left/right.
#define GV_FORMAT_NATIVE
Geometry data formats supported by lib Don't change GV_FORMAT_* values, this order is hardcoded in li...
int dig_area_add_isle(struct Plus_head *, int, int)
Add isle to area if does not exist yet.
int dig_del_line(struct Plus_head *, int, double, double, double)
Delete line from Plus_head structure.
int dig_del_area(struct Plus_head *, int)
Delete area from Plus_head structure.
int dig_del_isle(struct Plus_head *, int)
Delete island from Plus_head structure.
int Vect_remove_small_areas_nat(struct Map_info *, double, struct Map_info *, double *)
int Vect_remove_small_areas_ext(struct Map_info *, double, struct Map_info *, double *)
int Vect_remove_small_areas(struct Map_info *Map, double thresh, struct Map_info *Err, double *removed_area)
Remove small areas from the map map.
Topological feature - node.
double z
Z coordinate (used only for 3D data)
plus_t left
Area number to the left, negative for isle.
plus_t right
Area number to the right, negative for isle.
plus_t area
Area number, negative for duplicate centroid.
Feature geometry info - coordinates.