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