GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
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/vect/dig_externs.h
8 
9  \brief Function prototypes for diglib (part of vector library)
10  */
11 
12 /* allocation.c */
13 void *dig_alloc_space(int, int *, int, void *,
14  int); /* exits on error, calls _alloc_space () */
15 void *
16 dig__alloc_space(int, int *, int, void *,
17  int); /* returns NULL on error, calls calloc(), _frealloc() */
18 void *dig_falloc(int, int); /* exits on error, calls _falloc () */
19 void *dig_frealloc(void *, int, int,
20  int); /* exits on error, calls _frealloc () */
21 void *dig__falloc(int, int); /* returns NULL on error, calls calloc () */
22 void *dig__frealloc(void *, int, int,
23  int); /* returns NULL on error, calls calloc () */
24 
25 /* angle.c */
26 float dig_calc_begin_angle(const struct line_pnts *, double);
27 float dig_calc_end_angle(const struct line_pnts *, double);
28 int dig_line_degenerate(const struct line_pnts *);
29 int dig_is_line_degenerate(const struct line_pnts *, double);
30 
31 /* box.c */
32 int dig_box_copy(struct bound_box *, struct bound_box *);
33 int dig_box_extend(struct bound_box *, struct bound_box *);
34 int 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 */
47 int dig_cidx_init(struct Plus_head *);
48 void dig_cidx_free(struct Plus_head *);
49 int dig_cidx_add_cat(struct Plus_head *, int, int, int, int);
50 int dig_cidx_add_cat_sorted(struct Plus_head *, int, int, int, int);
51 int dig_cidx_del_cat(struct Plus_head *, int, int, int, int);
52 void dig_cidx_sort(struct Plus_head *);
53 
54 /* cindex_rw.c */
55 int dig_write_cidx_head(struct gvfile *, struct Plus_head *);
56 int dig_read_cidx_head(struct gvfile *, struct Plus_head *);
57 int dig_write_cidx(struct gvfile *, struct Plus_head *);
58 int dig_read_cidx(struct gvfile *, struct Plus_head *, int);
59 
60 /* file.c */
61 /* file loaded to memory; mostly unused */
62 off_t dig_ftell(struct gvfile *file);
63 int dig_fseek(struct gvfile *file, off_t offset, int whence);
64 void dig_rewind(struct gvfile *file);
65 int dig_fflush(struct gvfile *file);
66 size_t dig_fread(void *ptr, size_t size, size_t nmemb, struct gvfile *file);
67 size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb,
68  struct gvfile *file);
69 void dig_file_init(struct gvfile *file);
70 int dig_file_load(struct gvfile *file);
71 void dig_file_free(struct gvfile *file);
72 
73 /* frmt.c */
74 int dig_write_frmt_ascii(FILE *, struct Format_info *, int);
75 int dig_read_frmt_ascii(FILE *, struct Format_info *);
76 
77 /* head.c */
78 int dig__write_head(struct Map_info *);
79 int dig__read_head(struct Map_info *);
80 
81 /* inside.c */
82 double dig_x_intersect(double, double, double, double, double);
83 
84 /* linecross.c */
85 int dig_test_for_intersection(double, double, double, double, double, double,
86  double, double);
87 int dig_find_intersection(double, double, double, double, double, double,
88  double, double, double *, double *);
89 
90 /* line_dist.c */
91 double 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 */
98 int dig_init_boxlist(struct boxlist *, int);
99 int dig_boxlist_add(struct boxlist *, int, const struct bound_box *);
100 
101 /* plus.c */
102 int dig_init_plus(struct Plus_head *);
103 void dig_free_plus_nodes(struct Plus_head *);
104 void dig_free_plus_lines(struct Plus_head *);
105 void dig_free_plus_areas(struct Plus_head *);
106 void dig_free_plus_isles(struct Plus_head *);
107 void dig_free_plus(struct Plus_head *);
108 int dig_load_plus(struct Plus_head *, struct gvfile *, int);
109 int dig_write_plus_file(struct gvfile *, struct Plus_head *);
110 int dig_write_nodes(struct gvfile *, struct Plus_head *);
111 int dig_write_lines(struct gvfile *, struct Plus_head *);
112 int dig_write_areas(struct gvfile *, struct Plus_head *);
113 int dig_write_isles(struct gvfile *, struct Plus_head *);
114 
115 /* plus_area.c */
116 int dig_add_area(struct Plus_head *, int, plus_t *, struct bound_box *);
117 int dig_area_add_isle(struct Plus_head *, int, int);
118 int dig_area_del_isle(struct Plus_head *, int, int);
119 int dig_del_area(struct Plus_head *, int);
120 int dig_add_isle(struct Plus_head *, int, plus_t *, struct bound_box *);
121 int dig_del_isle(struct Plus_head *, int);
122 int dig_build_area_with_line(struct Plus_head *, plus_t, int, plus_t **);
123 int dig_angle_next_line(struct Plus_head *, plus_t, int, int, float *);
124 int dig_node_angle_check(struct Plus_head *, int, int);
125 int dig_area_get_box(struct Plus_head *, plus_t, struct bound_box *);
126 int dig_isle_get_box(struct Plus_head *, plus_t, struct bound_box *);
127 
128 /* plus_line.c */
129 int dig_add_line(struct Plus_head *, int, const struct line_pnts *,
130  const struct bound_box *, off_t);
131 int dig_restore_line(struct Plus_head *, int, int, const struct line_pnts *,
132  const struct bound_box *, off_t);
133 int dig_del_line(struct Plus_head *, int, double, double, double);
134 plus_t dig_line_get_area(struct Plus_head *, plus_t, int);
135 int dig_line_set_area(struct Plus_head *, plus_t, int, plus_t);
136 
137 /* plus_node.c */
138 int dig_add_node(struct Plus_head *, double, double, double);
139 int dig_which_node(struct Plus_head *, double, double, double);
140 
141 int dig_node_add_line(struct Plus_head *, int, int, const struct line_pnts *,
142  int);
143 float dig_node_line_angle(struct Plus_head *, int, int);
144 
145 /* plus_struct.c */
146 int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *);
147 int dig_Wr_P_node(struct Plus_head *, int i, struct gvfile *);
148 int dig_Rd_P_line(struct Plus_head *, int i, struct gvfile *);
149 int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *);
150 int dig_Rd_P_area(struct Plus_head *, int i, struct gvfile *);
151 int dig_Wr_P_area(struct Plus_head *, int i, struct gvfile *);
152 int dig_Rd_P_isle(struct Plus_head *, int i, struct gvfile *);
153 int dig_Wr_P_isle(struct Plus_head *, int i, struct gvfile *);
154 int dig_Rd_Plus_head(struct gvfile *, struct Plus_head *);
155 int dig_Wr_Plus_head(struct gvfile *, struct Plus_head *);
156 
157 /* poly.c */
158 int dig_find_area_poly(struct line_pnts *, double *);
159 double dig_find_poly_orientation(struct line_pnts *);
160 int dig_get_poly_points(int, struct line_pnts **, int *, struct line_pnts *);
161 
162 /* portable.c */
163 void dig_init_portable(struct Port_info *, int);
164 int dig__byte_order_out(void);
165 
166 /* int dig__set_cur_head (struct dig_head *); */
167 int dig_set_cur_port(struct Port_info *);
168 
169 int dig__fread_port_D(double *, size_t, struct gvfile *);
170 int dig__fread_port_F(float *, size_t, struct gvfile *);
171 int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t);
172 int dig__fread_port_L(long *, size_t, struct gvfile *);
173 int dig__fread_port_S(short *, size_t, struct gvfile *);
174 int dig__fread_port_I(int *, size_t, struct gvfile *);
175 int dig__fread_port_P(plus_t *, size_t, struct gvfile *);
176 int dig__fread_port_C(char *, size_t, struct gvfile *);
177 int dig__fwrite_port_D(const double *, size_t, struct gvfile *);
178 int dig__fwrite_port_F(const float *, size_t, struct gvfile *);
179 int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t);
180 int dig__fwrite_port_L(const long *, size_t, struct gvfile *);
181 int dig__fwrite_port_S(const short *, size_t, struct gvfile *);
182 int dig__fwrite_port_I(const int *, size_t, struct gvfile *);
183 int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *);
184 int dig__fwrite_port_C(const char *, size_t, struct gvfile *);
185 
186 /* port_init.c */
187 
188 /* port_test.c */
189 
190 /* prune.c */
191 int dig_prune(struct line_pnts *, double);
192 
193 /* spatial index */
194 /* spindex.c */
195 int dig_spidx_init(struct Plus_head *);
196 void dig_spidx_free_nodes(struct Plus_head *);
197 void dig_spidx_free_lines(struct Plus_head *);
198 void dig_spidx_free_areas(struct Plus_head *);
199 void dig_spidx_free_isles(struct Plus_head *);
200 void dig_spidx_free(struct Plus_head *);
201 
202 int dig_spidx_add_node(struct Plus_head *, int, double, double, double);
203 int dig_spidx_add_line(struct Plus_head *, int, const struct bound_box *);
204 int dig_spidx_add_area(struct Plus_head *, int, const struct bound_box *);
205 int dig_spidx_add_isle(struct Plus_head *, int, const struct bound_box *);
206 
207 int dig_spidx_del_node(struct Plus_head *, int);
208 int dig_spidx_del_line(struct Plus_head *, int, double, double, double);
209 int dig_spidx_del_area(struct Plus_head *, int);
210 int dig_spidx_del_isle(struct Plus_head *, int);
211 
212 int dig_select_nodes(struct Plus_head *, const struct bound_box *,
213  struct ilist *);
214 int dig_select_lines(struct Plus_head *, const struct bound_box *,
215  struct boxlist *);
216 int dig_select_areas(struct Plus_head *, const struct bound_box *,
217  struct boxlist *);
218 int dig_select_isles(struct Plus_head *, const struct bound_box *,
219  struct boxlist *);
220 int dig_find_node(struct Plus_head *, double, double, double);
221 int dig_find_line_box(struct Plus_head *, int, struct bound_box *);
222 int dig_find_area_box(struct Plus_head *, int, struct bound_box *);
223 int dig_find_isle_box(struct Plus_head *, int, struct bound_box *);
224 
225 /* spindex_rw.c */
226 int dig_Rd_spidx_head(struct gvfile *, struct Plus_head *);
227 int dig_Wr_spidx_head(struct gvfile *, struct Plus_head *);
228 int dig_Wr_spidx(struct gvfile *, struct Plus_head *);
229 int dig_Rd_spidx(struct gvfile *, struct Plus_head *);
230 
231 int dig_dump_spidx(FILE *, const struct Plus_head *);
232 
233 int rtree_search(struct RTree *, struct RTree_Rect *, SearchHitCallback, void *,
234  struct Plus_head *);
235 
236 /* struct_alloc.c */
237 int dig_node_alloc_line(struct P_node *, int);
238 int dig_alloc_nodes(struct Plus_head *, int);
239 int dig_alloc_lines(struct Plus_head *, int);
240 int dig_alloc_areas(struct Plus_head *, int);
241 int dig_alloc_isles(struct Plus_head *, int);
242 struct P_node *dig_alloc_node(void);
243 struct P_line *dig_alloc_line(void);
244 void *dig_alloc_topo(char);
245 struct P_area *dig_alloc_area(void);
246 struct P_isle *dig_alloc_isle(void);
247 void dig_free_node(struct P_node *);
248 void dig_free_line(struct P_line *);
249 void dig_free_area(struct P_area *);
250 void dig_free_isle(struct P_isle *);
251 int dig_alloc_points(struct line_pnts *, int);
252 int dig_alloc_cats(struct line_cats *, int);
253 int dig_area_alloc_line(struct P_area *, int);
254 int dig_area_alloc_isle(struct P_area *, int);
255 int dig_isle_alloc_line(struct P_isle *, int);
256 int dig_out_of_memory(void);
257 
258 /* type.c */
259 /* conversion of types */
260 int dig_type_to_store(int);
261 int dig_type_from_store(int);
262 
263 /* update.c */
264 /* list of updated */
265 void dig_line_reset_updated(struct Plus_head *);
266 void dig_line_add_updated(struct Plus_head *, int, off_t);
267 void dig_node_reset_updated(struct Plus_head *);
268 void dig_node_add_updated(struct Plus_head *, int);
269 
270 /*********************************************************************
271  * unused/removed functions
272  *********************************************************************/
273 
274 char *color_name(int); /* pass it an int, returns the name of the color */
275 
276 char *dig_float_point(char *, int, double);
277 
278 /* double dig_point_in_area (struct Map_info *, double, double, struct P_area
279  * *); */
280 
281 double dig_unit_conversion(void);
282 
283 /* portable data routines - only to be called by library routines! */
284 double *dig__double_convert(double *, double *, int, struct dig_head *);
285 float *dig__float_convert(float *, float *, int, struct dig_head *);
286 short *dig__short_convert(short *in, short *out, int, struct dig_head *);
287 long *dig__long_convert(long *, long *, int, struct dig_head *);
288 long *dig__int_convert(int *, long *, int, struct dig_head *);
289 long *dig__plus_t_convert(plus_t *, long *, int, struct dig_head *);
290 int *dig__long_convert_to_int(long *, int *, int, struct dig_head *);
293 
294 plus_t **dig_get_cont_lines(struct Map_info *, plus_t, double, int);
296 
297 struct dig_head *dig_get_head(void);
298 struct 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); */
302 int dig_start_clock(long *);
303 int dig_stop_clock(long *);
304 char *dig_stop_clock_str(long *);
305 int dig_write_file_checks(struct gvfile *, struct Plus_head *);
306 int 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 
312 int dig_map_to_head(struct Map_info *, struct Plus_head *);
313 int 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  *); */
322 int dig_point_to_area(struct Map_info *, double, double);
323 int dig_point_to_next_area(struct Map_info *, double, double, double *);
324 int dig_point_to_line(struct Map_info *, double, double, char);
325 
326 /* int dig_in_line_bbox (struct P_line *, double, double); */
327 int dig_check_dist(struct Map_info *, int, double, double, double *);
328 int 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); */
331 int 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); */
333 int dig_write_head_ascii(FILE *, struct dig_head *);
334 int dig_read_head_ascii(FILE *, struct dig_head *);
335 
336 int dig_struct_copy(void *, void *, int);
337 int 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:919
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
char * color_name(int)
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
void * dig__falloc(int, int)
Definition: allocation.c:118
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:189
long * dig__long_convert(long *, long *, int, struct dig_head *)
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.
Definition: struct_alloc.c:177
void dig_free_node(struct P_node *)
Free node structure.
Definition: struct_alloc.c:48
int dig_box_copy(struct bound_box *, struct bound_box *)
int dig_spidx_add_isle(struct Plus_head *, int, const struct bound_box *)
Add new island to spatial index.
Definition: spindex.c:395
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.
Definition: struct_alloc.c:105
int dig_set_distance_to_line_tolerance(double)
double dig_x_intersect(double, double, double, double, double)
Definition: inside.c:20
int * dig__long_convert_to_int(long *, int *, int, struct dig_head *)
void * dig_falloc(int, int)
Definition: allocation.c:91
plus_t ** dig_get_cont_lines(struct Map_info *, plus_t, double, int)
int dig_is_line_degenerate(const struct line_pnts *, double)
Definition: angle.c:135
void * dig__frealloc(void *, int, int, int)
Definition: allocation.c:133
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 *)
Definition: plus_struct.c:351
struct P_isle * dig_alloc_isle(void)
Allocate new isle structure.
Definition: struct_alloc.c:301
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:972
int dig_load_plus(struct Plus_head *, struct gvfile *, int)
Reads topo file to topo structure.
Definition: plus.c:195
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
Definition: struct_alloc.c:336
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:515
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
struct dig_head * dig_get_head(void)
int dig_cidx_add_cat(struct Plus_head *, int, int, int, int)
Definition: diglib/cindex.c:72
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
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.
Definition: spindex_rw.c:1177
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...
Definition: spindex_rw.c:1387
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:760
int dig_alloc_areas(struct Plus_head *, int)
Reallocate array of pointers to areas.
Definition: struct_alloc.c:218
void dig_free_plus(struct Plus_head *)
Free Plus structure.
Definition: plus.c:173
char * dig_float_point(char *, int, double)
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:216
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:876
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_line_set_area(struct Plus_head *, plus_t, int, plus_t)
Set area number on line side.
Definition: plus_line.c:382
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.
Definition: spindex_rw.c:1267
char * dig_stop_clock_str(long *)
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
int dig_write_frmt_ascii(FILE *, struct Format_info *, int)
int dig_find_node(struct Plus_head *, double, double, double)
Find one node by coordinates.
Definition: spindex.c:718
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.
Definition: struct_alloc.c:243
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 *)
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
int dig_Wr_Plus_head(struct gvfile *, struct Plus_head *)
Write Plus_head to file.
Definition: plus_struct.c:711
int dig_del_area(struct Plus_head *, int)
Delete area from Plus_head structure.
Definition: plus_area.c:365
void * dig_alloc_space(int, int *, int, void *, int)
Definition: allocation.c:33
int dig_Wr_P_area(struct Plus_head *, int i, struct gvfile *)
Definition: plus_struct.c:411
int dig_area_alloc_isle(struct P_area *, int)
Allocate space in P_area for add new isles.
Definition: struct_alloc.c:440
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 *)
Definition: plus_struct.c:449
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
Definition: portable.c:996
void dig_cidx_free(struct Plus_head *)
Definition: diglib/cindex.c:44
int dig_do_file_checks(struct Map_info *, char *, char *)
int dig_Rd_P_line(struct Plus_head *, int i, struct gvfile *)
Definition: plus_struct.c:163
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:568
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
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.
Definition: struct_alloc.c:69
int dig_Wr_P_node(struct Plus_head *, int i, struct gvfile *)
Definition: plus_struct.c:118
int dig_spindex_init(struct Plus_head *)
char * dig__convert_buffer(int)
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.
Definition: spindex_rw.c:1223
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:342
int dig_test_for_intersection(double, double, double, double, double, double, double, double)
Definition: linecros.c:57
struct dig_head * dig__get_head(void)
int dig_Rd_Plus_head(struct gvfile *, struct Plus_head *)
Read Plus_head from file.
Definition: plus_struct.c:531
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)
Definition: diglib/cindex.c:29
void dig_free_plus_lines(struct Plus_head *)
Free Plus->Line structure.
Definition: plus.c:78
void * dig_alloc_topo(char)
Allocate new topo struct.
Definition: struct_alloc.c:145
int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *)
Definition: plus_struct.c:260
int dig__write_head(struct Map_info *)
Definition: head.c:23
short * dig__short_convert(short *in, short *out, int, struct dig_head *)
double dig_unit_conversion(void)
double dig_find_poly_orientation(struct line_pnts *)
Definition: diglib/poly.c:137
int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *)
Definition: plus_struct.c:52
int dig_cidx_del_cat(struct Plus_head *, int, int, int, int)
long * dig__plus_t_convert(plus_t *, long *, int, struct dig_head *)
int dig_select_nodes(struct Plus_head *, const struct bound_box *, struct ilist *)
Select nodes by bbox.
Definition: spindex.c:669
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.
Definition: struct_alloc.c:284
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:473
int dig_alloc_lines(struct Plus_head *, int)
Reallocate array of pointers to lines.
Definition: struct_alloc.c:193
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:98
int dig_find_line_box(struct Plus_head *, int, struct bound_box *)
Find box for line.
Definition: spindex.c:803
int dig_spidx_del_node(struct Plus_head *, int)
Delete node from spatial index.
Definition: spindex.c:430
struct P_area * dig_alloc_area(void)
Allocate new area structure.
Definition: struct_alloc.c:266
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
float * dig__float_convert(float *, float *, int, struct dig_head *)
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
plus_t dig_get_next_cont_line(struct Map_info *, plus_t, double, int)
plus_t * dig__long_convert_to_plus_t(long *, plus_t *, int, struct dig_head *)
int dig__fread_port_P(plus_t *, size_t, struct gvfile *)
Read plus_t from the Portable Vector Format.
Definition: portable.c:537
struct P_line * dig_alloc_line(void)
Allocate new line structure.
Definition: struct_alloc.c:127
void * dig_frealloc(void *, int, int, int)
Definition: allocation.c:103
int dig_alloc_cats(struct line_cats *, int)
Allocate room for 'num' fields and category arrays in struct line_cats.
Definition: struct_alloc.c:380
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
void * dig__alloc_space(int, int *, int, void *, int)
Definition: allocation.c:49
int dig_isle_alloc_line(struct P_isle *, int)
Allocate space in P_isle for add new lines.
Definition: struct_alloc.c:466
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
Definition: struct_alloc.c:414
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 *)
Definition: plus_struct.c:492
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.
Definition: struct_alloc.c:319
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:35
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:1015
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
long * dig__int_convert(int *, long *, int, struct dig_head *)
double * dig__double_convert(double *, double *, int, struct dig_head *)
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.
Definition: struct_alloc.c:487
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
int dig_type_to_store(int)
Convert type to store type.
struct P_node * dig_alloc_node(void)
Allocate new node structure.
Definition: struct_alloc.c:30
int plus_t
plus_t size
Definition: dig_structs.h:41
#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)
Definition: dig_structs.h:700
Vector map info.
Definition: dig_structs.h:1243
Area (topology) info.
Definition: dig_structs.h:1583
Isle (topology) info.
Definition: dig_structs.h:1623
Vector geometry.
Definition: dig_structs.h:1553
Topological feature - node.
Definition: dig_structs.h:1433
Basic topology-related info.
Definition: dig_structs.h:769
Portability info.
Definition: dig_structs.h:181
Definition: rtree.h:123
Bounding box.
Definition: dig_structs.h:64
List of bounding boxes with id.
Definition: dig_structs.h:1723
Vector map header data.
Definition: dig_structs.h:287
File definition.
Definition: dig_structs.h:94
List of integers.
Definition: gis.h:709
Feature category info.
Definition: dig_structs.h:1677
Feature geometry info - coordinates.
Definition: dig_structs.h:1651