18 #include <sys/types.h> 37 int i, s, type, line, counter;
45 G_debug(3,
"Vect_build_nat() build = %d", build);
49 if (build == plus->
built)
53 if (build < plus->built) {
89 else if (type == -2) {
99 G_debug(3,
"Register line: offset = %lu", (
unsigned long)offset);
109 for (c = 0; c < Cats->
n_cats; c++) {
120 G_verbose_message(
n_(
"One vertex registered",
"%" PRId64
" vertices registered", npoints), npoints);
135 for (line = 1; line <= plus->
n_lines; line++) {
141 Line = plus->
Line[line];
147 for (s = 0; s < 2; s++) {
153 G_debug(3,
"Build area for line = %d, side = %d", line, side);
171 for (i = 1; i <= plus->
n_isles; i++) {
192 for (line = 1; line <= plus->
n_lines; line++) {
194 Line = plus->
Line[line];
207 G_debug(3,
"Centroid (line=%d) in area %d", line, area);
228 for (i = 1; i <= plus->
n_areas; i++) {
237 for (c = 0; c < Cats->
n_cats; c++) {
int Vect_build_nat(struct Map_info *Map, int build)
Build topology.
plus_t n_areas
Current number of areas.
int Vect_build_line_area(struct Map_info *, int, int)
Build area on given side of line (GV_LEFT or GV_RIGHT)
int built
Highest level of topology currently available.
void void void G_important_message(const char *,...) __attribute__((format(printf
plus_t area
Area number, negative for duplicate centroid.
#define GV_LEFT
Boundary side indicator left/right.
struct P_line ** Line
Array of vector geometries.
int Vect_box_copy(struct bound_box *, const struct bound_box *)
Copy box B to box A.
#define GV_BUILD_BASE
Topology levels - basic level (without areas and isles)
#define n_(strs, strp, num)
struct P_area ** Area
Array of areas.
int dig_line_box(const struct line_pnts *, struct bound_box *)
int n_points
Number of points.
void G_progress(long, int)
Print progress info messages.
plus_t n_isles
Current number of isles.
plus_t centroid
Number of first centroid within area.
plus_t n_lines
Current number of lines.
int dig_cidx_add_cat(struct Plus_head *, int, int, int, int)
int dig_add_line(struct Plus_head *, int, const struct line_pnts *, const struct bound_box *, off_t)
Add new line to Plus_head structure.
void G_message(const char *,...) __attribute__((format(printf
double * x
Array of X coordinates.
Feature geometry info - coordinates.
Basic topology-related info.
#define GV_BUILD_AREAS
Topology levels - build areas.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
void Vect_destroy_cats_struct(struct line_cats *)
Frees all memory associated with line_cats structure, including the struct itself.
void * topo
Topology info.
int Vect_attach_isle(struct Map_info *, int, const struct bound_box *)
(Re)Attach isle to area
int n_cats
Number of categories attached to element.
int * cat
Array of categories.
struct Plus_head plus
Plus info (topology, version, ...)
int Vect_box_extend(struct bound_box *, const struct bound_box *)
Extend box A by box B.
struct bound_box box
Bounding box of features.
int Vect_rewind(struct Map_info *)
Rewind vector map to cause reads to start at beginning.
int Vect_get_isle_box(const struct Map_info *, int, struct bound_box *)
Get bounding box of isle.
struct dig_head head
Header info.
#define GV_BUILD_ATTACH_ISLES
Topology levels - attach islands to areas.
int Vect_find_area(struct Map_info *, double, double)
Find the nearest area.
void G_percent(long, long, int)
Print percent complete messages.
double * y
Array of Y coordinates.
struct line_cats * Vect_new_cats_struct(void)
Creates and initializes line_cats structure.
void G_warning(const char *,...) __attribute__((format(printf
off_t last_offset
Offset of last read line.
plus_t n_clines
Current number of centroids.
#define GV_BUILD_CENTROIDS
Topology levels - assign centroids to areas.
int * field
Array of layers (fields)
#define GV_BUILD_ALL
Topology levels - build everything (currently same as GV_BUILD_CENTROIDS)
int Vect_read_next_line(const struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
plus_t n_blines
Current number of boundaries.
void void G_verbose_message(const char *,...) __attribute__((format(printf
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int G_debug(int, const char *,...) __attribute__((format(printf
void Vect__build_downgrade(struct Map_info *, int)
Downgrade build level (for internal use only)