GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
dig_externs.h
Go to the documentation of this file.
1#include <grass/gis.h>
2
3#ifndef DIG___EXTERNS___
4#define DIG___EXTERNS___
5
6/*!
7 \file include/grass/vect/dig_externs.h
8
9 \brief Function prototypes for diglib (part of vector library)
10 */
11
12/* allocation.c */
13void *dig_alloc_space(int, int *, int, void *,
14 int); /* exits on error, calls _alloc_space () */
15void *
16dig__alloc_space(int, int *, int, void *,
17 int); /* returns NULL on error, calls calloc(), _frealloc() */
18void *dig_falloc(int, int); /* exits on error, calls _falloc () */
19void *dig_frealloc(void *, int, int,
20 int); /* exits on error, calls _frealloc () */
21void *dig__falloc(int, int); /* returns NULL on error, calls calloc () */
22void *dig__frealloc(void *, int, int,
23 int); /* returns NULL on error, calls calloc () */
24
25/* angle.c */
26float dig_calc_begin_angle(const struct line_pnts *, double);
27float dig_calc_end_angle(const struct line_pnts *, double);
28int dig_line_degenerate(const struct line_pnts *);
29int dig_is_line_degenerate(const struct line_pnts *, double);
30
31/* box.c */
32int dig_box_copy(struct bound_box *, struct bound_box *);
33int dig_box_extend(struct bound_box *, struct bound_box *);
34int dig_line_box(const struct line_pnts *, struct bound_box *);
35
36/*
37 int dig_line_set_box(struct Plus_head *, plus_t, struct bound_box *);
38 int dig_line_get_box(struct Plus_head *, plus_t, struct bound_box *);
39
40 int dig_area_bound_box(struct Map_info *, struct P_area *);
41 int dig_bound_box2(struct line_pnts *, double *, double *, double *, double
42 *, long);
43 */
44
45/* category index */
46/* cindex.c */
47int dig_cidx_init(struct Plus_head *);
48void dig_cidx_free(struct Plus_head *);
49int dig_cidx_add_cat(struct Plus_head *, int, int, int, int);
50int dig_cidx_add_cat_sorted(struct Plus_head *, int, int, int, int);
51int dig_cidx_del_cat(struct Plus_head *, int, int, int, int);
52void dig_cidx_sort(struct Plus_head *);
53
54/* cindex_rw.c */
55int dig_write_cidx_head(struct gvfile *, struct Plus_head *);
56int dig_read_cidx_head(struct gvfile *, struct Plus_head *);
57int dig_write_cidx(struct gvfile *, struct Plus_head *);
58int dig_read_cidx(struct gvfile *, struct Plus_head *, int);
59
60/* file.c */
61/* file loaded to memory; mostly unused */
62off_t dig_ftell(struct gvfile *file);
63int dig_fseek(struct gvfile *file, off_t offset, int whence);
64void dig_rewind(struct gvfile *file);
65int dig_fflush(struct gvfile *file);
66size_t dig_fread(void *ptr, size_t size, size_t nmemb, struct gvfile *file);
67size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb,
68 struct gvfile *file);
69void dig_file_init(struct gvfile *file);
70int dig_file_load(struct gvfile *file);
71void dig_file_free(struct gvfile *file);
72
73/* frmt.c */
74int dig_write_frmt_ascii(FILE *, struct Format_info *, int);
75int dig_read_frmt_ascii(FILE *, struct Format_info *);
76
77/* head.c */
78int dig__write_head(struct Map_info *);
79int dig__read_head(struct Map_info *);
80
81/* inside.c */
82double dig_x_intersect(double, double, double, double, double);
83
84/* linecross.c */
85int dig_test_for_intersection(double, double, double, double, double, double,
86 double, double);
87int dig_find_intersection(double, double, double, double, double, double,
88 double, double, double *, double *);
89
90/* line_dist.c */
91double dig_distance2_point_to_line(double, double, double, double, double,
92 double, double, double, double, int,
93 double *, double *, double *, double *,
94 int *);
96
97/* list.c */
98int dig_init_boxlist(struct boxlist *, int);
99int dig_boxlist_add(struct boxlist *, int, const struct bound_box *);
100
101/* plus.c */
102int dig_init_plus(struct Plus_head *);
103void dig_free_plus_nodes(struct Plus_head *);
104void dig_free_plus_lines(struct Plus_head *);
105void dig_free_plus_areas(struct Plus_head *);
106void dig_free_plus_isles(struct Plus_head *);
107void dig_free_plus(struct Plus_head *);
108int dig_load_plus(struct Plus_head *, struct gvfile *, int);
109int dig_write_plus_file(struct gvfile *, struct Plus_head *);
110int dig_write_nodes(struct gvfile *, struct Plus_head *);
111int dig_write_lines(struct gvfile *, struct Plus_head *);
112int dig_write_areas(struct gvfile *, struct Plus_head *);
113int dig_write_isles(struct gvfile *, struct Plus_head *);
114
115/* plus_area.c */
116int dig_add_area(struct Plus_head *, int, plus_t *, struct bound_box *);
117int dig_area_add_isle(struct Plus_head *, int, int);
118int dig_area_del_isle(struct Plus_head *, int, int);
119int dig_del_area(struct Plus_head *, int);
120int dig_add_isle(struct Plus_head *, int, plus_t *, struct bound_box *);
121int dig_del_isle(struct Plus_head *, int);
122int dig_build_area_with_line(struct Plus_head *, plus_t, int, plus_t **);
123int dig_angle_next_line(struct Plus_head *, plus_t, int, int, float *);
124int dig_node_angle_check(struct Plus_head *, int, int);
127
128/* plus_line.c */
129int dig_add_line(struct Plus_head *, int, const struct line_pnts *,
130 const struct bound_box *, off_t);
131int dig_restore_line(struct Plus_head *, int, int, const struct line_pnts *,
132 const struct bound_box *, off_t);
133int dig_del_line(struct Plus_head *, int, double, double, double);
135int dig_line_set_area(struct Plus_head *, plus_t, int, plus_t);
136
137/* plus_node.c */
138int dig_add_node(struct Plus_head *, double, double, double);
139int dig_which_node(struct Plus_head *, double, double, double);
140
141int dig_node_add_line(struct Plus_head *, int, int, const struct line_pnts *,
142 int);
143float dig_node_line_angle(struct Plus_head *, int, int);
144
145/* plus_struct.c */
146int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *);
147int dig_Wr_P_node(struct Plus_head *, int i, struct gvfile *);
148int dig_Rd_P_line(struct Plus_head *, int i, struct gvfile *);
149int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *);
150int dig_Rd_P_area(struct Plus_head *, int i, struct gvfile *);
151int dig_Wr_P_area(struct Plus_head *, int i, struct gvfile *);
152int dig_Rd_P_isle(struct Plus_head *, int i, struct gvfile *);
153int dig_Wr_P_isle(struct Plus_head *, int i, struct gvfile *);
154int dig_Rd_Plus_head(struct gvfile *, struct Plus_head *);
155int dig_Wr_Plus_head(struct gvfile *, struct Plus_head *);
156
157/* poly.c */
158int dig_find_area_poly(struct line_pnts *, double *);
159double dig_find_poly_orientation(struct line_pnts *);
160int dig_get_poly_points(int, struct line_pnts **, int *, struct line_pnts *);
161
162/* portable.c */
163void dig_init_portable(struct Port_info *, int);
164int dig__byte_order_out(void);
165
166/* int dig__set_cur_head (struct dig_head *); */
167int dig_set_cur_port(struct Port_info *);
168
169int dig__fread_port_D(double *, size_t, struct gvfile *);
170int dig__fread_port_F(float *, size_t, struct gvfile *);
171int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t);
172int dig__fread_port_L(long *, size_t, struct gvfile *);
173int dig__fread_port_S(short *, size_t, struct gvfile *);
174int dig__fread_port_I(int *, size_t, struct gvfile *);
175int dig__fread_port_P(plus_t *, size_t, struct gvfile *);
176int dig__fread_port_C(char *, size_t, struct gvfile *);
177int dig__fwrite_port_D(const double *, size_t, struct gvfile *);
178int dig__fwrite_port_F(const float *, size_t, struct gvfile *);
179int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t);
180int dig__fwrite_port_L(const long *, size_t, struct gvfile *);
181int dig__fwrite_port_S(const short *, size_t, struct gvfile *);
182int dig__fwrite_port_I(const int *, size_t, struct gvfile *);
183int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *);
184int dig__fwrite_port_C(const char *, size_t, struct gvfile *);
185
186/* port_init.c */
187
188/* port_test.c */
189
190/* prune.c */
191int dig_prune(struct line_pnts *, double);
192
193/* spatial index */
194/* spindex.c */
195int dig_spidx_init(struct Plus_head *);
196void dig_spidx_free_nodes(struct Plus_head *);
197void dig_spidx_free_lines(struct Plus_head *);
198void dig_spidx_free_areas(struct Plus_head *);
199void dig_spidx_free_isles(struct Plus_head *);
200void dig_spidx_free(struct Plus_head *);
201
202int dig_spidx_add_node(struct Plus_head *, int, double, double, double);
203int dig_spidx_add_line(struct Plus_head *, int, const struct bound_box *);
204int dig_spidx_add_area(struct Plus_head *, int, const struct bound_box *);
205int dig_spidx_add_isle(struct Plus_head *, int, const struct bound_box *);
206
207int dig_spidx_del_node(struct Plus_head *, int);
208int dig_spidx_del_line(struct Plus_head *, int, double, double, double);
209int dig_spidx_del_area(struct Plus_head *, int);
210int dig_spidx_del_isle(struct Plus_head *, int);
211
212int dig_select_nodes(struct Plus_head *, const struct bound_box *,
213 struct ilist *);
214int dig_select_lines(struct Plus_head *, const struct bound_box *,
215 struct boxlist *);
216int dig_select_areas(struct Plus_head *, const struct bound_box *,
217 struct boxlist *);
218int dig_select_isles(struct Plus_head *, const struct bound_box *,
219 struct boxlist *);
220int dig_find_node(struct Plus_head *, double, double, double);
221int dig_find_line_box(struct Plus_head *, int, struct bound_box *);
222int dig_find_area_box(struct Plus_head *, int, struct bound_box *);
223int dig_find_isle_box(struct Plus_head *, int, struct bound_box *);
224
225/* spindex_rw.c */
226int dig_Rd_spidx_head(struct gvfile *, struct Plus_head *);
227int dig_Wr_spidx_head(struct gvfile *, struct Plus_head *);
228int dig_Wr_spidx(struct gvfile *, struct Plus_head *);
229int dig_Rd_spidx(struct gvfile *, struct Plus_head *);
230
231int dig_dump_spidx(FILE *, const struct Plus_head *);
232
233int rtree_search(struct RTree *, struct RTree_Rect *, SearchHitCallback, void *,
234 struct Plus_head *);
235
236/* struct_alloc.c */
237int dig_node_alloc_line(struct P_node *, int);
238int dig_alloc_nodes(struct Plus_head *, int);
239int dig_alloc_lines(struct Plus_head *, int);
240int dig_alloc_areas(struct Plus_head *, int);
241int dig_alloc_isles(struct Plus_head *, int);
242struct P_node *dig_alloc_node(void);
243struct P_line *dig_alloc_line(void);
244void *dig_alloc_topo(char);
245struct P_area *dig_alloc_area(void);
246struct P_isle *dig_alloc_isle(void);
247void dig_free_node(struct P_node *);
248void dig_free_line(struct P_line *);
249void dig_free_area(struct P_area *);
250void dig_free_isle(struct P_isle *);
251int dig_alloc_points(struct line_pnts *, int);
252int dig_alloc_cats(struct line_cats *, int);
253int dig_area_alloc_line(struct P_area *, int);
254int dig_area_alloc_isle(struct P_area *, int);
255int dig_isle_alloc_line(struct P_isle *, int);
256int dig_out_of_memory(void);
257
258/* type.c */
259/* conversion of types */
260int dig_type_to_store(int);
261int dig_type_from_store(int);
262
263/* update.c */
264/* list of updated */
265void dig_line_reset_updated(struct Plus_head *);
266void dig_line_add_updated(struct Plus_head *, int, off_t);
267void dig_node_reset_updated(struct Plus_head *);
268void dig_node_add_updated(struct Plus_head *, int);
269
270/*********************************************************************
271 * unused/removed functions
272 *********************************************************************/
273
274char *color_name(int); /* pass it an int, returns the name of the color */
275
276char *dig_float_point(char *, int, double);
277
278/* double dig_point_in_area (struct Map_info *, double, double, struct P_area
279 * *); */
280
282
283/* portable data routines - only to be called by library routines! */
284double *dig__double_convert(double *, double *, int, struct dig_head *);
285float *dig__float_convert(float *, float *, int, struct dig_head *);
286short *dig__short_convert(short *in, short *out, int, struct dig_head *);
287long *dig__long_convert(long *, long *, int, struct dig_head *);
288long *dig__int_convert(int *, long *, int, struct dig_head *);
289long *dig__plus_t_convert(plus_t *, long *, int, struct dig_head *);
290int *dig__long_convert_to_int(long *, int *, int, struct dig_head *);
293
294plus_t **dig_get_cont_lines(struct Map_info *, plus_t, double, int);
296
297struct dig_head *dig_get_head(void);
299
300/* int dig_check_nodes (struct Map_info *, struct new_node *,
301 struct line_pnts *); int dig_in_area_bbox (struct P_area *, double, double); */
302int dig_start_clock(long *);
303int dig_stop_clock(long *);
304char *dig_stop_clock_str(long *);
305int dig_write_file_checks(struct gvfile *, struct Plus_head *);
306int dig_do_file_checks(struct Map_info *, char *, char *);
307
308/* int dig_find_area (struct Map_info *, struct P_area *, double *, double *,
309 double *, double); int dig_find_area2 (struct Map_info *, struct P_area *,
310 double *); */
311
312int dig_map_to_head(struct Map_info *, struct Plus_head *);
313int dig_head_to_map(struct Plus_head *, struct Map_info *);
315
316/* int dig_snap_line_to_node (struct Map_info *, int, int, struct line_pnts *);
317 */
318
319/* int dig_node_del_line (struct Plus_head *plus, int node, int line);
320 int dig_add_line_to_node (int, int, char, struct Map_info *, struct line_pnts
321 *); */
322int dig_point_to_area(struct Map_info *, double, double);
323int dig_point_to_next_area(struct Map_info *, double, double, double *);
324int dig_point_to_line(struct Map_info *, double, double, char);
325
326/* int dig_in_line_bbox (struct P_line *, double, double); */
327int dig_check_dist(struct Map_info *, int, double, double, double *);
328int dig__check_dist(struct Map_info *, struct line_pnts *, double, double,
329 double *);
330/* int dig_center_check (struct P_line *, int, int, double, double); */
331int dig_point_by_line(struct Map_info *, double, double, double, double, char);
332/* int dig_by_line_bbox (struct P_line *, double, double, double, double); */
335
336int dig_struct_copy(void *, void *, int);
337int dig_rmcr(char *);
338
339#endif /* DIG__EXTERNS__ */
int dig_init_boxlist(struct boxlist *, int)
int dig_file_load(struct gvfile *file)
Load opened struct gvfile to memory.
Definition file.c:188
int dig__check_dist(struct Map_info *, struct line_pnts *, double, double, double *)
int dig_find_area_box(struct Plus_head *, int, struct bound_box *)
Find bounding box for given area.
Definition spindex.c:918
void * dig__falloc(int, int)
Definition allocation.c:117
plus_t ** dig_get_cont_lines(struct Map_info *, plus_t, double, int)
char * dig_float_point(char *, int, double)
int dig_struct_copy(void *, void *, int)
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles from the Portable Vector Format.
Definition portable.c:79
void * dig_alloc_space(int, int *, int, void *, int)
Definition allocation.c:32
size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb, struct gvfile *file)
Write struct gvfile.
Definition file.c:156
size_t dig_fread(void *ptr, size_t size, size_t nmemb, struct gvfile *file)
Read struct gvfile.
Definition file.c:124
int dig_write_cidx_head(struct gvfile *, struct Plus_head *)
Definition cindex_rw.c:25
int dig__read_head(struct Map_info *)
Definition head.c:87
int dig_restore_line(struct Plus_head *, int, int, const struct line_pnts *, const struct bound_box *, off_t)
Restore line in Plus_head structure.
Definition plus_line.c:190
int dig_write_nodes(struct gvfile *, struct Plus_head *)
Writes topo structure (nodes) to topo file.
Definition plus.c:321
int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t)
Read off_ts from the Portable Vector Format.
Definition portable.c:167
void dig_free_line(struct P_line *)
Free line structure.
void dig_free_node(struct P_node *)
Free node structure.
int dig_box_copy(struct bound_box *, struct bound_box *)
void * dig_frealloc(void *, int, int, int)
Definition allocation.c:102
int dig_spidx_add_isle(struct Plus_head *, int, const struct bound_box *)
Add new island to spatial index.
Definition spindex.c:394
int dig_write_cidx(struct gvfile *, struct Plus_head *)
Definition cindex_rw.c:252
void dig_node_add_updated(struct Plus_head *, int)
Add node to updated.
int dig_alloc_nodes(struct Plus_head *, int)
Reallocate array of pointers to nodes.
int dig_set_distance_to_line_tolerance(double)
double dig_x_intersect(double, double, double, double, double)
Definition inside.c:20
int dig_is_line_degenerate(const struct line_pnts *, double)
Definition angle.c:135
float * dig__float_convert(float *, float *, int, struct dig_head *)
int dig_angle_next_line(struct Plus_head *, plus_t, int, int, float *)
Find line number of next angle to follow a line.
Definition plus_area.c:474
int dig_point_by_line(struct Map_info *, double, double, double, double, char)
void dig_spidx_free_nodes(struct Plus_head *)
Free spatial index for nodes.
Definition spindex.c:111
int dig_Rd_P_area(struct Plus_head *, int i, struct gvfile *)
int dig_point_to_area(struct Map_info *, double, double)
int dig_select_isles(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select isles with boxes by box.
Definition spindex.c:971
int dig_load_plus(struct Plus_head *, struct gvfile *, int)
Reads topo file to topo structure.
Definition plus.c:195
short * dig__short_convert(short *in, short *out, int, struct dig_head *)
void dig_spidx_free_areas(struct Plus_head *)
Reset spatial index for areas.
Definition spindex.c:177
int dig_add_isle(struct Plus_head *, int, plus_t *, struct bound_box *)
Allocate space for new island and create boundary info from array.
Definition plus_area.c:703
double dig_distance2_point_to_line(double, double, double, double, double, double, double, double, double, int, double *, double *, double *, double *, int *)
int dig_alloc_points(struct line_pnts *, int)
allocate room for 'num' X and Y arrays in struct line_pnts
int dig__byte_order_out(void)
Get byte order.
Definition portable.c:1008
int dig_area_add_isle(struct Plus_head *, int, int)
Add isle to area if does not exist yet.
Definition plus_area.c:265
float dig_node_line_angle(struct Plus_head *, int, int)
Return line angle.
Definition plus_node.c:198
int dig_spidx_del_area(struct Plus_head *, int)
Delete area from spatial index.
Definition spindex.c:514
int dig_read_cidx(struct gvfile *, struct Plus_head *, int)
Read spatial index file.
Definition cindex_rw.c:296
int dig_write_lines(struct gvfile *, struct Plus_head *)
Writes topo structure (lines) to topo file.
Definition plus.c:344
int dig_cidx_add_cat(struct Plus_head *, int, int, int, int)
int dig_spidx_add_area(struct Plus_head *, int, const struct bound_box *)
Add new area to spatial index.
Definition spindex.c:360
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
Definition portable.c:886
plus_t * dig__long_convert_to_plus_t(long *, plus_t *, int, struct dig_head *)
void dig_free_plus_nodes(struct Plus_head *)
Free Plus->Node structure.
Definition plus.c:50
int dig_Wr_spidx(struct gvfile *, struct Plus_head *)
Write spatial index to file.
void dig_free_plus_isles(struct Plus_head *)
Free Plus->Isle structure.
Definition plus.c:142
int dig_area_del_isle(struct Plus_head *, int, int)
Delete isle from area.
Definition plus_area.c:314
int rtree_search(struct RTree *, struct RTree_Rect *, SearchHitCallback, void *, struct Plus_head *)
Search spatial index file Can't use regular RTreeSearch() here because sidx must be read with dig__fr...
int dig_node_add_line(struct Plus_head *, int, int, const struct line_pnts *, int)
Add line info to node.
Definition plus_node.c:44
int dig_select_lines(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select lines with boxes by box.
Definition spindex.c:759
int dig_alloc_areas(struct Plus_head *, int)
Reallocate array of pointers to areas.
void dig_free_plus(struct Plus_head *)
Free Plus structure.
Definition plus.c:173
struct P_node * dig_alloc_node(void)
Allocate new node structure.
int dig_stop_clock(long *)
int dig_point_to_line(struct Map_info *, double, double, char)
void dig_node_reset_updated(struct Plus_head *)
Reset number of updated nodes.
int dig_del_line(struct Plus_head *, int, double, double, double)
Delete line from Plus_head structure.
Definition plus_line.c:217
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
Definition portable.c:900
int dig_write_file_checks(struct gvfile *, struct Plus_head *)
int dig_select_areas(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select areas with boxes by box.
Definition spindex.c:875
int dig_init_plus(struct Plus_head *)
Initialize Plus_head structure.
Definition plus.c:30
int dig_rmcr(char *)
int dig_which_node(struct Plus_head *, double, double, double)
Return actual index into node arrays of the first set of matching coordinates.
Definition plus_node.c:146
int dig__fread_port_L(long *, size_t, struct gvfile *)
Read longs from the Portable Vector Format.
Definition portable.c:262
int * dig__long_convert_to_int(long *, int *, int, struct dig_head *)
int dig_line_set_area(struct Plus_head *, plus_t, int, plus_t)
Set area number on line side.
Definition plus_line.c:383
int dig__fread_port_F(float *, size_t, struct gvfile *)
Read floats from the Portable Vector Format.
Definition portable.c:123
int dig_dump_spidx(FILE *, const struct Plus_head *)
Dump spatial index.
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
Definition portable.c:703
int dig_read_frmt_ascii(FILE *, struct Format_info *)
Read external vector format file.
Definition frmt.c:33
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
Definition portable.c:758
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
Definition file.c:36
long * dig__int_convert(int *, long *, int, struct dig_head *)
int dig_write_frmt_ascii(FILE *, struct Format_info *, int)
Definition frmt.c:154
int dig_find_node(struct Plus_head *, double, double, double)
Find one node by coordinates.
Definition spindex.c:717
void dig_cidx_sort(struct Plus_head *)
int dig__fwrite_port_F(const float *, size_t, struct gvfile *)
Write floats to the Portable Vector Format.
Definition portable.c:597
int dig_alloc_isles(struct Plus_head *, int)
Reallocate array of pointers to isles.
int dig_boxlist_add(struct boxlist *, int, const struct bound_box *)
int dig_point_to_next_area(struct Map_info *, double, double, double *)
int dig_find_intersection(double, double, double, double, double, double, double, double, double *, double *)
Definition linecros.c:181
int dig_prune(struct line_pnts *, double)
Definition prune.c:74
int dig_area_get_box(struct Plus_head *, plus_t, struct bound_box *)
char * dig_stop_clock_str(long *)
void dig_line_reset_updated(struct Plus_head *)
Reset number of updated lines.
int dig_spidx_add_node(struct Plus_head *, int, double, double, double)
Add new node to spatial index.
Definition spindex.c:291
int dig_node_angle_check(struct Plus_head *, int, int)
Check if angles of adjacent lines differ.
Definition plus_area.c:622
void * dig_alloc_topo(char)
Allocate new topo struct.
int dig_Wr_Plus_head(struct gvfile *, struct Plus_head *)
Write Plus_head to file.
int dig_del_area(struct Plus_head *, int)
Delete area from Plus_head structure.
Definition plus_area.c:365
struct P_line * dig_alloc_line(void)
Allocate new line structure.
int dig_Wr_P_area(struct Plus_head *, int i, struct gvfile *)
int dig_area_alloc_isle(struct P_area *, int)
Allocate space in P_area for add new isles.
int dig_add_area(struct Plus_head *, int, plus_t *, struct bound_box *)
Allocate space for new area and create boundary info from array.
Definition plus_area.c:187
int dig_isle_get_box(struct Plus_head *, plus_t, struct bound_box *)
int dig_read_head_ascii(FILE *, struct dig_head *)
int dig_Rd_P_isle(struct Plus_head *, int i, struct gvfile *)
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
Definition portable.c:996
void dig_cidx_free(struct Plus_head *)
int dig_do_file_checks(struct Map_info *, char *, char *)
int dig_Rd_P_line(struct Plus_head *, int i, struct gvfile *)
char * dig__convert_buffer(int)
int dig_write_head_ascii(FILE *, struct dig_head *)
float dig_calc_begin_angle(const struct line_pnts *, double)
Definition angle.c:31
int dig_spidx_del_isle(struct Plus_head *, int)
Delete isle from spatial index.
Definition spindex.c:567
int dig__fwrite_port_D(const double *, size_t, struct gvfile *)
Write doubles to the Portable Vector Format.
Definition portable.c:559
int dig_Wr_spidx_head(struct gvfile *, struct Plus_head *)
Write spatial index header to file.
Definition spindex_rw.c:55
void dig_spidx_free_lines(struct Plus_head *)
Free spatial index for lines.
Definition spindex.c:144
long * dig__plus_t_convert(plus_t *, long *, int, struct dig_head *)
int dig_head_to_map(struct Plus_head *, struct Map_info *)
void dig_rewind(struct gvfile *file)
Rewind file position.
Definition file.c:87
int dig_node_alloc_line(struct P_node *, int)
Allocate space in P_node struct.
int dig_Wr_P_node(struct Plus_head *, int i, struct gvfile *)
int dig_spindex_init(struct Plus_head *)
void * dig_falloc(int, int)
Definition allocation.c:90
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
Definition portable.c:511
int dig_Rd_spidx(struct gvfile *, struct Plus_head *)
Read spatial index from sidx file Only needed when old vector is opened in update mode.
int dig_del_isle(struct Plus_head *, int)
Delete island from Plus_head structure.
Definition plus_area.c:781
plus_t dig_line_get_area(struct Plus_head *, plus_t, int)
Get area number on line side.
Definition plus_line.c:343
int dig_test_for_intersection(double, double, double, double, double, double, double, double)
Definition linecros.c:57
int dig_Rd_Plus_head(struct gvfile *, struct Plus_head *)
Read Plus_head from file.
int dig_write_areas(struct gvfile *, struct Plus_head *)
Writes topo structure (areas) to topo file.
Definition plus.c:368
int dig__fread_port_S(short *, size_t, struct gvfile *)
Read shorts from the Portable Vector Format.
Definition portable.c:428
int dig_cidx_init(struct Plus_head *)
Initialize Plus_head structure (cidx)
void dig_free_plus_lines(struct Plus_head *)
Free Plus->Line structure.
Definition plus.c:78
int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *)
int dig__write_head(struct Map_info *)
Definition head.c:23
double dig_unit_conversion(void)
double dig_find_poly_orientation(struct line_pnts *)
void * dig__alloc_space(int, int *, int, void *, int)
Definition allocation.c:48
int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *)
Definition plus_struct.c:51
int dig_cidx_del_cat(struct Plus_head *, int, int, int, int)
void * dig__frealloc(void *, int, int, int)
Definition allocation.c:132
int dig_select_nodes(struct Plus_head *, const struct bound_box *, struct ilist *)
Select nodes by bbox.
Definition spindex.c:668
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
Definition portable.c:345
int dig_read_cidx_head(struct gvfile *, struct Plus_head *)
Read header of cidx file.
Definition cindex_rw.c:122
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
Definition file.c:60
void dig_free_area(struct P_area *)
Free area structure.
double * dig__double_convert(double *, double *, int, struct dig_head *)
int dig_type_from_store(int)
Convert type from store type.
int dig_spidx_del_line(struct Plus_head *, int, double, double, double)
Delete line from spatial index.
Definition spindex.c:472
int dig_alloc_lines(struct Plus_head *, int)
Reallocate array of pointers to lines.
int dig_cidx_add_cat_sorted(struct Plus_head *, int, int, int, int)
int dig_find_area_poly(struct line_pnts *, double *)
Definition diglib/poly.c:97
int dig_find_line_box(struct Plus_head *, int, struct bound_box *)
Find box for line.
Definition spindex.c:802
int dig_spidx_del_node(struct Plus_head *, int)
Delete node from spatial index.
Definition spindex.c:429
void dig_line_add_updated(struct Plus_head *, int, off_t)
Add new line to updated.
int dig_build_area_with_line(struct Plus_head *, plus_t, int, plus_t **)
Build topo for area from lines.
Definition plus_area.c:50
int dig_fflush(struct gvfile *file)
Flush struct gvfile.
Definition file.c:104
int dig_box_extend(struct bound_box *, struct bound_box *)
void dig_spidx_free_isles(struct Plus_head *)
Reset spatial index for isles.
Definition spindex.c:210
int dig_Rd_spidx_head(struct gvfile *, struct Plus_head *)
Read spatial index header from sidx file.
Definition spindex_rw.c:262
struct P_isle * dig_alloc_isle(void)
Allocate new isle structure.
plus_t dig_get_next_cont_line(struct Map_info *, plus_t, double, int)
struct P_area * dig_alloc_area(void)
Allocate new area structure.
int dig__fread_port_P(plus_t *, size_t, struct gvfile *)
Read plus_t from the Portable Vector Format.
Definition portable.c:537
int dig_alloc_cats(struct line_cats *, int)
Allocate room for 'num' fields and category arrays in struct line_cats.
int dig_line_degenerate(const struct line_pnts *)
Definition angle.c:179
int dig_map_to_head(struct Map_info *, struct Plus_head *)
int dig_start_clock(long *)
void dig_spidx_free(struct Plus_head *)
Free spatial index (nodes, lines, areas, isles)
Definition spindex.c:243
float dig_calc_end_angle(const struct line_pnts *, double)
Definition angle.c:83
void dig_file_init(struct gvfile *file)
Initialize gvfile structure.
Definition file.c:171
long * dig__long_convert(long *, long *, int, struct dig_head *)
int dig_isle_alloc_line(struct P_isle *, int)
Allocate space in P_isle for add new lines.
int dig_add_node(struct Plus_head *, double, double, double)
Add new node to plus structure.
Definition plus_node.c:101
int dig_area_alloc_line(struct P_area *, int)
allocate space in P_area for add new lines
void dig_free_plus_areas(struct Plus_head *)
Free Plus->Area structure.
Definition plus.c:114
int dig_Wr_P_isle(struct Plus_head *, int i, struct gvfile *)
int dig_spidx_add_line(struct Plus_head *, int, const struct bound_box *)
Add new line to spatial index.
Definition spindex.c:326
void dig_free_isle(struct P_isle *)
Free isle structure.
int dig_write_isles(struct gvfile *, struct Plus_head *)
Writes topo structure (isles) to topo file.
Definition plus.c:392
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.
Definition plus_line.c:133
int dig_get_poly_points(int, struct line_pnts **, int *, struct line_pnts *)
Definition diglib/poly.c:34
void dig_file_free(struct gvfile *file)
Free struct gvfile.
Definition file.c:268
int dig_find_isle_box(struct Plus_head *, int, struct bound_box *)
Find box for isle.
Definition spindex.c:1014
int dig_check_dist(struct Map_info *, int, double, double, double *)
int dig_write_plus_file(struct gvfile *, struct Plus_head *)
Writes topo structure to topo file.
Definition plus.c:271
int dig_spidx_init(struct Plus_head *)
Initit spatial index (nodes, lines, areas, isles)
Definition spindex.c:35
struct dig_head * dig_get_head(void)
int dig_line_box(const struct line_pnts *, struct bound_box *)
int dig_out_of_memory(void)
For now just print message and return error code.
int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t)
Write off_ts to the Portable Vector Format.
Definition portable.c:636
int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *)
Write plus_t to the Portable Vector Format.
Definition portable.c:868
int dig__fwrite_port_S(const short *, size_t, struct gvfile *)
Write shorts to the Portable Vector Format.
Definition portable.c:813
struct dig_head * dig__get_head(void)
int dig_type_to_store(int)
Convert type to store type.
int plus_t
plus_t size
Definition dig_structs.h:39
#define file
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
Definition rtree.h:86
Non-native format info (currently only OGR is implemented)
Vector map info.
Area (topology) info.
Isle (topology) info.
Vector geometry.
Topological feature - node.
Basic topology-related info.
Portability info.
Definition rtree.h:123
Bounding box.
Definition dig_structs.h:62
List of bounding boxes with id.
Vector map header data.
File definition.
Definition dig_structs.h:92
List of integers.
Definition gis.h:715
Feature category info.
Feature geometry info - coordinates.