3 #ifndef DIG___EXTERNS___
4 #define DIG___EXTERNS___
67 size_t dig_fwrite(
const void *ptr,
size_t size,
size_t nmemb,
88 double,
double,
double *,
double *);
92 double,
double,
double,
double,
int,
93 double *,
double *,
double *,
double *,
int dig_init_boxlist(struct boxlist *, int)
int dig_file_load(struct gvfile *file)
Load opened struct gvfile to memory.
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.
int dig_struct_copy(void *, void *, int)
int dig__fread_port_D(double *, size_t, struct gvfile *)
Read doubles from the Portable Vector Format.
size_t dig_fwrite(const void *ptr, size_t size, size_t nmemb, struct gvfile *file)
Write struct gvfile.
size_t dig_fread(void *ptr, size_t size, size_t nmemb, struct gvfile *file)
Read struct gvfile.
void * dig__falloc(int, int)
int dig_write_cidx_head(struct gvfile *, struct Plus_head *)
int dig__read_head(struct Map_info *)
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.
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.
int dig__fread_port_O(off_t *, size_t, struct gvfile *, size_t)
Read off_ts from the Portable Vector Format.
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 *)
int dig_spidx_add_isle(struct Plus_head *, int, const struct bound_box *)
Add new island to spatial index.
int dig_write_cidx(struct gvfile *, struct Plus_head *)
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)
int * dig__long_convert_to_int(long *, int *, int, struct dig_head *)
void * dig_falloc(int, int)
plus_t ** dig_get_cont_lines(struct Map_info *, plus_t, double, int)
int dig_is_line_degenerate(const struct line_pnts *, double)
void * dig__frealloc(void *, int, int, int)
int dig_angle_next_line(struct Plus_head *, plus_t, int, int, float *)
Find line number of next angle to follow a line.
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.
int dig_Rd_P_area(struct Plus_head *, int i, struct gvfile *)
struct P_isle * dig_alloc_isle(void)
Allocate new isle structure.
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.
int dig_load_plus(struct Plus_head *, struct gvfile *, int)
Reads topo file to topo structure.
void dig_spidx_free_areas(struct Plus_head *)
Reset spatial index for areas.
int dig_add_isle(struct Plus_head *, int, plus_t *, struct bound_box *)
Allocate space for new island and create boundary info from array.
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.
int dig_area_add_isle(struct Plus_head *, int, int)
Add isle to area if does not exist yet.
float dig_node_line_angle(struct Plus_head *, int, int)
Return line angle.
int dig_spidx_del_area(struct Plus_head *, int)
Delete area from spatial index.
int dig_read_cidx(struct gvfile *, struct Plus_head *, int)
Read spatial index file.
int dig_write_lines(struct gvfile *, struct Plus_head *)
Writes topo structure (lines) to topo file.
struct dig_head * dig_get_head(void)
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.
int dig__fwrite_port_C(const char *, size_t, struct gvfile *)
Write chars to the Portable Vector Format.
void dig_free_plus_nodes(struct Plus_head *)
Free Plus->Node structure.
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.
int dig_area_del_isle(struct Plus_head *, int, int)
Delete isle from area.
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.
int dig_select_lines(struct Plus_head *, const struct bound_box *, struct boxlist *)
Select lines with boxes by box.
int dig_alloc_areas(struct Plus_head *, int)
Reallocate array of pointers to areas.
void dig_free_plus(struct Plus_head *)
Free Plus structure.
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.
void dig_init_portable(struct Port_info *, int)
Set Port_info structure to byte order of file.
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.
int dig_init_plus(struct Plus_head *)
Initialize Plus_head structure.
int dig_which_node(struct Plus_head *, double, double, double)
Return actual index into node arrays of the first set of matching coordinates.
int dig__fread_port_L(long *, size_t, struct gvfile *)
Read longs from the Portable Vector Format.
int dig_line_set_area(struct Plus_head *, plus_t, int, plus_t)
Set area number on line side.
int dig__fread_port_F(float *, size_t, struct gvfile *)
Read floats from the Portable Vector Format.
int dig_dump_spidx(FILE *, const struct Plus_head *)
Dump spatial index.
char * dig_stop_clock_str(long *)
int dig__fwrite_port_L(const long *, size_t, struct gvfile *)
Write longs to the Portable Vector Format.
int dig_read_frmt_ascii(FILE *, struct Format_info *)
Read external vector format file.
int dig__fwrite_port_I(const int *, size_t, struct gvfile *)
Write integers to the Portable Vector Format.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
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.
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.
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 *)
int dig_prune(struct line_pnts *, double)
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.
int dig_node_angle_check(struct Plus_head *, int, int)
Check if angles of adjacent lines differ.
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.
void * dig_alloc_space(int, int *, int, void *, int)
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.
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.
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 *)
int dig_write_head_ascii(FILE *, struct dig_head *)
float dig_calc_begin_angle(const struct line_pnts *, double)
int dig_spidx_del_isle(struct Plus_head *, int)
Delete isle from spatial index.
int dig__fwrite_port_D(const double *, size_t, struct gvfile *)
Write doubles to the Portable Vector Format.
int dig_Wr_spidx_head(struct gvfile *, struct Plus_head *)
Write spatial index header to file.
void dig_spidx_free_lines(struct Plus_head *)
Free spatial index for lines.
int dig_head_to_map(struct Plus_head *, struct Map_info *)
void dig_rewind(struct gvfile *file)
Rewind file position.
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 *)
char * dig__convert_buffer(int)
int dig__fread_port_C(char *, size_t, struct gvfile *)
Read chars from the Portable Vector Format.
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.
plus_t dig_line_get_area(struct Plus_head *, plus_t, int)
Get area number on line side.
int dig_test_for_intersection(double, double, double, double, double, double, double, double)
struct dig_head * dig__get_head(void)
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.
int dig__fread_port_S(short *, size_t, struct gvfile *)
Read shorts from the Portable Vector Format.
int dig_cidx_init(struct Plus_head *)
Initialize Plus_head structure (cidx)
void dig_free_plus_lines(struct Plus_head *)
Free Plus->Line structure.
void * dig_alloc_topo(char)
Allocate new topo struct.
int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *)
int dig__write_head(struct Map_info *)
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 *)
int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *)
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.
int dig__fread_port_I(int *, size_t, struct gvfile *)
Read integers from the Portable Vector Format.
int dig_read_cidx_head(struct gvfile *, struct Plus_head *)
Read header of cidx file.
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
void dig_free_area(struct P_area *)
Free area structure.
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.
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 *)
int dig_find_line_box(struct Plus_head *, int, struct bound_box *)
Find box for line.
int dig_spidx_del_node(struct Plus_head *, int)
Delete node from spatial index.
struct P_area * dig_alloc_area(void)
Allocate new area structure.
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.
int dig_fflush(struct gvfile *file)
Flush struct gvfile.
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.
int dig_Rd_spidx_head(struct gvfile *, struct Plus_head *)
Read spatial index header from sidx file.
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.
struct P_line * dig_alloc_line(void)
Allocate new line structure.
void * dig_frealloc(void *, int, int, int)
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 *)
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)
float dig_calc_end_angle(const struct line_pnts *, double)
void dig_file_init(struct gvfile *file)
Initialize gvfile structure.
void * dig__alloc_space(int, int *, int, void *, int)
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.
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.
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.
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.
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.
int dig_get_poly_points(int, struct line_pnts **, int *, struct line_pnts *)
void dig_file_free(struct gvfile *file)
Free struct gvfile.
int dig_find_isle_box(struct Plus_head *, int, struct bound_box *)
Find box for isle.
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.
int dig_spidx_init(struct Plus_head *)
Initit spatial index (nodes, lines, areas, isles)
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.
int dig__fwrite_port_O(const off_t *, size_t, struct gvfile *, size_t)
Write off_ts to the Portable Vector Format.
int dig__fwrite_port_P(const plus_t *, size_t, struct gvfile *)
Write plus_t to the Portable Vector Format.
int dig__fwrite_port_S(const short *, size_t, struct gvfile *)
Write shorts to the Portable Vector Format.
int dig_type_to_store(int)
Convert type to store type.
struct P_node * dig_alloc_node(void)
Allocate new node structure.
int SearchHitCallback(int id, const struct RTree_Rect *rect, void *arg)
Topological feature - node.
Basic topology-related info.
List of bounding boxes with id.
Feature geometry info - coordinates.