GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
#include <grass/gis.h>
Go to the source code of this file.
Functions | |
void * | dig_alloc_space (int, int *, int, void *, int) |
void * | dig__alloc_space (int, int *, int, void *, int) |
void * | dig_falloc (int, int) |
void * | dig_frealloc (void *, int, int, int) |
void * | dig__falloc (int, int) |
void * | dig__frealloc (void *, int, int, int) |
float | dig_calc_begin_angle (const struct line_pnts *, double) |
float | dig_calc_end_angle (const struct line_pnts *, double) |
int | dig_line_degenerate (const struct line_pnts *) |
int | dig_is_line_degenerate (const struct line_pnts *, double) |
int | dig_box_copy (struct bound_box *, struct bound_box *) |
int | dig_box_extend (struct bound_box *, struct bound_box *) |
int | dig_line_box (const struct line_pnts *, struct bound_box *) |
int | dig_cidx_init (struct Plus_head *) |
Initialize Plus_head structure (cidx) More... | |
void | dig_cidx_free (struct Plus_head *) |
int | dig_cidx_add_cat (struct Plus_head *, int, int, int, int) |
int | dig_cidx_add_cat_sorted (struct Plus_head *, int, int, int, int) |
int | dig_cidx_del_cat (struct Plus_head *, int, int, int, int) |
void | dig_cidx_sort (struct Plus_head *) |
int | dig_write_cidx_head (struct gvfile *, struct Plus_head *) |
int | dig_read_cidx_head (struct gvfile *, struct Plus_head *) |
Read header of cidx file. More... | |
int | dig_write_cidx (struct gvfile *, struct Plus_head *) |
int | dig_read_cidx (struct gvfile *, struct Plus_head *, int) |
Read spatial index file. More... | |
off_t | dig_ftell (struct gvfile *file) |
Get struct gvfile position. More... | |
int | dig_fseek (struct gvfile *file, off_t offset, int whence) |
Set struct gvfile position. More... | |
void | dig_rewind (struct gvfile *file) |
Rewind file position. More... | |
int | dig_fflush (struct gvfile *file) |
Flush struct gvfile. More... | |
size_t | dig_fread (void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
Read struct gvfile. More... | |
size_t | dig_fwrite (const void *ptr, size_t size, size_t nmemb, struct gvfile *file) |
Write struct gvfile. More... | |
void | dig_file_init (struct gvfile *file) |
Initialize gvfile strcuture. More... | |
int | dig_file_load (struct gvfile *file) |
Load opened struct gvfile to memory. More... | |
void | dig_file_free (struct gvfile *file) |
Free struct gvfile. More... | |
int | dig_write_frmt_ascii (FILE *, struct Format_info *, int) |
int | dig_read_frmt_ascii (FILE *, struct Format_info *) |
Read external vector format file. More... | |
int | dig__write_head (struct Map_info *) |
int | dig__read_head (struct Map_info *) |
double | dig_x_intersect (double, double, double, double, double) |
int | dig_test_for_intersection (double, double, double, double, double, double, double, double) |
int | dig_find_intersection (double, double, double, double, double, double, double, double, double *, double *) |
double | dig_distance2_point_to_line (double, double, double, double, double, double, double, double, double, int, double *, double *, double *, double *, int *) |
int | dig_set_distance_to_line_tolerance (double) |
int | dig_init_boxlist (struct boxlist *, int) |
int | dig_boxlist_add (struct boxlist *, int, const struct bound_box *) |
int | dig_init_plus (struct Plus_head *) |
Initialize Plus_head structure. More... | |
void | dig_free_plus_nodes (struct Plus_head *) |
Free Plus->Node structure. More... | |
void | dig_free_plus_lines (struct Plus_head *) |
Free Plus->Line structure. More... | |
void | dig_free_plus_areas (struct Plus_head *) |
Free Plus->Area structure. More... | |
void | dig_free_plus_isles (struct Plus_head *) |
Free Plus->Isle structure. More... | |
void | dig_free_plus (struct Plus_head *) |
Free Plus structure. More... | |
int | dig_load_plus (struct Plus_head *, struct gvfile *, int) |
Reads topo file to topo structure. More... | |
int | dig_write_plus_file (struct gvfile *, struct Plus_head *) |
Writes topo structure to topo file. More... | |
int | dig_write_nodes (struct gvfile *, struct Plus_head *) |
Writes topo structure (nodes) to topo file. More... | |
int | dig_write_lines (struct gvfile *, struct Plus_head *) |
Writes topo structure (lines) to topo file. More... | |
int | dig_write_areas (struct gvfile *, struct Plus_head *) |
Writes topo structure (areas) to topo file. More... | |
int | dig_write_isles (struct gvfile *, struct Plus_head *) |
Writes topo structure (isles) to topo file. More... | |
int | dig_add_area (struct Plus_head *, int, plus_t *, struct bound_box *) |
Allocate space for new area and create boundary info from array. More... | |
int | dig_area_add_isle (struct Plus_head *, int, int) |
Add isle to area if does not exist yet. More... | |
int | dig_area_del_isle (struct Plus_head *, int, int) |
Delete isle from area. More... | |
int | dig_del_area (struct Plus_head *, int) |
Delete area from Plus_head structure. More... | |
int | dig_add_isle (struct Plus_head *, int, plus_t *, struct bound_box *) |
Allocate space for new island and create boundary info from array. More... | |
int | dig_del_isle (struct Plus_head *, int) |
Delete island from Plus_head structure. More... | |
int | dig_build_area_with_line (struct Plus_head *, plus_t, int, plus_t **) |
Build topo for area from lines. More... | |
int | dig_angle_next_line (struct Plus_head *, plus_t, int, int, float *) |
Find line number of next angle to follow a line. More... | |
int | dig_node_angle_check (struct Plus_head *, int, int) |
Check if angles of adjacent lines differ. More... | |
int | dig_area_get_box (struct Plus_head *, plus_t, struct bound_box *) |
int | dig_isle_get_box (struct Plus_head *, plus_t, struct bound_box *) |
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. More... | |
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. More... | |
int | dig_del_line (struct Plus_head *, int, double, double, double) |
Delete line from Plus_head structure. More... | |
plus_t | dig_line_get_area (struct Plus_head *, plus_t, int) |
Get area number on line side. More... | |
int | dig_line_set_area (struct Plus_head *, plus_t, int, plus_t) |
Set area number on line side. More... | |
int | dig_add_node (struct Plus_head *, double, double, double) |
Add new node to plus structure. More... | |
int | dig_which_node (struct Plus_head *, double, double, double) |
Return actual index into node arrays of the first set of matching coordinates. More... | |
int | dig_node_add_line (struct Plus_head *, int, int, const struct line_pnts *, int) |
Add line info to node. More... | |
float | dig_node_line_angle (struct Plus_head *, int, int) |
Return line angle. More... | |
int | dig_Rd_P_node (struct Plus_head *, int i, struct gvfile *) |
int | dig_Wr_P_node (struct Plus_head *, int i, struct gvfile *) |
int | dig_Rd_P_line (struct Plus_head *, int i, struct gvfile *) |
int | dig_Wr_P_line (struct Plus_head *, int i, struct gvfile *) |
int | dig_Rd_P_area (struct Plus_head *, int i, struct gvfile *) |
int | dig_Wr_P_area (struct Plus_head *, int i, struct gvfile *) |
int | dig_Rd_P_isle (struct Plus_head *, int i, struct gvfile *) |
int | dig_Wr_P_isle (struct Plus_head *, int i, struct gvfile *) |
int | dig_Rd_Plus_head (struct gvfile *, struct Plus_head *) |
Read Plus_head from file. More... | |
int | dig_Wr_Plus_head (struct gvfile *, struct Plus_head *) |
int | dig_find_area_poly (struct line_pnts *, double *) |
double | dig_find_poly_orientation (struct line_pnts *) |
int | dig_get_poly_points (int, struct line_pnts **, int *, struct line_pnts *) |
void | dig_init_portable (struct Port_info *, int) |
Set Port_info structure to byte order of file. More... | |
int | dig__byte_order_out () |
Get byte order. More... | |
int | dig_set_cur_port (struct Port_info *) |
Set current Port_info structure. More... | |
int | dig__fread_port_D (double *, size_t, struct gvfile *) |
Read doubles from the Portable Vector Format. More... | |
int | dig__fread_port_F (float *, size_t, struct gvfile *) |
Read floats from the Portable Vector Format. More... | |
int | dig__fread_port_O (off_t *, size_t, struct gvfile *, size_t) |
Read off_ts from the Portable Vector Format. More... | |
int | dig__fread_port_L (long *, size_t, struct gvfile *) |
Read longs from the Portable Vector Format. More... | |
int | dig__fread_port_S (short *, size_t, struct gvfile *) |
Read shorts from the Portable Vector Format. More... | |
int | dig__fread_port_I (int *, size_t, struct gvfile *) |
Read integers from the Portable Vector Format. More... | |
int | dig__fread_port_P (plus_t *, size_t, struct gvfile *) |
Read plus_t from the Portable Vector Format. More... | |
int | dig__fread_port_C (char *, size_t, struct gvfile *) |
Read chars from the Portable Vector Format. More... | |
int | dig__fwrite_port_D (const double *, size_t, struct gvfile *) |
Write doubles to the Portable Vector Format. More... | |
int | dig__fwrite_port_F (const float *, size_t, struct gvfile *) |
Write floats to the Portable Vector Format. More... | |
int | dig__fwrite_port_O (const off_t *, size_t, struct gvfile *, size_t) |
Write off_ts to the Portable Vector Format. More... | |
int | dig__fwrite_port_L (const long *, size_t, struct gvfile *) |
Write longs to the Portable Vector Format. More... | |
int | dig__fwrite_port_S (const short *, size_t, struct gvfile *) |
Write shorts to the Portable Vector Format. More... | |
int | dig__fwrite_port_I (const int *, size_t, struct gvfile *) |
Write integers to the Portable Vector Format. More... | |
int | dig__fwrite_port_P (const plus_t *, size_t, struct gvfile *) |
Write plus_t to the Portable Vector Format. More... | |
int | dig__fwrite_port_C (const char *, size_t, struct gvfile *) |
Write chars to the Portable Vector Format. More... | |
int | dig_prune (struct line_pnts *, double) |
int | dig_spidx_init (struct Plus_head *) |
Initit spatial index (nodes, lines, areas, isles) More... | |
void | dig_spidx_free_nodes (struct Plus_head *) |
Free spatial index for nodes. More... | |
void | dig_spidx_free_lines (struct Plus_head *) |
Free spatial index for lines. More... | |
void | dig_spidx_free_areas (struct Plus_head *) |
Reset spatial index for areas. More... | |
void | dig_spidx_free_isles (struct Plus_head *) |
Reset spatial index for isles. More... | |
void | dig_spidx_free (struct Plus_head *) |
Free spatial index (nodes, lines, areas, isles) More... | |
int | dig_spidx_add_node (struct Plus_head *, int, double, double, double) |
Add new node to spatial index. More... | |
int | dig_spidx_add_line (struct Plus_head *, int, const struct bound_box *) |
Add new line to spatial index. More... | |
int | dig_spidx_add_area (struct Plus_head *, int, const struct bound_box *) |
Add new area to spatial index. More... | |
int | dig_spidx_add_isle (struct Plus_head *, int, const struct bound_box *) |
Add new island to spatial index. More... | |
int | dig_spidx_del_node (struct Plus_head *, int) |
Delete node from spatial index. More... | |
int | dig_spidx_del_line (struct Plus_head *, int, double, double, double) |
Delete line from spatial index. More... | |
int | dig_spidx_del_area (struct Plus_head *, int) |
Delete area from spatial index. More... | |
int | dig_spidx_del_isle (struct Plus_head *, int) |
Delete isle from spatial index. More... | |
int | dig_select_nodes (struct Plus_head *, const struct bound_box *, struct ilist *) |
Select nodes by bbox. More... | |
int | dig_select_lines (struct Plus_head *, const struct bound_box *, struct boxlist *) |
Select lines with boxes by box. More... | |
int | dig_select_areas (struct Plus_head *, const struct bound_box *, struct boxlist *) |
Select areas with boxes by box. More... | |
int | dig_select_isles (struct Plus_head *, const struct bound_box *, struct boxlist *) |
Select isles with boxes by box. More... | |
int | dig_find_node (struct Plus_head *, double, double, double) |
Find one node by coordinates. More... | |
int | dig_find_line_box (struct Plus_head *, int, struct bound_box *) |
Find box for line. More... | |
int | dig_find_area_box (struct Plus_head *, int, struct bound_box *) |
Find bounding box for given area. More... | |
int | dig_find_isle_box (struct Plus_head *, int, struct bound_box *) |
Find box for isle. More... | |
int | dig_Rd_spidx_head (struct gvfile *, struct Plus_head *) |
Read spatial index header from sidx file. More... | |
int | dig_Wr_spidx_head (struct gvfile *, struct Plus_head *) |
Write spatial index header to file. More... | |
int | dig_Wr_spidx (struct gvfile *, struct Plus_head *) |
Write spatial index to file. More... | |
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. More... | |
int | dig_dump_spidx (FILE *, const struct Plus_head *) |
Dump spatial index. More... | |
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__fread_port_*() functions. More... | |
int | dig_node_alloc_line (struct P_node *, int) |
Allocate space in P_node struct. More... | |
int | dig_alloc_nodes (struct Plus_head *, int) |
Reallocate array of pointers to nodes. More... | |
int | dig_alloc_lines (struct Plus_head *, int) |
Reallocate array of pointers to lines. More... | |
int | dig_alloc_areas (struct Plus_head *, int) |
Reallocate array of pointers to areas. More... | |
int | dig_alloc_isles (struct Plus_head *, int) |
Reallocate array of pointers to isles. More... | |
struct P_node * | dig_alloc_node () |
Allocate new node structure. More... | |
struct P_line * | dig_alloc_line () |
Allocate new line structure. More... | |
void * | dig_alloc_topo (char) |
Allocate new topo struct. More... | |
struct P_area * | dig_alloc_area () |
Allocate new area structure. More... | |
struct P_isle * | dig_alloc_isle () |
Allocate new isle structure. More... | |
void | dig_free_node (struct P_node *) |
Free node structure. More... | |
void | dig_free_line (struct P_line *) |
Free line structure. More... | |
void | dig_free_area (struct P_area *) |
Free area structure. More... | |
void | dig_free_isle (struct P_isle *) |
Free isle structure. More... | |
int | dig_alloc_points (struct line_pnts *, int) |
allocate room for 'num' X and Y arrays in struct line_pnts More... | |
int | dig_alloc_cats (struct line_cats *, int) |
Allocate room for 'num' fields and category arrays in struct line_cats. More... | |
int | dig_area_alloc_line (struct P_area *, int) |
allocate space in P_area for add new lines More... | |
int | dig_area_alloc_isle (struct P_area *, int) |
Allocate space in P_area for add new isles. More... | |
int | dig_isle_alloc_line (struct P_isle *, int) |
Allocate space in P_isle for add new lines. More... | |
int | dig_out_of_memory (void) |
For now just print message and return error code. More... | |
int | dig_type_to_store (int) |
Convert type to store type. More... | |
int | dig_type_from_store (int) |
Convert type from store type. More... | |
void | dig_line_reset_updated (struct Plus_head *) |
Reset number of updated lines. More... | |
void | dig_line_add_updated (struct Plus_head *, int, off_t) |
Add new line to updated. More... | |
void | dig_node_reset_updated (struct Plus_head *) |
Reset number of updated nodes. More... | |
void | dig_node_add_updated (struct Plus_head *, int) |
Add node to updated. More... | |
char * | color_name (int) |
char * | dig_float_point (char *, int, double) |
double | dig_unit_conversion (void) |
double * | dig__double_convert (double *, double *, int, struct dig_head *) |
float * | dig__float_convert (float *, float *, int, struct dig_head *) |
short * | dig__short_convert (short *in, short *out, int, struct dig_head *) |
long * | dig__long_convert (long *, long *, int, struct dig_head *) |
long * | dig__int_convert (int *, long *, int, struct dig_head *) |
long * | dig__plus_t_convert (plus_t *, long *, int, struct dig_head *) |
int * | dig__long_convert_to_int (long *, int *, int, struct dig_head *) |
plus_t * | dig__long_convert_to_plus_t (long *, plus_t *, int, struct dig_head *) |
char * | dig__convert_buffer (int) |
plus_t ** | dig_get_cont_lines (struct Map_info *, plus_t, double, int) |
plus_t | dig_get_next_cont_line (struct Map_info *, plus_t, double, int) |
struct dig_head * | dig_get_head (void) |
struct dig_head * | dig__get_head (void) |
int | dig_start_clock (long *) |
int | dig_stop_clock (long *) |
char * | dig_stop_clock_str (long *) |
int | dig_write_file_checks (struct gvfile *, struct Plus_head *) |
int | dig_do_file_checks (struct Map_info *, char *, char *) |
int | dig_map_to_head (struct Map_info *, struct Plus_head *) |
int | dig_head_to_map (struct Plus_head *, struct Map_info *) |
int | dig_spindex_init (struct Plus_head *) |
int | dig_point_to_area (struct Map_info *, double, double) |
int | dig_point_to_next_area (struct Map_info *, double, double, double *) |
int | dig_point_to_line (struct Map_info *, double, double, char) |
int | dig_check_dist (struct Map_info *, int, double, double, double *) |
int | dig__check_dist (struct Map_info *, struct line_pnts *, double, double, double *) |
int | dig_point_by_line (struct Map_info *, double, double, double, double, char) |
int | dig_write_head_ascii (FILE *, struct dig_head *) |
int | dig_read_head_ascii (FILE *, struct dig_head *) |
int | dig_struct_copy (void *, void *, int) |
int | dig_rmcr (char *) |
char* color_name | ( | int | ) |
void* dig__alloc_space | ( | int | , |
int * | , | ||
int | , | ||
void * | , | ||
int | |||
) |
Definition at line 50 of file allocation.c.
References dig__frealloc(), and G_calloc.
Referenced by dig_alloc_cats(), dig_alloc_points(), and dig_alloc_space().
int dig__byte_order_out | ( | ) |
Get byte order.
Definition at line 1013 of file portable.c.
References dbl_order, ENDIAN_BIG, and ENDIAN_LITTLE.
Referenced by V1_open_new_nat(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
char* dig__convert_buffer | ( | int | ) |
double* dig__double_convert | ( | double * | , |
double * | , | ||
int | , | ||
struct dig_head * | |||
) |
void* dig__falloc | ( | int | , |
int | |||
) |
float* dig__float_convert | ( | float * | , |
float * | , | ||
int | , | ||
struct dig_head * | |||
) |
int dig__fread_port_C | ( | char * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read chars from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to gvfile structure |
Definition at line 509 of file portable.c.
References dig_fread(), and PORT_CHAR.
Referenced by dig__read_head(), dig_Rd_P_line(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), V1_delete_line_nat(), and Vect_open_fidx().
int dig__fread_port_D | ( | double * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read doubles from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 79 of file portable.c.
References Port_info::dbl_quick, dig_fread(), and PORT_DOUBLE.
Referenced by dig_Rd_P_node(), and dig_Rd_Plus_head().
int dig__fread_port_F | ( | float * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read floats from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 123 of file portable.c.
References dig_fread(), Port_info::flt_quick, and PORT_FLOAT.
Referenced by dig_Rd_P_node().
int dig__fread_port_I | ( | int * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read integers from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 343 of file portable.c.
References dig_fread(), Port_info::int_quick, nat_int, and PORT_INT.
Referenced by dig__fread_port_P(), dig_Rd_P_line(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), and Vect_open_fidx().
int dig__fread_port_L | ( | long * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read longs from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 260 of file portable.c.
References dig_fread(), Port_info::lng_quick, nat_lng, and PORT_LONG.
Referenced by dig__read_head(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), and Vect_open_fidx().
int dig__fread_port_O | ( | off_t * | buf, |
size_t | cnt, | ||
struct gvfile * | fp, | ||
size_t | port_off_t_size | ||
) |
Read off_ts from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile | |
port_off_t_size | offset |
Definition at line 167 of file portable.c.
References dig_fread(), nat_off_t, and Port_info::off_t_quick.
Referenced by dig__read_head(), dig_Rd_P_line(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), and dig_read_cidx_head().
Read plus_t from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
plus_t is defined as int so we only retype pointer and use int function.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 535 of file portable.c.
References dig__fread_port_I().
Referenced by dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), and dig_Rd_Plus_head().
int dig__fread_port_S | ( | short * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Read shorts from the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
[out] | buf | data buffer |
cnt | number of members | |
fp | pointer to struct gvfile |
Definition at line 426 of file portable.c.
References dig_fread(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.
void* dig__frealloc | ( | void * | , |
int | , | ||
int | , | ||
int | |||
) |
Definition at line 133 of file allocation.c.
References G_calloc.
Referenced by dig__alloc_space(), and dig_frealloc().
int dig__fwrite_port_C | ( | const char * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write chars to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 890 of file portable.c.
References dig_fwrite(), and PORT_CHAR.
Referenced by dig__write_head(), dig_Wr_P_line(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), dig_write_cidx_head(), V1_delete_line_nat(), and Vect_save_fidx().
int dig__fwrite_port_D | ( | const double * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write doubles to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 557 of file portable.c.
References Port_info::dbl_quick, dig_fwrite(), and PORT_DOUBLE.
Referenced by dig_Wr_P_node(), and dig_Wr_Plus_head().
int dig__fwrite_port_F | ( | const float * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write floats to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 596 of file portable.c.
References dig_fwrite(), Port_info::flt_quick, and PORT_FLOAT.
Referenced by dig_Wr_P_node().
int dig__fwrite_port_I | ( | const int * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write integers to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 758 of file portable.c.
References dig_fwrite(), Port_info::int_quick, nat_int, and PORT_INT.
Referenced by dig__fwrite_port_P(), dig_Wr_P_line(), dig_Wr_spidx_head(), dig_write_cidx(), dig_write_cidx_head(), and Vect_save_fidx().
int dig__fwrite_port_L | ( | const long * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write longs to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 702 of file portable.c.
References dig_fwrite(), Port_info::lng_quick, nat_lng, and PORT_LONG.
Referenced by dig__write_head(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), dig_write_cidx_head(), and Vect_save_fidx().
int dig__fwrite_port_O | ( | const off_t * | buf, |
size_t | cnt, | ||
struct gvfile * | fp, | ||
size_t | port_off_t_size | ||
) |
Write off_ts to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
port_off_t_size |
Definition at line 636 of file portable.c.
References dig_fwrite(), nat_off_t, and Port_info::off_t_quick.
Referenced by dig__write_head(), dig_Wr_P_line(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), and dig_write_cidx_head().
Write plus_t to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 871 of file portable.c.
References dig__fwrite_port_I().
Referenced by dig_Wr_P_area(), dig_Wr_P_isle(), dig_Wr_P_line(), dig_Wr_P_node(), and dig_Wr_Plus_head().
int dig__fwrite_port_S | ( | const short * | buf, |
size_t | cnt, | ||
struct gvfile * | fp | ||
) |
Write shorts to the Portable Vector Format.
These routines must handle any type size conversions between the portable format and the native machine.
buf | data buffer | |
cnt | number of members | |
[in,out] | fp | pointer to struct gvfile |
Definition at line 814 of file portable.c.
References dig_fwrite(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.
struct dig_head* dig__get_head | ( | void | ) |
long* dig__int_convert | ( | int * | , |
long * | , | ||
int | , | ||
struct dig_head * | |||
) |
long* dig__long_convert | ( | long * | , |
long * | , | ||
int | , | ||
struct dig_head * | |||
) |
int* dig__long_convert_to_int | ( | long * | , |
int * | , | ||
int | , | ||
struct dig_head * | |||
) |
int dig__read_head | ( | struct Map_info * | ) |
Definition at line 83 of file head.c.
References Version_info::back_major, Version_info::back_minor, Port_info::byte_order, dig_head::coor_version, dig__fread_port_C(), dig__fread_port_L(), dig__fread_port_O(), Map_info::dig_fp, dig_fseek(), dig_init_portable(), dig_set_cur_port(), G_debug(), G_fatal_error(), G_warning(), GV_COOR_HEAD_SIZE, GV_COOR_VER_MAJOR, GV_COOR_VER_MINOR, Map_info::head, dig_head::head_size, Version_info::major, Version_info::minor, Map_info::name, dig_head::port, PORT_LONG_MAX, PRI_OFF_T, dig_head::size, and dig_head::with_z.
Referenced by V1_open_old_nat().
short* dig__short_convert | ( | short * | in, |
short * | out, | ||
int | , | ||
struct dig_head * | |||
) |
int dig__write_head | ( | struct Map_info * | ) |
Definition at line 22 of file head.c.
References Version_info::back_major, Version_info::back_minor, Port_info::byte_order, dig_head::coor_version, dig__fwrite_port_C(), dig__fwrite_port_L(), dig__fwrite_port_O(), Map_info::dig_fp, dig_fseek(), dig_ftell(), dig_set_cur_port(), G_debug(), GV_COOR_HEAD_SIZE, Map_info::head, dig_head::head_size, Version_info::major, Version_info::minor, dig_head::port, PORT_LONG_MAX, PRI_OFF_T, dig_head::size, and dig_head::with_z.
Referenced by V1_close_nat(), and V1_open_new_nat().
Allocate space for new area and create boundary info from array.
Then for each line in area, update line (right,left) info.
Neither islands nor centroids are filled.
[in] | plus | pointer to Plus_head structure |
[in] | n_lines | number of lines |
[in] | lines | array of lines, negative for reverse direction |
[in] | box | bounding box |
Definition at line 184 of file plus_area.c.
Referenced by Vect_build_line_area().
Allocate space for new island and create boundary info from array.
The order of input lines is expected to be counter clockwise. Then for each line in isle, update line (right,left) info.
Area number the island is within is not filled.
[in] | plus | pointer to Plus_head structure |
[in] | n_lines | number of lines |
[in] | lines | array of lines, negative for reverse direction |
[in] | box | bounding box |
Definition at line 682 of file plus_area.c.
Referenced by Vect_build_line_area().
int dig_add_line | ( | struct Plus_head * | plus, |
int | type, | ||
const struct line_pnts * | Points, | ||
const struct bound_box * | box, | ||
off_t | offset | ||
) |
Add new line to Plus_head structure.
[in,out] | plus | pointer to Plus_head structure |
type | feature type | |
Points | line geometry | |
box | bounding box | |
offset | line offset |
Definition at line 136 of file plus_line.c.
References Plus_head::alloc_lines, dig_alloc_lines(), and Plus_head::n_lines.
int dig_add_node | ( | struct Plus_head * | plus, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Add new node to plus structure.
[in] | plus | pointer to Plus_head structure |
[in] | x,y,z | coordinates |
Definition at line 102 of file plus_node.c.
References Plus_head::alloc_nodes, dig_alloc_node(), dig_alloc_nodes(), dig_spidx_add_node(), G_debug(), Plus_head::n_nodes, Plus_head::Node, x, P_node::x, P_node::y, and P_node::z.
struct P_area* dig_alloc_area | ( | ) |
Allocate new area structure.
Definition at line 266 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_area().
int dig_alloc_areas | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to areas.
Plus | pointer to Plus_head structure |
add | space for 'add' number of areas is added |
Definition at line 218 of file struct_alloc.c.
Referenced by dig_load_plus().
int dig_alloc_cats | ( | struct line_cats * | cats, |
int | num | ||
) |
Allocate room for 'num' fields and category arrays in struct line_cats.
cats | pointer to line_cats struct |
num | number of cats |
Definition at line 383 of file struct_alloc.c.
References line_cats::alloc_cats, line_cats::cat, dig__alloc_space(), dig_out_of_memory(), and line_cats::field.
Referenced by Vect_cat_set().
struct P_isle* dig_alloc_isle | ( | ) |
Allocate new isle structure.
Definition at line 301 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_isle().
int dig_alloc_isles | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to isles.
Plus | pointer to Plus_head structure |
add | space for 'add' number of isles is added. |
Definition at line 243 of file struct_alloc.c.
Referenced by dig_load_plus().
struct P_line* dig_alloc_line | ( | ) |
Allocate new line structure.
Definition at line 127 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_Rd_P_line().
int dig_alloc_lines | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to lines.
Plus | pointer to Plus_head structure |
add | space for 'add' number of lines is added. |
Definition at line 193 of file struct_alloc.c.
Referenced by dig_add_line(), dig_load_plus(), and Vect__load_map_lines_pg().
struct P_node* dig_alloc_node | ( | ) |
Allocate new node structure.
Definition at line 30 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_add_node(), and dig_Rd_P_node().
int dig_alloc_nodes | ( | struct Plus_head * | Plus, |
int | add | ||
) |
Reallocate array of pointers to nodes.
Plus | pointer to Plus_head structure |
add | number of nodes to be added |
Definition at line 105 of file struct_alloc.c.
Referenced by dig_add_node(), dig_load_plus(), and Vect__load_map_nodes_pg().
int dig_alloc_points | ( | struct line_pnts * | points, |
int | num | ||
) |
allocate room for 'num' X and Y arrays in struct line_pnts
points | pointer to line_pnts struct |
num | number of points |
Definition at line 336 of file struct_alloc.c.
References line_pnts::alloc_points, dig__alloc_space(), dig_out_of_memory(), line_pnts::x, line_pnts::y, and line_pnts::z.
void* dig_alloc_space | ( | int | , |
int * | , | ||
int | , | ||
void * | , | ||
int | |||
) |
Definition at line 33 of file allocation.c.
References dig__alloc_space(), and NULL.
void* dig_alloc_topo | ( | char | type | ) |
Allocate new topo struct.
type | to of struct to allocate |
Definition at line 145 of file struct_alloc.c.
Referenced by dig_Rd_P_line().
int dig_angle_next_line | ( | struct Plus_head * | plus, |
plus_t | current_line, | ||
int | side, | ||
int | type, | ||
float * | angle | ||
) |
Find line number of next angle to follow a line.
Assume that lines are sorted in increasing angle order and angles of points and degenerated lines are set to -9 (ignored).
[in] | plus | pointer to Plus_head structure |
[in] | current_line | current line id, negative if request for end node |
[in] | side | side GV_RIGHT or GV_LEFT |
[in] | type | line type (GV_LINE, GV_BOUNDARY or both) |
[in] | angle |
Definition at line 466 of file plus_area.c.
int dig_area_add_isle | ( | struct Plus_head * | plus, |
int | area, | ||
int | isle | ||
) |
Add isle to area if does not exist yet.
[in] | plus | pointer to Plus_head structure |
[in] | area | area id |
[in] | isle | isle id |
Definition at line 258 of file plus_area.c.
References G_debug().
Referenced by Vect_attach_isle().
int dig_area_alloc_isle | ( | struct P_area * | area, |
int | add | ||
) |
Allocate space in P_area for add new isles.
area | pointer to P_area struct |
add | number of isle to be added |
Definition at line 445 of file struct_alloc.c.
Referenced by dig_Rd_P_area().
int dig_area_alloc_line | ( | struct P_area * | area, |
int | add | ||
) |
allocate space in P_area for add new lines
area | pointer to P_area struct |
add | number of lines to be added |
Definition at line 419 of file struct_alloc.c.
Referenced by dig_Rd_P_area().
int dig_area_del_isle | ( | struct Plus_head * | plus, |
int | area, | ||
int | isle | ||
) |
Delete isle from area.
[in] | plus | pointer to Plus_head structure |
[in] | area | area id |
[in] | isle | isle id |
Definition at line 307 of file plus_area.c.
References _, Plus_head::Area, G_debug(), G_fatal_error(), P_area::isles, P_area::n_isles, and NULL.
Referenced by Vect_attach_isles().
Definition at line 64 of file vector/diglib/box.c.
Definition at line 81 of file vector/diglib/box.c.
Definition at line 34 of file vector/diglib/list.c.
References boxlist::alloc_values, boxlist::box, G_realloc, boxlist::have_boxes, boxlist::id, boxlist::n_values, and NULL.
int dig_build_area_with_line | ( | struct Plus_head * | plus, |
plus_t | first_line, | ||
int | side, | ||
plus_t ** | lines | ||
) |
Build topo for area from lines.
Area is built in clockwise order. Take a given line and start off to the RIGHT/LEFT and try to complete an area.
Possible Scenarios:
After we find an area then we call point_in_area() to see if the specified point is w/in the area
Old returns -1: error 0: no area (1: point in area) -2: island !!
[in] | plus | pointer to Plus_head structure |
[in] | first_line | line id of first line |
[in] | side | side of line to build area on (GV_LEFT | GV_RIGHT) |
[in] | lines | pointer to array of lines |
Definition at line 51 of file plus_area.c.
References P_isle::n_lines.
Referenced by Vect_build_line_area().
float dig_calc_begin_angle | ( | const struct line_pnts * | , |
double | |||
) |
Definition at line 31 of file angle.c.
References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
float dig_calc_end_angle | ( | const struct line_pnts * | , |
double | |||
) |
Definition at line 82 of file angle.c.
References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
int dig_check_dist | ( | struct Map_info * | , |
int | , | ||
double | , | ||
double | , | ||
double * | |||
) |
int dig_cidx_add_cat | ( | struct Plus_head * | , |
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
Definition at line 73 of file diglib/cindex.c.
int dig_cidx_add_cat_sorted | ( | struct Plus_head * | , |
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
Definition at line 180 of file diglib/cindex.c.
int dig_cidx_del_cat | ( | struct Plus_head * | , |
int | , | ||
int | , | ||
int | , | ||
int | |||
) |
Definition at line 272 of file diglib/cindex.c.
void dig_cidx_free | ( | struct Plus_head * | ) |
Definition at line 44 of file diglib/cindex.c.
References Cat_index::a_cats, Plus_head::a_cidx, Cat_index::cat, Plus_head::cidx, Plus_head::cidx_up_to_date, Cat_index::field, G_debug(), G_free(), Cat_index::n_cats, Plus_head::n_cidx, Cat_index::n_types, and NULL.
Referenced by dig_free_plus(), dig_read_cidx(), and Vect_build_partial().
int dig_cidx_init | ( | struct Plus_head * | Plus | ) |
Initialize Plus_head structure (cidx)
Plus | pointer to Plus_head structure |
Definition at line 29 of file diglib/cindex.c.
References Plus_head::a_cidx, Plus_head::cidx, Plus_head::cidx_up_to_date, G_debug(), G_malloc, and Plus_head::n_cidx.
Referenced by dig_init_plus(), dig_read_cidx(), and Vect_build_partial().
void dig_cidx_sort | ( | struct Plus_head * | ) |
Definition at line 333 of file diglib/cindex.c.
References G_debug(), and Plus_head::n_cidx.
int dig_del_area | ( | struct Plus_head * | plus, |
int | area | ||
) |
Delete area from Plus_head structure.
This function deletes area from the topo structure and resets references to this area in boundaries, isles (within), and the centroid (if any) to 0. Possible new area is not created by this function, so that old boundaries participating in this area are left without area information even if form new area. Not enabled now: If area is inside other area, area info for islands within deleted area is reset to that area outside. (currently area info of isles is set to 0)
[in] | plus | pointer to Plus_head structure |
[in] | area | area id |
Definition at line 357 of file plus_area.c.
int dig_del_isle | ( | struct Plus_head * | plus, |
int | isle | ||
) |
Delete island from Plus_head structure.
Reset references to it in lines and area outside.
[in] | plus | pointer to Plus_head structure |
[in] | isle | isle id |
Definition at line 757 of file plus_area.c.
int dig_del_line | ( | struct Plus_head * | plus, |
int | line, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Delete line from Plus_head structure.
Doesn't update area/isle references (dig_del_area() or dig_del_isle()) must be run before the line is deleted if the line is part of such structure). Update is info about line in nodes. If this line is last in node then node is deleted.
[in,out] | plus | pointer to Plus_head structure |
[in] | line | line id |
[in] | x,y,z | coordinates |
Definition at line 219 of file plus_line.c.
References G_debug(), Plus_head::Line, P_topo_b::N1, and P_topo_b::N2.
double dig_distance2_point_to_line | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
int | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
double * | , | ||
int * | |||
) |
Definition at line 45 of file vector/diglib/line_dist.c.
Referenced by Vect_line_distance(), and Vect_line_geodesic_distance().
int dig_do_file_checks | ( | struct Map_info * | , |
char * | , | ||
char * | |||
) |
int dig_dump_spidx | ( | FILE * | fp, |
const struct Plus_head * | Plus | ||
) |
Dump spatial index.
[out] | fp | pointer to FILE |
Plus | pointer to Plus_head structure |
Definition at line 1274 of file spindex_rw.c.
References RTree::fd, and Plus_head::Node_spidx.
Referenced by Vect_sidx_dump().
void* dig_falloc | ( | int | , |
int | |||
) |
Definition at line 91 of file allocation.c.
References dig__falloc(), G_sleep(), and NULL.
int dig_fflush | ( | struct gvfile * | file | ) |
Flush struct gvfile.
file | pointer to struct gvfile structure |
Definition at line 104 of file file.c.
References gvfile::file, and gvfile::loaded.
Referenced by dig_write_plus_file(), and V1_delete_line_nat().
void dig_file_free | ( | struct gvfile * | file | ) |
Free struct gvfile.
file | pointer to struct gvfile structure |
Definition at line 266 of file file.c.
References gvfile::alloc, G_free(), gvfile::loaded, and gvfile::start.
Referenced by V1_close_nat().
void dig_file_init | ( | struct gvfile * | file | ) |
Initialize gvfile strcuture.
[in,out] | file | pointer to gvfile structure |
Definition at line 170 of file file.c.
References G_zero().
Referenced by V1_open_new_nat(), V1_open_old_nat(), Vect_cidx_open(), Vect_open_fidx(), Vect_open_topo(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
int dig_file_load | ( | struct gvfile * | file | ) |
Find bounding box for given area.
Plus | pointer to Plus_head structure | |
area | area id | |
[out] | box | bounding box |
Definition at line 903 of file spindex.c.
References Plus_head::Area, Plus_head::Area_spidx, RTree_Rect::boundary, G_debug(), G_malloc, if(), Plus_head::Line, P_area::lines, P_topo_b::N1, Plus_head::Node, RTreeSearch(), Plus_head::Spidx_new, P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by Vect_get_area_box().
int dig_find_area_poly | ( | struct line_pnts * | , |
double * | |||
) |
Definition at line 100 of file diglib/poly.c.
Referenced by Vect_build_line_area().
int dig_find_intersection | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double * | , | ||
double * | |||
) |
Definition at line 185 of file linecros.c.
Find box for isle.
Plus | pointer to Plus_head structure | |
isle | isle id | |
[out] | box | bounding box |
Definition at line 997 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, if(), Plus_head::Isle, Plus_head::Isle_spidx, Plus_head::Line, P_isle::lines, P_topo_b::N1, Plus_head::Node, RTreeSearch(), Plus_head::Spidx_new, P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by Vect_get_isle_box().
int dig_find_node | ( | struct Plus_head * | Plus, |
double | x, | ||
double | y, | ||
double | z | ||
) |
Find one node by coordinates.
Plus | pointer to Plus_head structure |
x,y,z | coordinates |
Definition at line 710 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, Plus_head::Node_spidx, RTreeSearch(), Plus_head::Spidx_new, and x.
double dig_find_poly_orientation | ( | struct line_pnts * | ) |
Definition at line 139 of file diglib/poly.c.
char* dig_float_point | ( | char * | , |
int | , | ||
double | |||
) |
size_t dig_fread | ( | void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
struct gvfile * | file | ||
) |
Read struct gvfile.
[out] | ptr | data buffer |
size | buffer size | |
nmemb | number of members | |
file | pointer to struct gvfile structure |
Definition at line 124 of file file.c.
References gvfile::current, gvfile::end, gvfile::file, and gvfile::loaded.
Referenced by dig__fread_port_C(), dig__fread_port_D(), dig__fread_port_F(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), and dig__fread_port_S().
void* dig_frealloc | ( | void * | , |
int | , | ||
int | , | ||
int | |||
) |
Definition at line 103 of file allocation.c.
References dig__frealloc(), G_sleep(), and NULL.
void dig_free_area | ( | struct P_area * | Area | ) |
Free area structure.
Area | pointer to P_area struct to be freed |
Definition at line 284 of file struct_alloc.c.
References P_area::alloc_isles, P_area::alloc_lines, free(), G_free(), P_area::isles, and P_area::lines.
Referenced by dig_free_plus_areas().
void dig_free_isle | ( | struct P_isle * | Isle | ) |
Free isle structure.
Isle | pointer to P_isle struct to be freed |
Definition at line 319 of file struct_alloc.c.
References P_isle::alloc_lines, G_free(), and P_isle::lines.
Referenced by dig_free_plus_isles().
void dig_free_line | ( | struct P_line * | Line | ) |
Free line structure.
pointer | to P_line struct to be freed |
Definition at line 177 of file struct_alloc.c.
References G_free(), and P_line::topo.
Referenced by dig_free_plus_lines().
void dig_free_node | ( | struct P_node * | Node | ) |
Free node structure.
Node | pointer to P_node struct to be freed |
Definition at line 48 of file struct_alloc.c.
References P_node::alloc_lines, P_node::angles, G_free(), and P_node::lines.
Referenced by dig_free_plus_nodes().
void dig_free_plus | ( | struct Plus_head * | Plus | ) |
Free Plus structure.
Structure is not inited and dig_init_plus() should follow.
[in] | Plus | pointer to Plus_head structure |
Definition at line 174 of file plus.c.
References dig_cidx_free(), dig_free_plus_areas(), dig_free_plus_isles(), dig_free_plus_lines(), dig_free_plus_nodes(), dig_spidx_free(), and G_debug().
Referenced by dig_load_plus().
void dig_free_plus_areas | ( | struct Plus_head * | Plus | ) |
Free Plus->Area structure.
[in] | Plus | pointer to Plus_head structure |
Definition at line 115 of file plus.c.
References Plus_head::alloc_areas, Plus_head::Area, dig_free_area(), G_debug(), G_free(), Plus_head::n_areas, and NULL.
Referenced by dig_free_plus().
void dig_free_plus_isles | ( | struct Plus_head * | Plus | ) |
Free Plus->Isle structure.
[in] | Plus | pointer to Plus_head structure |
Definition at line 143 of file plus.c.
References Plus_head::alloc_isles, dig_free_isle(), G_debug(), G_free(), Plus_head::Isle, Plus_head::n_isles, and NULL.
Referenced by dig_free_plus().
void dig_free_plus_lines | ( | struct Plus_head * | Plus | ) |
Free Plus->Line structure.
[in] | Plus | pointer to Plus_head structure |
Definition at line 79 of file plus.c.
References Plus_head::alloc_lines, dig_free_line(), G_debug(), G_free(), Plus_head::Line, Plus_head::n_blines, Plus_head::n_clines, Plus_head::n_flines, Plus_head::n_klines, Plus_head::n_lines, Plus_head::n_llines, Plus_head::n_plines, and NULL.
Referenced by dig_free_plus().
void dig_free_plus_nodes | ( | struct Plus_head * | Plus | ) |
Free Plus->Node structure.
[in] | Plus | pointer to Plus_head structure |
Definition at line 51 of file plus.c.
References Plus_head::alloc_nodes, dig_free_node(), G_debug(), G_free(), Plus_head::n_nodes, Plus_head::Node, and NULL.
Referenced by dig_free_plus().
int dig_fseek | ( | struct gvfile * | file, |
off_t | offset, | ||
int | whence | ||
) |
Set struct gvfile position.
Start positions:
file | pointer to struct gvfile structure |
offset | offset position |
whence | start position |
Definition at line 60 of file file.c.
References gvfile::current, gvfile::file, G_fseek(), gvfile::loaded, gvfile::size, and gvfile::start.
Referenced by dig__read_head(), dig__write_head(), dig_load_plus(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), V1_delete_line_nat(), V1_rewind_nat(), and Vect_coor_info().
off_t dig_ftell | ( | struct gvfile * | file | ) |
Get struct gvfile position.
file | pointer to struct gvfile structure |
Definition at line 36 of file file.c.
References gvfile::current, gvfile::file, G_ftell(), gvfile::loaded, and gvfile::start.
Referenced by dig__write_head(), dig_Wr_Plus_head(), dig_Wr_spidx_head(), dig_write_areas(), dig_write_cidx(), dig_write_cidx_head(), dig_write_isles(), dig_write_lines(), dig_write_nodes(), V1_read_next_line_nat(), and Vect_coor_info().
size_t dig_fwrite | ( | const void * | ptr, |
size_t | size, | ||
size_t | nmemb, | ||
struct gvfile * | file | ||
) |
Write struct gvfile.
ptr | data buffer | |
size | buffer size | |
nmemb | number of members | |
[out] | file | pointer to struct gvfile structure |
Definition at line 156 of file file.c.
References _, gvfile::file, G_fatal_error(), and gvfile::loaded.
Referenced by dig__fwrite_port_C(), dig__fwrite_port_D(), dig__fwrite_port_F(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig__fwrite_port_O(), and dig__fwrite_port_S().
struct dig_head* dig_get_head | ( | void | ) |
Definition at line 37 of file diglib/poly.c.
int dig_init_boxlist | ( | struct boxlist * | , |
int | |||
) |
Definition at line 22 of file vector/diglib/list.c.
References boxlist::alloc_values, boxlist::box, boxlist::have_boxes, boxlist::id, boxlist::n_values, and NULL.
int dig_init_plus | ( | struct Plus_head * | Plus | ) |
Initialize Plus_head structure.
[in,out] | Plus | pointer to Plus_head structure |
Definition at line 31 of file plus.c.
References Plus_head::built, dig_cidx_init(), dig_spidx_init(), G_debug(), G_zero(), and GV_BUILD_NONE.
Referenced by dig_load_plus().
void dig_init_portable | ( | struct Port_info * | port, |
int | byte_order | ||
) |
Set Port_info structure to byte order of file.
port | pointer to Port_info structure |
byte_order | ENDIAN_BIG or ENDIAN_LITTLE |
Definition at line 905 of file portable.c.
References Port_info::byte_order, dbl_cnvrt, Port_info::dbl_cnvrt, dbl_order, Port_info::dbl_quick, ENDIAN_BIG, FALSE, flt_cnvrt, Port_info::flt_cnvrt, flt_order, Port_info::flt_quick, int_cnvrt, Port_info::int_cnvrt, int_order, Port_info::int_quick, lng_cnvrt, Port_info::lng_cnvrt, lng_order, Port_info::lng_quick, nat_off_t, off_t_cnvrt, Port_info::off_t_cnvrt, off_t_order, Port_info::off_t_quick, PORT_DOUBLE, PORT_FLOAT, port_init(), PORT_INT, PORT_LONG, PORT_SHORT, shrt_cnvrt, Port_info::shrt_cnvrt, shrt_order, Port_info::shrt_quick, and TRUE.
Referenced by dig__read_head(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), V1_open_new_nat(), Vect_open_fidx(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
int dig_is_line_degenerate | ( | const struct line_pnts * | , |
double | |||
) |
Definition at line 135 of file angle.c.
References line_pnts::n_points, line_pnts::x, and line_pnts::y.
int dig_isle_alloc_line | ( | struct P_isle * | isle, |
int | add | ||
) |
Allocate space in P_isle for add new lines.
isle | pointer to P_area struct |
add | number of isle to be added |
Definition at line 471 of file struct_alloc.c.
Referenced by dig_Rd_P_isle().
void dig_line_add_updated | ( | struct Plus_head * | Plus, |
int | line, | ||
off_t | offset | ||
) |
Add new line to updated.
Plus | pointer to Plus_head structure |
line | line id |
offset | line offset (negative offset is ignored) |
Definition at line 37 of file vector/diglib/update.c.
Definition at line 24 of file vector/diglib/box.c.
Referenced by Vect_build_line_area().
int dig_line_degenerate | ( | const struct line_pnts * | ) |
Definition at line 180 of file angle.c.
Referenced by dig_calc_begin_angle(), and dig_calc_end_angle().
Get area number on line side.
[in] | plus | pointer Plus_head structure |
[in] | line | line id |
[in] | side | side id (GV_LEFT || GV_RIGHT) |
Definition at line 343 of file plus_line.c.
References Plus_head::Line.
Referenced by Vect_build_line_area().
void dig_line_reset_updated | ( | struct Plus_head * | Plus | ) |
Reset number of updated lines.
Plus | pointer to Plus_head structure |
Definition at line 25 of file vector/diglib/update.c.
References Plus_head::n_uplines, and Plus_head::uplist.
Set area number on line side.
[in] | plus | pointer Plus_head structure |
[in] | line | line id |
[in] | side | side id (GV_LEFT || GV_RIGHT) |
[in] | area | area id |
Definition at line 384 of file plus_line.c.
References Plus_head::Line.
Reads topo file to topo structure.
[in,out] | Plus | pointer to Plus_head structure |
[in] | plus | topo file |
[in] | head_only | read only head |
Definition at line 196 of file plus.c.
References _, Plus_head::Area_offset, dig_alloc_areas(), dig_alloc_isles(), dig_alloc_lines(), dig_alloc_nodes(), dig_free_plus(), dig_fseek(), dig_init_plus(), dig_Rd_P_area(), dig_Rd_P_isle(), dig_Rd_P_line(), dig_Rd_P_node(), dig_Rd_Plus_head(), dig_set_cur_port(), G_debug(), G_fatal_error(), Plus_head::Isle_offset, Plus_head::Line_offset, Plus_head::n_areas, Plus_head::n_isles, Plus_head::n_lines, Plus_head::n_nodes, Plus_head::Node_offset, and Plus_head::port.
Referenced by Vect_open_topo().
int dig_node_add_line | ( | struct Plus_head * | plus, |
int | nodeid, | ||
int | lineid, | ||
const struct line_pnts * | points, | ||
int | type | ||
) |
Add line info to node.
Line will be negative if END node
'node' must of course already exist space will be alloced to add 'line' to array
Lines are sorted in increasing angle order and degenerated lines are set to -9 (ignored).
[in] | plus | pointer to Plus_head structure |
[in] | nodeid | node id |
[in] | lineid | line id |
[in] | points | line geometry |
[in] | type | line type |
Definition at line 45 of file plus_node.c.
void dig_node_add_updated | ( | struct Plus_head * | Plus, |
int | node | ||
) |
Add node to updated.
Plus | pointer to Plus_head structure |
node | node id |
Definition at line 86 of file vector/diglib/update.c.
References Plus_head::alloc_upnodes, G_debug(), G_realloc, Plus_head::n_upnodes, Plus_head::uplist, and Plus_head::upnodes.
int dig_node_alloc_line | ( | struct P_node * | node, |
int | add | ||
) |
Allocate space in P_node struct.
Lines and angles arrays to add 'add' more lines
node | pointer to P_node struct |
add | number lines to be added |
Definition at line 69 of file struct_alloc.c.
Referenced by dig_Rd_P_node().
Check if angles of adjacent lines differ.
Negative line number for end point. Assume that lines are sorted in increasing angle order and angles of points and degenerated lines are set to 9 (ignored).
[in] | plus | pointer to Plus_head structure |
[in] | line | current line id, negative if request for node 2 |
[in] | type | line type (GV_LINE, GV_BOUNDARY or both) |
Definition at line 607 of file plus_area.c.
float dig_node_line_angle | ( | struct Plus_head * | plus, |
int | nodeid, | ||
int | lineid | ||
) |
Return line angle.
Lines is specified by line id in topology, NOT by order number. Negative id if looking for line end point.
[in] | plus | pointer to Plus_head structure |
[in] | nodeid | node id |
[in] | lineid | line id |
Definition at line 198 of file plus_node.c.
References _, P_node::angles, G_debug(), G_fatal_error(), P_node::lines, P_node::n_lines, and Plus_head::Node.
void dig_node_reset_updated | ( | struct Plus_head * | Plus | ) |
Reset number of updated nodes.
Plus | pointer to Plus_head structure |
Definition at line 75 of file vector/diglib/update.c.
References Plus_head::n_upnodes, and Plus_head::uplist.
int dig_out_of_memory | ( | void | ) |
For now just print message and return error code.
Definition at line 492 of file struct_alloc.c.
References _, and G_warning().
Referenced by dig_alloc_cats(), and dig_alloc_points().
int dig_point_by_line | ( | struct Map_info * | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
char | |||
) |
int dig_point_to_area | ( | struct Map_info * | , |
double | , | ||
double | |||
) |
int dig_point_to_line | ( | struct Map_info * | , |
double | , | ||
double | , | ||
char | |||
) |
int dig_point_to_next_area | ( | struct Map_info * | , |
double | , | ||
double | , | ||
double * | |||
) |
int dig_prune | ( | struct line_pnts * | , |
double | |||
) |
Definition at line 74 of file prune.c.
References cur_x, cur_y, line_pnts::n_points, t, line_pnts::x, and line_pnts::y.
Definition at line 329 of file plus_struct.c.
References Plus_head::Area, P_area::centroid, dig__fread_port_P(), dig_alloc_area(), dig_area_alloc_isle(), dig_area_alloc_line(), G_debug(), P_area::isles, P_area::lines, P_area::n_isles, P_area::n_lines, and NULL.
Referenced by dig_load_plus().
Definition at line 414 of file plus_struct.c.
References P_isle::area, dig__fread_port_P(), dig_alloc_isle(), dig_isle_alloc_line(), G_debug(), Plus_head::Isle, P_isle::lines, P_isle::n_lines, and NULL.
Referenced by dig_load_plus().
Definition at line 148 of file plus_struct.c.
References P_topo_c::area, dig__fread_port_C(), dig__fread_port_I(), dig__fread_port_O(), dig__fread_port_P(), dig_alloc_line(), dig_alloc_topo(), dig_type_from_store(), G_debug(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, if(), P_topo_b::left, P_topo_f::left, Plus_head::Line, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, NULL, Plus_head::off_t_size, P_line::offset, P_topo_b::right, P_line::topo, P_line::type, P_topo_k::volume, and Plus_head::with_z.
Referenced by dig_load_plus().
Definition at line 50 of file plus_struct.c.
References P_node::angles, dig__fread_port_D(), dig__fread_port_F(), dig__fread_port_P(), dig_alloc_node(), dig_node_alloc_line(), G_debug(), P_node::lines, P_node::n_lines, Plus_head::Node, NULL, Plus_head::with_z, P_node::x, P_node::y, and P_node::z.
Referenced by dig_load_plus().
Read Plus_head from file.
fp | pointer to gvfile structure | |
[in,out] | ptr | pointer to Plus_head structure |
Definition at line 489 of file plus_struct.c.
References _, Plus_head::Area_offset, bound_box::B, Version_info::back_major, Version_info::back_minor, Plus_head::box, Plus_head::coor_size, dig__fread_port_C(), dig__fread_port_D(), dig__fread_port_L(), dig__fread_port_O(), dig__fread_port_P(), dig_fseek(), dig_init_portable(), dig_rewind(), dig_set_cur_port(), bound_box::E, Plus_head::Edge_offset, G_debug(), G_fatal_error(), G_warning(), GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GV_TOPO_VER_MAJOR, GV_TOPO_VER_MINOR, Plus_head::head_size, Plus_head::Hole_offset, Plus_head::Isle_offset, Plus_head::Line_offset, Version_info::major, Version_info::minor, bound_box::N, Plus_head::n_areas, Plus_head::n_blines, Plus_head::n_clines, Plus_head::n_edges, Plus_head::n_flines, Plus_head::n_holes, Plus_head::n_isles, Plus_head::n_klines, Plus_head::n_lines, Plus_head::n_llines, Plus_head::n_nodes, Plus_head::n_plines, Plus_head::n_volumes, Plus_head::Node_offset, Plus_head::off_t_size, Plus_head::port, PRI_OFF_T, bound_box::S, bound_box::T, Plus_head::topo, Plus_head::version, Plus_head::Volume_offset, bound_box::W, and Plus_head::with_z.
Referenced by dig_load_plus(), and Vect_open_topo().
Read spatial index from sidx file Only needed when old vector is opened in update mode.
fp | pointer to struct gvfile | |
[in,out] | Plus | pointer to Plus_head structure |
Definition at line 1230 of file spindex_rw.c.
References dig_Rd_spidx_head(), dig_rewind(), dig_set_cur_port(), dig_spidx_free(), dig_spidx_init(), G_debug(), and Plus_head::spidx_port.
Read spatial index header from sidx file.
fp | pointer to struct gvfile | |
[in,out] | ptr | pointer to Plus_head structure |
Definition at line 268 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, Version_info::back_major, Version_info::back_minor, Plus_head::coor_size, dig__fread_port_C(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), dig_fseek(), dig_init_portable(), dig_rewind(), dig_set_cur_port(), Plus_head::Face_spidx_offset, G_debug(), G_fatal_error(), G_warning(), GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GV_SIDX_VER_MAJOR, GV_SIDX_VER_MINOR, Plus_head::Hole_spidx_offset, Plus_head::Isle_spidx, Plus_head::Isle_spidx_offset, RTree::leafcard, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, Version_info::major, RTree::min_leaf_fill, RTree::min_node_fill, Version_info::minor, RTree::n_leafs, RTree::n_nodes, RTree::ndims, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, RTree::nodecard, RTree::nodesize, RTree::nsides, Port_info::off_t_size, Plus_head::off_t_size, RTree::rootlevel, RTree::rootpos, Plus_head::spidx, Plus_head::spidx_head_size, Plus_head::spidx_port, Plus_head::spidx_with_z, t, Plus_head::version, and Plus_head::Volume_spidx_offset.
Referenced by dig_Rd_spidx().
Read spatial index file.
fp | pointer to gvfile structure | |
[in,out] | plus | pointer to Plus_head structure |
head_only | non-zero to read only head |
Definition at line 291 of file cindex_rw.c.
References Cat_index::a_cats, Cat_index::cat, Plus_head::cidx, Plus_head::cidx_port, Plus_head::cidx_up_to_date, dig__fread_port_I(), dig_cidx_free(), dig_cidx_init(), dig_fseek(), dig_read_cidx_head(), dig_rewind(), dig_set_cur_port(), dig_type_from_store(), G_debug(), G_malloc, Cat_index::n_cats, Plus_head::n_cidx, and Cat_index::offset.
Referenced by Vect_cidx_open().
Read header of cidx file.
fp | pointer to gvfile structure |
plus | pointer to Plus_head strcuture |
Definition at line 122 of file cindex_rw.c.
References _, Cat_index::a_cats, Plus_head::a_cidx, Version_info::back_major, Version_info::back_minor, Cat_index::cat, Plus_head::cidx, Plus_head::cidx_head_size, Plus_head::cidx_port, Plus_head::coor_size, dig__fread_port_C(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), dig_fseek(), dig_init_portable(), dig_rewind(), dig_set_cur_port(), dig_type_from_store(), Cat_index::field, G_debug(), G_fatal_error(), G_realloc, G_warning(), GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GV_CIDX_VER_MAJOR, GV_CIDX_VER_MINOR, Version_info::major, Version_info::minor, Cat_index::n_cats, Plus_head::n_cidx, Cat_index::n_types, Cat_index::n_ucats, NULL, Plus_head::off_t_size, Cat_index::offset, PORT_LONG_MAX, t, Cat_index::type, and Plus_head::version.
Referenced by dig_read_cidx().
int dig_read_frmt_ascii | ( | FILE * | dascii, |
struct Format_info * | finfo | ||
) |
Read external vector format file.
dascii | format file (frmt) | |
[out] | finfo | pointer to Format_info structure |
Definition at line 32 of file frmt.c.
References _, Format_info_pg::conninfo, Format_info_ogr::dsn, Format_info_pg::fid_column, G_chop(), G_debug(), G_getl2(), G_store(), G_strcasecmp(), G_warning(), G_zero(), GV_FORMAT_OGR, GV_FORMAT_POSTGIS, GV_PG_FID_COLUMN, Format_info_ogr::layer_name, Format_info::ogr, Format_info::pg, Format_info_pg::schema_name, Format_info_pg::table_name, Format_info_ogr::where, and Format_info_pg::where.
int dig_read_head_ascii | ( | FILE * | , |
struct dig_head * | |||
) |
int dig_restore_line | ( | struct Plus_head * | plus, |
int | lineid, | ||
int | type, | ||
const struct line_pnts * | Points, | ||
const struct bound_box * | box, | ||
off_t | offset | ||
) |
Restore line in Plus_head structure.
[in,out] | plus | pointer to Plus_head structure |
type | feature type | |
Points | line geometry | |
box | bounding box | |
offset | line offset |
Definition at line 192 of file plus_line.c.
References Plus_head::n_lines.
void dig_rewind | ( | struct gvfile * | file | ) |
Rewind file position.
file | pointer to gvfile structure |
Definition at line 87 of file file.c.
References gvfile::current, gvfile::file, gvfile::loaded, and gvfile::start.
Referenced by dig_Rd_Plus_head(), dig_Rd_spidx(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_cidx(), dig_write_cidx_head(), and dig_write_plus_file().
int dig_rmcr | ( | char * | ) |
int dig_select_areas | ( | struct Plus_head * | Plus, |
const struct bound_box * | box, | ||
struct boxlist * | list | ||
) |
Select areas with boxes by box.
Plus | pointer to Plus_head structure |
box | bounding box |
list | boxlist of selected areas |
Definition at line 862 of file spindex.c.
References Plus_head::Area_spidx, bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, boxlist::n_values, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.
int dig_select_isles | ( | struct Plus_head * | Plus, |
const struct bound_box * | box, | ||
struct boxlist * | list | ||
) |
Select isles with boxes by box.
Plus | pointer to Plus_head structure |
box | bounding box |
list | boxlist of selected isles |
Definition at line 956 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, Plus_head::Isle_spidx, bound_box::N, boxlist::n_values, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.
Referenced by Vect_select_isles_by_box().
int dig_select_lines | ( | struct Plus_head * | Plus, |
const struct bound_box * | box, | ||
struct boxlist * | list | ||
) |
Select lines with boxes by box.
Plus | pointer to Plus_head structure |
box | bounding box |
list | boxlist of selected lines |
Definition at line 750 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, Plus_head::Line_spidx, bound_box::N, boxlist::n_values, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.
Select nodes by bbox.
Plus | pointer to Plus_head structure |
box | bounding box |
list | list of selected lines |
Definition at line 663 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, ilist::n_values, Plus_head::Node_spidx, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.
Referenced by Vect_select_nodes_by_box().
int dig_set_cur_port | ( | struct Port_info * | port | ) |
Set current Port_info structure.
port | pointer to Port_info structure |
Definition at line 1001 of file portable.c.
Referenced by dig__read_head(), dig__write_head(), dig_load_plus(), dig_Rd_Plus_head(), dig_Rd_spidx(), dig_Rd_spidx_head(), dig_read_cidx(), dig_read_cidx_head(), dig_Wr_Plus_head(), dig_Wr_spidx(), dig_Wr_spidx_head(), dig_write_cidx(), dig_write_cidx_head(), dig_write_plus_file(), rtree_search(), V1_delete_line_nat(), Vect_open_fidx(), and Vect_save_fidx().
int dig_set_distance_to_line_tolerance | ( | double | ) |
Definition at line 24 of file vector/diglib/line_dist.c.
References TOLERANCE.
Add new area to spatial index.
Plus | pointer to Plus_head structure |
area | area id |
box | bounding box |
Definition at line 353 of file spindex.c.
References Plus_head::Area_spidx, bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, RTreeInsertRect(), bound_box::S, bound_box::T, and bound_box::W.
Add new island to spatial index.
Plus | pointer to Plus_head structure |
isle | isle id |
box | bounding box |
Definition at line 388 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, Plus_head::Isle_spidx, bound_box::N, RTreeInsertRect(), bound_box::S, bound_box::T, and bound_box::W.
int dig_spidx_add_node | ( | struct Plus_head * | Plus, |
int | node, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Add new node to spatial index.
Plus | pointer to Plus_head structure |
node | node id |
x,y,z | node coordinates |
Definition at line 284 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, Plus_head::Node_spidx, RTreeInsertRect(), and x.
Referenced by dig_add_node().
int dig_spidx_del_area | ( | struct Plus_head * | Plus, |
int | area | ||
) |
Delete area from spatial index.
G_fatal_error() called on error.
Plus | pointer to Plus_head structure |
area | area id |
Definition at line 508 of file spindex.c.
References _, Plus_head::Area, Plus_head::Area_spidx, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, Plus_head::Line, P_area::lines, P_topo_b::N1, Plus_head::Node, NULL, RTreeDeleteRect(), P_line::topo, P_node::x, P_node::y, and P_node::z.
int dig_spidx_del_isle | ( | struct Plus_head * | Plus, |
int | isle | ||
) |
Delete isle from spatial index.
G_fatal_error() called on error.
Plus | pointer to Plus_head structure |
isle | isle id |
Definition at line 561 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, Plus_head::Isle, Plus_head::Isle_spidx, Plus_head::Line, P_isle::lines, P_topo_b::N1, Plus_head::Node, RTreeDeleteRect(), P_line::topo, P_node::x, P_node::y, and P_node::z.
int dig_spidx_del_line | ( | struct Plus_head * | Plus, |
int | line, | ||
double | x, | ||
double | y, | ||
double | z | ||
) |
Delete line from spatial index.
G_fatal_error() called on error.
Plus | pointer to Plus_head structure |
line | line id |
x,y,z | coordinates |
int dig_spidx_del_node | ( | struct Plus_head * | Plus, |
int | node | ||
) |
Delete node from spatial index.
G_fatal_error() called on error.
Plus | pointer to Plus_head structure |
node | node id |
Definition at line 423 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, Plus_head::Node, Plus_head::Node_spidx, RTreeDeleteRect(), P_node::x, P_node::y, and P_node::z.
void dig_spidx_free | ( | struct Plus_head * | Plus | ) |
Free spatial index (nodes, lines, areas, isles)
Plus | pointer to Plus_head structure |
Definition at line 235 of file spindex.c.
References Plus_head::Area_spidx, RTree::fd, Plus_head::Isle_spidx, Plus_head::Line_spidx, Plus_head::Node_spidx, RTreeDestroyTree(), and Plus_head::Spidx_new.
Referenced by dig_free_plus(), and dig_Rd_spidx().
void dig_spidx_free_areas | ( | struct Plus_head * | Plus | ) |
Reset spatial index for areas.
Plus | pointer to Plus_head structure |
Definition at line 171 of file spindex.c.
References Plus_head::Area_spidx, RTree::fd, and Plus_head::with_z.
void dig_spidx_free_isles | ( | struct Plus_head * | Plus | ) |
Reset spatial index for isles.
Plus | pointer to Plus_head structure |
Definition at line 203 of file spindex.c.
References RTree::fd, Plus_head::Isle_spidx, and Plus_head::with_z.
void dig_spidx_free_lines | ( | struct Plus_head * | Plus | ) |
Free spatial index for lines.
Plus | pointer to Plus_head structure |
Definition at line 139 of file spindex.c.
References RTree::fd, Plus_head::Line_spidx, and Plus_head::with_z.
void dig_spidx_free_nodes | ( | struct Plus_head * | Plus | ) |
Free spatial index for nodes.
Plus | pointer to Plus_head structure |
Definition at line 107 of file spindex.c.
References RTree::fd, Plus_head::Node_spidx, and Plus_head::with_z.
int dig_spidx_init | ( | struct Plus_head * | Plus | ) |
Initit spatial index (nodes, lines, areas, isles)
Plus | pointer to Plus_head structure |
Definition at line 35 of file spindex.c.
References G_debug(), Plus_head::Spidx_file, Plus_head::spidx_with_z, and Plus_head::with_z.
Referenced by dig_init_plus(), and dig_Rd_spidx().
int dig_spindex_init | ( | struct Plus_head * | ) |
int dig_start_clock | ( | long * | ) |
int dig_stop_clock | ( | long * | ) |
char* dig_stop_clock_str | ( | long * | ) |
int dig_struct_copy | ( | void * | , |
void * | , | ||
int | |||
) |
int dig_test_for_intersection | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | |||
) |
Definition at line 58 of file linecros.c.
int dig_type_from_store | ( | int | stype | ) |
Convert type from store type.
stype | feature store type |
Definition at line 57 of file vector/diglib/type.c.
References GV_AREA, GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, GV_STORE_AREA, GV_STORE_BOUNDARY, GV_STORE_CENTROID, GV_STORE_FACE, GV_STORE_KERNEL, GV_STORE_LINE, GV_STORE_POINT, GV_STORE_VOLUME, and GV_VOLUME.
Referenced by dig_Rd_P_line(), dig_read_cidx(), dig_read_cidx_head(), and dig_write_cidx().
int dig_type_to_store | ( | int | type | ) |
Convert type to store type.
type | feature type |
Definition at line 26 of file vector/diglib/type.c.
Referenced by dig_Wr_P_line(), dig_write_cidx(), and dig_write_cidx_head().
double dig_unit_conversion | ( | void | ) |
int dig_which_node | ( | struct Plus_head * | plus, |
double | x, | ||
double | y, | ||
double | thresh | ||
) |
Return actual index into node arrays of the first set of matching coordinates.
[in] | plus | pointer to Plus_head structure |
[in] | x,y | coordinates |
[in] | thresh | threshold value |
Definition at line 146 of file plus_node.c.
References Plus_head::n_nodes, Plus_head::Node, NULL, P_node::x, and P_node::y.
Definition at line 376 of file plus_struct.c.
References Plus_head::Area, P_area::centroid, dig__fwrite_port_P(), P_area::isles, P_area::lines, P_area::n_isles, P_area::n_lines, and NULL.
Referenced by dig_write_areas().
Definition at line 450 of file plus_struct.c.
References P_isle::area, dig__fwrite_port_P(), Plus_head::Isle, P_isle::lines, P_isle::n_lines, and NULL.
Referenced by dig_write_isles().
Definition at line 239 of file plus_struct.c.
References P_topo_c::area, dig__fwrite_port_C(), dig__fwrite_port_I(), dig__fwrite_port_O(), dig__fwrite_port_P(), dig_type_to_store(), G_debug(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, if(), P_topo_b::left, P_topo_f::left, Plus_head::Line, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, NULL, Plus_head::off_t_size, P_line::offset, P_topo_b::right, P_topo_f::right, P_line::topo, P_line::type, P_topo_k::volume, and Plus_head::with_z.
Referenced by dig_write_lines().
Definition at line 103 of file plus_struct.c.
References P_node::angles, dig__fwrite_port_D(), dig__fwrite_port_F(), dig__fwrite_port_P(), G_debug(), P_node::lines, P_node::n_lines, Plus_head::Node, NULL, Plus_head::with_z, P_node::x, P_node::y, and P_node::z.
Referenced by dig_write_nodes().
Definition at line 646 of file plus_struct.c.
References Plus_head::Area_offset, bound_box::B, Plus_head::box, Port_info::byte_order, Plus_head::coor_size, dig__fwrite_port_C(), dig__fwrite_port_D(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig__fwrite_port_P(), dig_ftell(), dig_rewind(), dig_set_cur_port(), bound_box::E, Plus_head::Edge_offset, G_debug(), GV_TOPO_EARLIEST_MAJOR, GV_TOPO_EARLIEST_MINOR, GV_TOPO_VER_MAJOR, GV_TOPO_VER_MINOR, Plus_head::Hole_offset, Plus_head::Isle_offset, Plus_head::Line_offset, bound_box::N, Plus_head::n_areas, Plus_head::n_blines, Plus_head::n_clines, Plus_head::n_edges, Plus_head::n_flines, Plus_head::n_holes, Plus_head::n_isles, Plus_head::n_klines, Plus_head::n_lines, Plus_head::n_llines, Plus_head::n_nodes, Plus_head::n_plines, Plus_head::n_volumes, Plus_head::Node_offset, Plus_head::off_t_size, Plus_head::port, PORT_LONG_MAX, PRI_OFF_T, bound_box::S, bound_box::T, Plus_head::Volume_offset, bound_box::W, and Plus_head::with_z.
Referenced by dig_write_plus_file().
Write spatial index to file.
[out] | fp | pointer to struct gvfile |
Plus | pointer to Plus_head structure |
Definition at line 1180 of file spindex_rw.c.
References dig_rewind(), dig_set_cur_port(), dig_Wr_spidx_head(), G_debug(), Plus_head::Node_spidx_offset, and Plus_head::spidx_port.
Referenced by Vect_save_sidx().
Write spatial index header to file.
[in,out] | fp | pointer to struct gvfile |
ptr | pointer to Plus_head structure |
Definition at line 56 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, Port_info::byte_order, Plus_head::coor_size, dig__fwrite_port_C(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig_ftell(), dig_rewind(), dig_set_cur_port(), Plus_head::Face_spidx_offset, G_debug(), G_fatal_error(), GV_SIDX_EARLIEST_MAJOR, GV_SIDX_EARLIEST_MINOR, GV_SIDX_VER_MAJOR, GV_SIDX_VER_MINOR, Plus_head::Hole_spidx_offset, if(), Plus_head::Isle_spidx, Plus_head::Isle_spidx_offset, RTree::leafcard, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, RTree::min_leaf_fill, RTree::min_node_fill, RTree::n_leafs, RTree::n_nodes, RTree::ndims, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, RTree::nodecard, RTree::nodesize, RTree::nsides, Port_info::off_t_size, Plus_head::off_t_size, PORT_INT_MAX, RTree::rootlevel, Plus_head::spidx_head_size, Plus_head::spidx_port, Plus_head::spidx_with_z, t, and Plus_head::Volume_spidx_offset.
Referenced by dig_Wr_spidx().
Writes topo structure (areas) to topo file.
[in,out] | plus | topo file |
[in] | Plus | pointer to Plus_head structure |
Definition at line 371 of file plus.c.
References Plus_head::Area_offset, dig_ftell(), dig_Wr_P_area(), and Plus_head::n_areas.
Referenced by dig_write_plus_file().
Definition at line 247 of file cindex_rw.c.
References Cat_index::cat, Plus_head::cidx, Plus_head::cidx_port, dig__fwrite_port_I(), dig_ftell(), dig_rewind(), dig_set_cur_port(), dig_type_from_store(), dig_type_to_store(), dig_write_cidx_head(), Cat_index::n_cats, Plus_head::n_cidx, and Cat_index::offset.
Definition at line 24 of file cindex_rw.c.
References Port_info::byte_order, Plus_head::cidx, Plus_head::cidx_port, Plus_head::coor_size, dig__fwrite_port_C(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig_ftell(), dig_rewind(), dig_set_cur_port(), dig_type_to_store(), Cat_index::field, G_debug(), GV_CIDX_EARLIEST_MAJOR, GV_CIDX_EARLIEST_MINOR, GV_CIDX_VER_MAJOR, GV_CIDX_VER_MINOR, Cat_index::n_cats, Plus_head::n_cidx, Cat_index::n_types, Cat_index::n_ucats, Plus_head::off_t_size, Cat_index::offset, PORT_LONG_MAX, PRI_OFF_T, t, and Cat_index::type.
Referenced by dig_write_cidx().
int dig_write_frmt_ascii | ( | FILE * | , |
struct Format_info * | , | ||
int | |||
) |
int dig_write_head_ascii | ( | FILE * | , |
struct dig_head * | |||
) |
Writes topo structure (isles) to topo file.
[in,out] | plus | topo file |
[in] | Plus | pointer to Plus_head structure |
Definition at line 396 of file plus.c.
References dig_ftell(), dig_Wr_P_isle(), Plus_head::Isle_offset, and Plus_head::n_isles.
Referenced by dig_write_plus_file().
Writes topo structure (lines) to topo file.
[in,out] | plus | topo file |
[in] | Plus | pointer to Plus_head structure |
Definition at line 346 of file plus.c.
References dig_ftell(), dig_Wr_P_line(), Plus_head::Line_offset, and Plus_head::n_lines.
Referenced by dig_write_plus_file().
Writes topo structure (nodes) to topo file.
[in,out] | plus | topo file |
[in] | Plus | pointer to Plus_head structure |
Definition at line 322 of file plus.c.
References dig_ftell(), dig_Wr_P_node(), Plus_head::n_nodes, and Plus_head::Node_offset.
Referenced by dig_write_plus_file().
Writes topo structure to topo file.
[in,out] | fp_plus | topo file |
[in] | Plus | pointer to Plus_head structure |
Definition at line 272 of file plus.c.
References _, dig_fflush(), dig_rewind(), dig_set_cur_port(), dig_Wr_Plus_head(), dig_write_areas(), dig_write_isles(), dig_write_lines(), dig_write_nodes(), G_warning(), and Plus_head::port.
Referenced by Vect_save_topo().
double dig_x_intersect | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | |||
) |
int rtree_search | ( | struct RTree * | t, |
struct RTree_Rect * | r, | ||
SearchHitCallback | shcb, | ||
void * | cbarg, | ||
struct Plus_head * | Plus | ||
) |
Search spatial index file Can't use regular RTreeSearch() here because sidx must be read with dig__fread_port_*() functions.
t | pointer to RTree |
r | search rectangle |
shcb | user-provided callback |
cbarg | argument for shcb |
Plus | pointer to Plus_head structure |
Definition at line 1398 of file spindex_rw.c.
References assert, dig_set_cur_port(), and Plus_head::spidx_port.