GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-602118adcc
dig_externs.h File Reference
#include <grass/gis.h>
Include dependency graph for dig_externs.h:
This graph shows which files directly or indirectly include this file:

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 structure. 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 *)
 Write Plus_head to file. More...
 
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 (void)
 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_nodedig_alloc_node (void)
 Allocate new node structure. More...
 
struct P_linedig_alloc_line (void)
 Allocate new line structure. More...
 
void * dig_alloc_topo (char)
 Allocate new topo struct. More...
 
struct P_areadig_alloc_area (void)
 Allocate new area structure. More...
 
struct P_isledig_alloc_isle (void)
 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_tdig__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_headdig_get_head (void)
 
struct dig_headdig__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 *)
 

Function Documentation

◆ color_name()

char* color_name ( int  )

◆ dig__alloc_space()

void* dig__alloc_space ( int  n_wanted,
int *  n_elements,
int  chunk_size,
void *  ptr,
int  element_size 
)

Definition at line 49 of file allocation.c.

References dig__frealloc(), and G_calloc.

Referenced by dig_alloc_cats(), dig_alloc_points(), and dig_alloc_space().

◆ dig__byte_order_out()

int dig__byte_order_out ( void  )

Get byte order.

Returns
ENDIAN_LITTLE
ENDIAN_BIG

Definition at line 1008 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().

◆ dig__check_dist()

int dig__check_dist ( struct Map_info ,
struct line_pnts ,
double  ,
double  ,
double *   
)

◆ dig__convert_buffer()

char* dig__convert_buffer ( int  )

◆ dig__double_convert()

double* dig__double_convert ( double *  ,
double *  ,
int  ,
struct dig_head  
)

◆ dig__falloc()

void* dig__falloc ( int  nelem,
int  elsize 
)

Definition at line 118 of file allocation.c.

References G_calloc.

Referenced by dig_falloc().

◆ dig__float_convert()

float* dig__float_convert ( float *  ,
float *  ,
int  ,
struct dig_head  
)

◆ dig__fread_port_C()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to gvfile structure
Returns
0 error
1 OK

Definition at line 511 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().

◆ dig__fread_port_D()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 79 of file portable.c.

References Cur_Head, Port_info::dbl_quick, dig_fread(), and PORT_DOUBLE.

Referenced by dig_Rd_P_node(), and dig_Rd_Plus_head().

◆ dig__fread_port_F()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 123 of file portable.c.

References Cur_Head, dig_fread(), Port_info::flt_quick, and PORT_FLOAT.

Referenced by dig_Rd_P_node().

◆ dig__fread_port_I()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 345 of file portable.c.

References Cur_Head, 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().

◆ dig__fread_port_L()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 262 of file portable.c.

References Cur_Head, 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().

◆ dig__fread_port_O()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
port_off_t_sizeoffset
Returns
0 error
1 OK

Definition at line 167 of file portable.c.

References Cur_Head, 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().

◆ dig__fread_port_P()

int dig__fread_port_P ( plus_t buf,
size_t  cnt,
struct gvfile fp 
)

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 537 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().

◆ dig__fread_port_S()

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.

Parameters
[out]bufdata buffer
cntnumber of members
fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 428 of file portable.c.

References Cur_Head, dig_fread(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.

◆ dig__frealloc()

void* dig__frealloc ( void *  oldptr,
int  nelem,
int  elsize,
int  oldnelem 
)

Definition at line 133 of file allocation.c.

References G_calloc.

Referenced by dig__alloc_space(), and dig_frealloc().

◆ dig__fwrite_port_C()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 886 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().

◆ dig__fwrite_port_D()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 559 of file portable.c.

References Cur_Head, Port_info::dbl_quick, dig_fwrite(), and PORT_DOUBLE.

Referenced by dig_Wr_P_node(), and dig_Wr_Plus_head().

◆ dig__fwrite_port_F()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 597 of file portable.c.

References Cur_Head, dig_fwrite(), Port_info::flt_quick, and PORT_FLOAT.

Referenced by dig_Wr_P_node().

◆ dig__fwrite_port_I()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 758 of file portable.c.

References Cur_Head, 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().

◆ dig__fwrite_port_L()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 703 of file portable.c.

References Cur_Head, 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().

◆ dig__fwrite_port_O()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
port_off_t_size
Returns
0 error
1 OK

Definition at line 636 of file portable.c.

References Cur_Head, 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().

◆ dig__fwrite_port_P()

int dig__fwrite_port_P ( const plus_t buf,
size_t  cnt,
struct gvfile fp 
)

Write plus_t to the Portable Vector Format.

These routines must handle any type size conversions between the portable format and the native machine.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 868 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().

◆ dig__fwrite_port_S()

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.

Parameters
bufdata buffer
cntnumber of members
[in,out]fppointer to struct gvfile
Returns
0 error
1 OK

Definition at line 813 of file portable.c.

References Cur_Head, dig_fwrite(), nat_shrt, PORT_SHORT, and Port_info::shrt_quick.

◆ dig__get_head()

struct dig_head* dig__get_head ( void  )

◆ dig__int_convert()

long* dig__int_convert ( int *  ,
long *  ,
int  ,
struct dig_head  
)

◆ dig__long_convert()

long* dig__long_convert ( long *  ,
long *  ,
int  ,
struct dig_head  
)

◆ dig__long_convert_to_int()

int* dig__long_convert_to_int ( long *  ,
int *  ,
int  ,
struct dig_head  
)

◆ dig__long_convert_to_plus_t()

plus_t* dig__long_convert_to_plus_t ( long *  ,
plus_t ,
int  ,
struct dig_head  
)

◆ dig__plus_t_convert()

long* dig__plus_t_convert ( plus_t ,
long *  ,
int  ,
struct dig_head  
)

◆ dig__read_head()

◆ dig__short_convert()

short* dig__short_convert ( short *  in,
short *  out,
int  ,
struct dig_head  
)

◆ dig__write_head()

◆ dig_add_area()

int dig_add_area ( struct Plus_head plus,
int  n_lines,
plus_t lines,
struct bound_box box 
)

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.

Parameters
[in]pluspointer to Plus_head structure
[in]n_linesnumber of lines
[in]linesarray of lines, negative for reverse direction
[in]boxbounding box
Returns
number of new area
-1 on error

Definition at line 187 of file plus_area.c.

Referenced by Vect_build_line_area().

◆ dig_add_isle()

int dig_add_isle ( struct Plus_head plus,
int  n_lines,
plus_t lines,
struct bound_box box 
)

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.

Parameters
[in]pluspointer to Plus_head structure
[in]n_linesnumber of lines
[in]linesarray of lines, negative for reverse direction
[in]boxbounding box
Returns
number of new isle
-1 on error

Definition at line 703 of file plus_area.c.

Referenced by Vect_build_line_area().

◆ dig_add_line()

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.

Parameters
[in,out]pluspointer to Plus_head structure
typefeature type
Pointsline geometry
boxbounding box
offsetline offset
Returns
-1 on error
line id

Definition at line 133 of file plus_line.c.

◆ dig_add_node()

int dig_add_node ( struct Plus_head plus,
double  x,
double  y,
double  z 
)

Add new node to plus structure.

Parameters
[in]pluspointer to Plus_head structure
[in]x,y,zcoordinates
Returns
-1 on error
number of node

Definition at line 101 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, P_node::x, x, P_node::y, and P_node::z.

◆ dig_alloc_area()

struct P_area* dig_alloc_area ( void  )

Allocate new area structure.

Returns
pointer to allocated P_area struct
NULL on error

Definition at line 266 of file struct_alloc.c.

References G_malloc, G_zero(), and NULL.

Referenced by dig_Rd_P_area().

◆ dig_alloc_areas()

int dig_alloc_areas ( struct Plus_head Plus,
int  add 
)

Reallocate array of pointers to areas.

Parameters
Pluspointer to Plus_head structure
addspace for 'add' number of areas is added
Returns
0 on success
-1 on error

Definition at line 218 of file struct_alloc.c.

Referenced by dig_load_plus().

◆ dig_alloc_cats()

int dig_alloc_cats ( struct line_cats cats,
int  num 
)

Allocate room for 'num' fields and category arrays in struct line_cats.

Parameters
catspointer to line_cats struct
numnumber of cats
Returns
0 on success
returns -1 on out of memory

Definition at line 380 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().

◆ dig_alloc_isle()

struct P_isle* dig_alloc_isle ( void  )

Allocate new isle structure.

Returns
pointer to allocated P_isle struct
NULL on error

Definition at line 301 of file struct_alloc.c.

References G_malloc, G_zero(), and NULL.

Referenced by dig_Rd_P_isle().

◆ dig_alloc_isles()

int dig_alloc_isles ( struct Plus_head Plus,
int  add 
)

Reallocate array of pointers to isles.

Parameters
Pluspointer to Plus_head structure
addspace for 'add' number of isles is added.
Returns
0 on success
-1 on error

Definition at line 243 of file struct_alloc.c.

Referenced by dig_load_plus().

◆ dig_alloc_line()

struct P_line* dig_alloc_line ( void  )

Allocate new line structure.

Returns
pointer to allocated P_node struct
NULL on error

Definition at line 127 of file struct_alloc.c.

References G_malloc, G_zero(), and NULL.

Referenced by dig_Rd_P_line().

◆ dig_alloc_lines()

int dig_alloc_lines ( struct Plus_head Plus,
int  add 
)

Reallocate array of pointers to lines.

Parameters
Pluspointer to Plus_head structure
addspace for 'add' number of lines is added.
Returns
0 on success
-1 on error

Definition at line 193 of file struct_alloc.c.

Referenced by dig_load_plus(), and Vect__load_map_lines_pg().

◆ dig_alloc_node()

struct P_node* dig_alloc_node ( void  )

Allocate new node structure.

Returns
pointer to allocated P_node struct
NULL on error

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().

◆ dig_alloc_nodes()

int dig_alloc_nodes ( struct Plus_head Plus,
int  add 
)

Reallocate array of pointers to nodes.

Parameters
Pluspointer to Plus_head structure
addnumber of nodes to be added
Returns
0 on success
-1 on error

Definition at line 105 of file struct_alloc.c.

Referenced by dig_add_node(), dig_load_plus(), and Vect__load_map_nodes_pg().

◆ dig_alloc_points()

int dig_alloc_points ( struct line_pnts points,
int  num 
)

allocate room for 'num' X and Y arrays in struct line_pnts

Parameters
pointspointer to line_pnts struct
numnumber of points
Returns
0 on success
returns -1 on out of memory

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.

◆ dig_alloc_space()

void* dig_alloc_space ( int  n_wanted,
int *  n_elements,
int  chunk_size,
void *  ptr,
int  element_size 
)

Definition at line 33 of file allocation.c.

References dig__alloc_space(), and NULL.

◆ dig_alloc_topo()

void* dig_alloc_topo ( char  type)

Allocate new topo struct.

Parameters
typeto of struct to allocate

Definition at line 145 of file struct_alloc.c.

Referenced by dig_Rd_P_line().

◆ dig_angle_next_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).

Parameters
[in]pluspointer to Plus_head structure
[in]current_linecurrent line id, negative if request for end node
[in]sideside GV_RIGHT or GV_LEFT
[in]typeline type (GV_LINE, GV_BOUNDARY or both)
[out]angle
Returns
line number of next angle to follow a line (negative if connected by end node) (number of current line may be returned if dangle - this is used in build)
0 on error or not found

Definition at line 474 of file plus_area.c.

◆ dig_area_add_isle()

int dig_area_add_isle ( struct Plus_head plus,
int  area,
int  isle 
)

Add isle to area if does not exist yet.

Parameters
[in]pluspointer to Plus_head structure
[in]areaarea id
[in]isleisle id
Returns
0

Definition at line 265 of file plus_area.c.

References G_debug().

Referenced by Vect_attach_isle().

◆ dig_area_alloc_isle()

int dig_area_alloc_isle ( struct P_area area,
int  add 
)

Allocate space in P_area for add new isles.

Parameters
areapointer to P_area struct
addnumber of isle to be added
Returns
0 on success
-1 on error

Definition at line 440 of file struct_alloc.c.

Referenced by dig_Rd_P_area().

◆ dig_area_alloc_line()

int dig_area_alloc_line ( struct P_area area,
int  add 
)

allocate space in P_area for add new lines

Parameters
areapointer to P_area struct
addnumber of lines to be added
Returns
0 on success
-1 on error

Definition at line 414 of file struct_alloc.c.

Referenced by dig_Rd_P_area().

◆ dig_area_del_isle()

int dig_area_del_isle ( struct Plus_head plus,
int  area,
int  isle 
)

Delete isle from area.

Parameters
[in]pluspointer to Plus_head structure
[in]areaarea id
[in]isleisle id
Returns
0

Definition at line 314 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().

◆ dig_area_get_box()

int dig_area_get_box ( struct Plus_head ,
plus_t  ,
struct bound_box  
)

◆ dig_box_copy()

int dig_box_copy ( struct bound_box A,
struct bound_box B 
)

Definition at line 64 of file vector/diglib/box.c.

◆ dig_box_extend()

int dig_box_extend ( struct bound_box A,
struct bound_box B 
)

Definition at line 81 of file vector/diglib/box.c.

◆ dig_boxlist_add()

int dig_boxlist_add ( struct boxlist list,
int  id,
const struct bound_box box 
)

Definition at line 34 of file vector/diglib/list.c.

References G_realloc, and NULL.

◆ dig_build_area_with_line()

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:

  • I. path runs into first line. : AREA!
  • II. path runs into a dead end (no other area lines at node) : no area
  • III. path runs into a previous line that is not 1st line or to 1st line but not to start node : no area

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 !!

Parameters
[in]pluspointer to Plus_head structure
[in]first_lineline id of first line
[in]sideside of line to build area on (GV_LEFT | GV_RIGHT)
[in]linespointer to array of lines
Returns
-1 on error
0 no area
number of lines

Definition at line 50 of file plus_area.c.

Referenced by Vect_build_line_area().

◆ dig_calc_begin_angle()

float dig_calc_begin_angle ( const struct line_pnts points,
double  thresh 
)

Definition at line 31 of file angle.c.

References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.

◆ dig_calc_end_angle()

float dig_calc_end_angle ( const struct line_pnts points,
double  thresh 
)

Definition at line 83 of file angle.c.

References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.

◆ dig_check_dist()

int dig_check_dist ( struct Map_info ,
int  ,
double  ,
double  ,
double *   
)

◆ dig_cidx_add_cat()

int dig_cidx_add_cat ( struct Plus_head Plus,
int  field,
int  cat,
int  line,
int  type 
)

Definition at line 72 of file diglib/cindex.c.

◆ dig_cidx_add_cat_sorted()

int dig_cidx_add_cat_sorted ( struct Plus_head Plus,
int  field,
int  cat,
int  line,
int  type 
)

Definition at line 177 of file diglib/cindex.c.

◆ dig_cidx_del_cat()

int dig_cidx_del_cat ( struct Plus_head Plus,
int  field,
int  cat,
int  line,
int  type 
)

Definition at line 267 of file diglib/cindex.c.

◆ dig_cidx_free()

◆ dig_cidx_init()

int dig_cidx_init ( struct Plus_head Plus)

Initialize Plus_head structure (cidx)

Parameters
Pluspointer to Plus_head structure
Returns
1 OK
0 on error

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().

◆ dig_cidx_sort()

void dig_cidx_sort ( struct Plus_head Plus)

Definition at line 328 of file diglib/cindex.c.

References G_debug(), and Plus_head::n_cidx.

◆ dig_del_area()

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)

Parameters
[in]pluspointer to Plus_head structure
[in]areaarea id
Returns
0 on error
1 on success

Definition at line 365 of file plus_area.c.

◆ dig_del_isle()

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.

Parameters
[in]pluspointer to Plus_head structure
[in]isleisle id
Returns
1

Definition at line 781 of file plus_area.c.

◆ dig_del_line()

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.

Parameters
[in,out]pluspointer to Plus_head structure
[in]lineline id
[in]x,y,zcoordinates
Returns
-1 on error
0 OK

Definition at line 216 of file plus_line.c.

◆ dig_distance2_point_to_line()

double dig_distance2_point_to_line ( double  x,
double  y,
double  z,
double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2,
int  with_z,
double *  px,
double *  py,
double *  pz,
double *  pdist,
int *  status 
)

Definition at line 47 of file vector/diglib/line_dist.c.

Referenced by Vect_line_distance(), and Vect_line_geodesic_distance().

◆ dig_do_file_checks()

int dig_do_file_checks ( struct Map_info ,
char *  ,
char *   
)

◆ dig_dump_spidx()

int dig_dump_spidx ( FILE *  fp,
const struct Plus_head Plus 
)

Dump spatial index.

Parameters
[out]fppointer to FILE
Pluspointer to Plus_head structure
Returns
0

Definition at line 1267 of file spindex_rw.c.

References RTree::fd, and Plus_head::Node_spidx.

Referenced by Vect_sidx_dump().

◆ dig_falloc()

void* dig_falloc ( int  nelem,
int  elsize 
)

Definition at line 91 of file allocation.c.

References dig__falloc(), G_sleep(), and NULL.

◆ dig_fflush()

int dig_fflush ( struct gvfile file)

Flush struct gvfile.

Parameters
filepointer to struct gvfile structure
Returns
0

Definition at line 104 of file file.c.

References file.

Referenced by dig_write_plus_file(), and V1_delete_line_nat().

◆ dig_file_free()

void dig_file_free ( struct gvfile file)

Free struct gvfile.

Parameters
filepointer to struct gvfile structure

Definition at line 268 of file file.c.

References file, and G_free().

Referenced by V1_close_nat().

◆ dig_file_init()

void dig_file_init ( struct gvfile file)

Initialize gvfile structure.

Parameters
[in,out]filepointer to gvfile structure

Definition at line 171 of file file.c.

References file, and 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().

◆ dig_file_load()

int dig_file_load ( struct gvfile file)

Load opened struct gvfile to memory.

Warning: position in file is set to the beginning.

Parameters
filepointer to struct gvfile structure
Returns
1 loaded
0 not loaded
-1 error

Definition at line 188 of file file.c.

◆ dig_find_area_box()

int dig_find_area_box ( struct Plus_head Plus,
int  area,
struct bound_box box 
)

Find bounding box for given area.

Parameters
Pluspointer to Plus_head structure
areaarea id
[out]boxbounding box
Returns
> 0 bounding box for area found
0 not found

Definition at line 919 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().

◆ dig_find_area_poly()

int dig_find_area_poly ( struct line_pnts Points,
double *  totalarea 
)

Definition at line 98 of file diglib/poly.c.

Referenced by Vect_build_line_area().

◆ dig_find_intersection()

int dig_find_intersection ( double  ax1,
double  ay1,
double  ax2,
double  ay2,
double  bx1,
double  by1,
double  bx2,
double  by2,
double *  x,
double *  y 
)

Definition at line 181 of file linecros.c.

◆ dig_find_isle_box()

int dig_find_isle_box ( struct Plus_head Plus,
int  isle,
struct bound_box box 
)

Find box for isle.

Parameters
Pluspointer to Plus_head structure
isleisle id
[out]boxbounding box
Returns
> 0 bounding box for isle found
0 not found

Definition at line 1015 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().

◆ dig_find_line_box()

int dig_find_line_box ( struct Plus_head Plus,
int  line,
struct bound_box box 
)

Find box for line.

Parameters
Pluspointer to Plus_head structure
lineline id
[out]boxbounding box
Returns
> 0 bounding box for line found
0 not found

Definition at line 803 of file spindex.c.

◆ dig_find_node()

int dig_find_node ( struct Plus_head Plus,
double  x,
double  y,
double  z 
)

Find one node by coordinates.

Parameters
Pluspointer to Plus_head structure
x,y,zcoordinates
Returns
number of node
0 not found

Definition at line 718 of file spindex.c.

References RTree_Rect::boundary, G_debug(), G_malloc, Plus_head::Node_spidx, RTreeSearch(), Plus_head::Spidx_new, and x.

◆ dig_find_poly_orientation()

double dig_find_poly_orientation ( struct line_pnts Points)

Definition at line 137 of file diglib/poly.c.

◆ dig_float_point()

char* dig_float_point ( char *  ,
int  ,
double   
)

◆ dig_fread()

size_t dig_fread ( void *  ptr,
size_t  size,
size_t  nmemb,
struct gvfile file 
)

Read struct gvfile.

Parameters
[out]ptrdata buffer
sizebuffer size
nmembnumber of members
filepointer to struct gvfile structure
Returns
number of read members

Definition at line 124 of file file.c.

References file.

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().

◆ dig_frealloc()

void* dig_frealloc ( void *  oldptr,
int  nelem,
int  elsize,
int  oldnelem 
)

Definition at line 103 of file allocation.c.

References dig__frealloc(), G_sleep(), and NULL.

◆ dig_free_area()

void dig_free_area ( struct P_area Area)

Free area structure.

Parameters
Areapointer 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(), and dig_Rd_P_area().

◆ dig_free_isle()

void dig_free_isle ( struct P_isle Isle)

Free isle structure.

Parameters
Islepointer 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(), and dig_Rd_P_isle().

◆ dig_free_line()

void dig_free_line ( struct P_line Line)

Free line structure.

Parameters
pointerto 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(), and dig_Rd_P_line().

◆ dig_free_node()

void dig_free_node ( struct P_node Node)

Free node structure.

Parameters
Nodepointer 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(), and dig_Rd_P_node().

◆ dig_free_plus()

void dig_free_plus ( struct Plus_head Plus)

Free Plus structure.

Structure is not inited and dig_init_plus() should follow.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 173 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().

◆ dig_free_plus_areas()

void dig_free_plus_areas ( struct Plus_head Plus)

Free Plus->Area structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 114 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().

◆ dig_free_plus_isles()

void dig_free_plus_isles ( struct Plus_head Plus)

Free Plus->Isle structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 142 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().

◆ dig_free_plus_lines()

void dig_free_plus_lines ( struct Plus_head Plus)

◆ dig_free_plus_nodes()

void dig_free_plus_nodes ( struct Plus_head Plus)

Free Plus->Node structure.

Parameters
[in]Pluspointer to Plus_head structure

Definition at line 50 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().

◆ dig_fseek()

int dig_fseek ( struct gvfile file,
off_t  offset,
int  whence 
)

Set struct gvfile position.

Start positions:

  • SEEK_SET (start)
  • SEEK_CUR (current position)
  • SEEK_END (end)
Parameters
filepointer to struct gvfile structure
offsetoffset position
whencestart position
Returns
0 OK
-1 error

Definition at line 60 of file file.c.

References file, and G_fseek().

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().

◆ dig_ftell()

off_t dig_ftell ( struct gvfile file)

Get struct gvfile position.

Parameters
filepointer to struct gvfile structure
Returns
current file position

Definition at line 36 of file file.c.

References file, and G_ftell().

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().

◆ dig_fwrite()

size_t dig_fwrite ( const void *  ptr,
size_t  size,
size_t  nmemb,
struct gvfile file 
)

Write struct gvfile.

Parameters
ptrdata buffer
sizebuffer size
nmembnumber of members
[out]filepointer to struct gvfile structure
Returns
number of items written

Definition at line 156 of file file.c.

References _, file, and G_fatal_error().

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().

◆ dig_get_cont_lines()

plus_t** dig_get_cont_lines ( struct Map_info ,
plus_t  ,
double  ,
int   
)

◆ dig_get_head()

struct dig_head* dig_get_head ( void  )

◆ dig_get_next_cont_line()

plus_t dig_get_next_cont_line ( struct Map_info ,
plus_t  ,
double  ,
int   
)

◆ dig_get_poly_points()

int dig_get_poly_points ( int  n_lines,
struct line_pnts **  LPoints,
int *  direction,
struct line_pnts BPoints 
)

Definition at line 35 of file diglib/poly.c.

◆ dig_head_to_map()

int dig_head_to_map ( struct Plus_head ,
struct Map_info  
)

◆ dig_init_boxlist()

int dig_init_boxlist ( struct boxlist list,
int  have_boxes 
)

Definition at line 22 of file vector/diglib/list.c.

References NULL.

◆ dig_init_plus()

int dig_init_plus ( struct Plus_head Plus)

Initialize Plus_head structure.

Parameters
[in,out]Pluspointer to Plus_head structure
Returns
1

Definition at line 30 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().

◆ dig_init_portable()

◆ dig_is_line_degenerate()

int dig_is_line_degenerate ( const struct line_pnts points,
double  thresh 
)

Definition at line 135 of file angle.c.

References line_pnts::n_points, line_pnts::x, and line_pnts::y.

◆ dig_isle_alloc_line()

int dig_isle_alloc_line ( struct P_isle isle,
int  add 
)

Allocate space in P_isle for add new lines.

Parameters
islepointer to P_area struct
addnumber of isle to be added
Returns
0 on success
-1 on error

Definition at line 466 of file struct_alloc.c.

Referenced by dig_Rd_P_isle().

◆ dig_isle_get_box()

int dig_isle_get_box ( struct Plus_head ,
plus_t  ,
struct bound_box  
)

◆ dig_line_add_updated()

void dig_line_add_updated ( struct Plus_head Plus,
int  line,
off_t  offset 
)

Add new line to updated.

Parameters
Pluspointer to Plus_head structure
lineline id
offsetline offset (negative offset is ignored)

Definition at line 36 of file vector/diglib/update.c.

◆ dig_line_box()

int dig_line_box ( const struct line_pnts Points,
struct bound_box Box 
)

Definition at line 24 of file vector/diglib/box.c.

Referenced by Vect_build_line_area().

◆ dig_line_degenerate()

int dig_line_degenerate ( const struct line_pnts points)

Definition at line 179 of file angle.c.

Referenced by dig_calc_begin_angle(), and dig_calc_end_angle().

◆ dig_line_get_area()

plus_t dig_line_get_area ( struct Plus_head plus,
plus_t  line,
int  side 
)

Get area number on line side.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in]sideside id (GV_LEFT || GV_RIGHT)
Returns
area number
0 no area
-1 on error

Definition at line 342 of file plus_line.c.

Referenced by Vect_build_line_area().

◆ dig_line_reset_updated()

void dig_line_reset_updated ( struct Plus_head Plus)

Reset number of updated lines.

Parameters
Pluspointer to Plus_head structure

Definition at line 24 of file vector/diglib/update.c.

References Plus_head::n_uplines, and Plus_head::uplist.

◆ dig_line_set_area()

int dig_line_set_area ( struct Plus_head plus,
plus_t  line,
int  side,
plus_t  area 
)

Set area number on line side.

Parameters
[in]pluspointer Plus_head structure
[in]lineline id
[in]sideside id (GV_LEFT || GV_RIGHT)
[in]areaarea id
Returns
1

Definition at line 382 of file plus_line.c.

◆ dig_load_plus()

int dig_load_plus ( struct Plus_head Plus,
struct gvfile plus,
int  head_only 
)

◆ dig_map_to_head()

int dig_map_to_head ( struct Map_info ,
struct Plus_head  
)

◆ dig_node_add_line()

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 allocated to add 'line' to array

Lines are sorted in increasing angle order and degenerated lines are set to -9 (ignored).

Parameters
[in]pluspointer to Plus_head structure
[in]nodeidnode id
[in]lineidline id
[in]pointsline geometry
[in]typeline type
Returns
-1 on error
0 line not added (degenerate)
new number of lines in node

Definition at line 44 of file plus_node.c.

◆ dig_node_add_updated()

void dig_node_add_updated ( struct Plus_head Plus,
int  node 
)

Add node to updated.

Parameters
Pluspointer to Plus_head structure
nodenode id

Definition at line 85 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.

◆ dig_node_alloc_line()

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

Parameters
nodepointer to P_node struct
addnumber lines to be added
Returns
0 on success
-1 on error

Definition at line 69 of file struct_alloc.c.

Referenced by dig_Rd_P_node().

◆ dig_node_angle_check()

int dig_node_angle_check ( struct Plus_head plus,
plus_t  line,
int  type 
)

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).

Parameters
[in]pluspointer to Plus_head structure
[in]linecurrent line id, negative if request for node 2
[in]typeline type (GV_LINE, GV_BOUNDARY or both)
Returns
1 angles differ
0 angle of a line up or down is identical

Definition at line 622 of file plus_area.c.

◆ dig_node_line_angle()

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.

Parameters
[in]pluspointer to Plus_head structure
[in]nodeidnode id
[in]lineidline id
Returns
line angle <-PI,PI>
0 not reached

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.

◆ dig_node_reset_updated()

void dig_node_reset_updated ( struct Plus_head Plus)

Reset number of updated nodes.

Parameters
Pluspointer to Plus_head structure

Definition at line 74 of file vector/diglib/update.c.

References Plus_head::n_upnodes, and Plus_head::uplist.

◆ dig_out_of_memory()

int dig_out_of_memory ( void  )

For now just print message and return error code.

Definition at line 487 of file struct_alloc.c.

References _, and G_warning().

Referenced by dig_alloc_cats(), and dig_alloc_points().

◆ dig_point_by_line()

int dig_point_by_line ( struct Map_info ,
double  ,
double  ,
double  ,
double  ,
char   
)

◆ dig_point_to_area()

int dig_point_to_area ( struct Map_info ,
double  ,
double   
)

◆ dig_point_to_line()

int dig_point_to_line ( struct Map_info ,
double  ,
double  ,
char   
)

◆ dig_point_to_next_area()

int dig_point_to_next_area ( struct Map_info ,
double  ,
double  ,
double *   
)

◆ dig_prune()

int dig_prune ( struct line_pnts points,
double  thresh 
)

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.

◆ dig_Rd_P_area()

◆ dig_Rd_P_isle()

int dig_Rd_P_isle ( struct Plus_head Plus,
int  i,
struct gvfile fp 
)

◆ dig_Rd_P_line()

◆ dig_Rd_P_node()

◆ dig_Rd_Plus_head()

◆ dig_Rd_spidx()

int dig_Rd_spidx ( struct gvfile fp,
struct Plus_head Plus 
)

Read spatial index from sidx file Only needed when old vector is opened in update mode.

Parameters
fppointer to struct gvfile
[in,out]Pluspointer to Plus_head structure
Returns
0

Definition at line 1223 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.

◆ dig_Rd_spidx_head()

◆ dig_read_cidx()

int dig_read_cidx ( struct gvfile fp,
struct Plus_head plus,
int  head_only 
)

Read spatial index file.

Parameters
fppointer to gvfile structure
[in,out]pluspointer to Plus_head structure
head_onlynon-zero to read only head
Returns
0 OK
1 error

Definition at line 296 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().

◆ dig_read_cidx_head()

◆ dig_read_frmt_ascii()

int dig_read_frmt_ascii ( FILE *  dascii,
struct Format_info finfo 
)

◆ dig_read_head_ascii()

int dig_read_head_ascii ( FILE *  ,
struct dig_head  
)

◆ dig_restore_line()

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.

Parameters
[in,out]pluspointer to Plus_head structure
typefeature type
Pointsline geometry
boxbounding box
offsetline offset
Returns
-1 on error
line id

Definition at line 189 of file plus_line.c.

◆ dig_rewind()

void dig_rewind ( struct gvfile file)

Rewind file position.

Parameters
filepointer to gvfile structure

Definition at line 87 of file file.c.

References file.

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().

◆ dig_rmcr()

int dig_rmcr ( char *  )

◆ dig_select_areas()

int dig_select_areas ( struct Plus_head Plus,
const struct bound_box box,
struct boxlist list 
)

Select areas with boxes by box.

Parameters
Pluspointer to Plus_head structure
boxbounding box
listboxlist of selected areas
Returns
number of selected areas

Definition at line 876 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, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.

◆ dig_select_isles()

int dig_select_isles ( struct Plus_head Plus,
const struct bound_box box,
struct boxlist list 
)

Select isles with boxes by box.

Parameters
Pluspointer to Plus_head structure
boxbounding box
listboxlist of selected isles
Returns
number of selected isles

Definition at line 972 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, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.

Referenced by Vect_select_isles_by_box().

◆ dig_select_lines()

int dig_select_lines ( struct Plus_head Plus,
const struct bound_box box,
struct boxlist list 
)

Select lines with boxes by box.

Parameters
Pluspointer to Plus_head structure
boxbounding box
listboxlist of selected lines
Returns
number of selected lines
0 not found

Definition at line 760 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, RTreeSearch(), bound_box::S, Plus_head::Spidx_new, bound_box::T, and bound_box::W.

◆ dig_select_nodes()

int dig_select_nodes ( struct Plus_head Plus,
const struct bound_box box,
struct ilist list 
)

Select nodes by bbox.

Parameters
Pluspointer to Plus_head structure
boxbounding box
listlist of selected lines
Returns
number of selected nodes
-1 on error

Definition at line 669 of file spindex.c.

References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, 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().

◆ dig_set_cur_port()

◆ dig_set_distance_to_line_tolerance()

int dig_set_distance_to_line_tolerance ( double  t)

Definition at line 24 of file vector/diglib/line_dist.c.

References t, and TOLERANCE.

◆ dig_spidx_add_area()

int dig_spidx_add_area ( struct Plus_head Plus,
int  area,
const struct bound_box box 
)

Add new area to spatial index.

Parameters
Pluspointer to Plus_head structure
areaarea id
boxbounding box
Returns
0

Definition at line 360 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.

◆ dig_spidx_add_isle()

int dig_spidx_add_isle ( struct Plus_head Plus,
int  isle,
const struct bound_box box 
)

Add new island to spatial index.

Parameters
Pluspointer to Plus_head structure
isleisle id
boxbounding box
Returns
0

Definition at line 395 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.

◆ dig_spidx_add_line()

int dig_spidx_add_line ( struct Plus_head Plus,
int  line,
const struct bound_box box 
)

Add new line to spatial index.

Parameters
Pluspointer to Plus_head structure
lineline id
boxbounding box
Returns
0

Definition at line 326 of file spindex.c.

◆ dig_spidx_add_node()

int dig_spidx_add_node ( struct Plus_head Plus,
int  node,
double  x,
double  y,
double  z 
)

Add new node to spatial index.

Parameters
Pluspointer to Plus_head structure
nodenode id
x,y,znode coordinates
Returns
1 OK
0 on error

Definition at line 291 of file spindex.c.

References RTree_Rect::boundary, G_debug(), G_malloc, Plus_head::Node_spidx, RTreeInsertRect(), and x.

Referenced by dig_add_node().

◆ dig_spidx_del_area()

int dig_spidx_del_area ( struct Plus_head Plus,
int  area 
)

Delete area from spatial index.

G_fatal_error() called on error.

Parameters
Pluspointer to Plus_head structure
areaarea id
Returns
0

Definition at line 515 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.

◆ dig_spidx_del_isle()

int dig_spidx_del_isle ( struct Plus_head Plus,
int  isle 
)

Delete isle from spatial index.

G_fatal_error() called on error.

Parameters
Pluspointer to Plus_head structure
isleisle id
Returns
0

Definition at line 568 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.

◆ dig_spidx_del_line()

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.

Parameters
Pluspointer to Plus_head structure
lineline id
x,y,zcoordinates
Returns
0

Definition at line 473 of file spindex.c.

◆ dig_spidx_del_node()

int dig_spidx_del_node ( struct Plus_head Plus,
int  node 
)

Delete node from spatial index.

G_fatal_error() called on error.

Parameters
Pluspointer to Plus_head structure
nodenode id
Returns
0

Definition at line 430 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.

◆ dig_spidx_free()

void dig_spidx_free ( struct Plus_head Plus)

Free spatial index (nodes, lines, areas, isles)

Parameters
Pluspointer to Plus_head structure

Definition at line 243 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().

◆ dig_spidx_free_areas()

void dig_spidx_free_areas ( struct Plus_head Plus)

Reset spatial index for areas.

Parameters
Pluspointer to Plus_head structure

Definition at line 177 of file spindex.c.

References Plus_head::Area_spidx, RTree::fd, and Plus_head::with_z.

◆ dig_spidx_free_isles()

void dig_spidx_free_isles ( struct Plus_head Plus)

Reset spatial index for isles.

Parameters
Pluspointer to Plus_head structure

Definition at line 210 of file spindex.c.

References RTree::fd, Plus_head::Isle_spidx, and Plus_head::with_z.

◆ dig_spidx_free_lines()

void dig_spidx_free_lines ( struct Plus_head Plus)

Free spatial index for lines.

Parameters
Pluspointer to Plus_head structure

Definition at line 144 of file spindex.c.

References RTree::fd, Plus_head::Line_spidx, and Plus_head::with_z.

◆ dig_spidx_free_nodes()

void dig_spidx_free_nodes ( struct Plus_head Plus)

Free spatial index for nodes.

Parameters
Pluspointer to Plus_head structure

Definition at line 111 of file spindex.c.

References RTree::fd, Plus_head::Node_spidx, and Plus_head::with_z.

◆ dig_spidx_init()

int dig_spidx_init ( struct Plus_head Plus)

Initit spatial index (nodes, lines, areas, isles)

Parameters
Pluspointer to Plus_head structure
Returns
1 OK
0 on error

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().

◆ dig_spindex_init()

int dig_spindex_init ( struct Plus_head )

◆ dig_start_clock()

int dig_start_clock ( long *  )

◆ dig_stop_clock()

int dig_stop_clock ( long *  )

◆ dig_stop_clock_str()

char* dig_stop_clock_str ( long *  )

◆ dig_struct_copy()

int dig_struct_copy ( void *  ,
void *  ,
int   
)

◆ dig_test_for_intersection()

int dig_test_for_intersection ( double  ax1,
double  ay1,
double  ax2,
double  ay2,
double  bx1,
double  by1,
double  bx2,
double  by2 
)

Definition at line 57 of file linecros.c.

◆ dig_type_from_store()

int dig_type_from_store ( int  stype)

◆ dig_type_to_store()

int dig_type_to_store ( int  type)

Convert type to store type.

Parameters
typefeature type
Returns
store type

Definition at line 25 of file vector/diglib/type.c.

Referenced by dig_Wr_P_line(), dig_write_cidx(), and dig_write_cidx_head().

◆ dig_unit_conversion()

double dig_unit_conversion ( void  )

◆ dig_which_node()

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.

Parameters
[in]pluspointer to Plus_head structure
[in]x,ycoordinates
[in]threshthreshold value
Returns
node index
-1 if no node found

Definition at line 146 of file plus_node.c.

References Plus_head::n_nodes, Plus_head::Node, NULL, P_node::x, x, and P_node::y.

◆ dig_Wr_P_area()

int dig_Wr_P_area ( struct Plus_head Plus,
int  i,
struct gvfile fp 
)

◆ dig_Wr_P_isle()

int dig_Wr_P_isle ( struct Plus_head Plus,
int  i,
struct gvfile fp 
)

◆ dig_Wr_P_line()

◆ dig_Wr_P_node()

int dig_Wr_P_node ( struct Plus_head Plus,
int  i,
struct gvfile fp 
)

◆ dig_Wr_Plus_head()

int dig_Wr_Plus_head ( struct gvfile fp,
struct Plus_head ptr 
)

Write Plus_head to file.

ptr->off_t_size is used for both coor and topo files, but their sizes (ptr->coor_size for coor and no variable for topo) can be different. If either file is greater than PORT_LONG_MAX, ptr->off_t_size must be 8. This function determines this value of ptr->off_t_size and writes it to the file.

Parameters
fppointer to gvfile structure
[in,out]ptrpointer to Plus_head structure
Returns
-1 error
0 OK

Definition at line 711 of file plus_struct.c.

References Plus_head::Area, 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_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_TOPO_EARLIEST_MAJOR, GV_TOPO_EARLIEST_MINOR, GV_TOPO_VER_MAJOR, GV_TOPO_VER_MINOR, Plus_head::Hole_offset, Plus_head::Isle, Plus_head::Isle_offset, Plus_head::Line, 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, P_area::n_isles, Plus_head::n_klines, Plus_head::n_lines, P_node::n_lines, P_area::n_lines, P_isle::n_lines, Plus_head::n_llines, Plus_head::n_nodes, Plus_head::n_plines, Plus_head::n_volumes, Plus_head::Node, Plus_head::Node_offset, NULL, Plus_head::off_t_size, Plus_head::port, PORT_LONG_MAX, bound_box::S, bound_box::T, P_line::type, Plus_head::Volume_offset, bound_box::W, and Plus_head::with_z.

Referenced by dig_write_plus_file().

◆ dig_Wr_spidx()

int dig_Wr_spidx ( struct gvfile fp,
struct Plus_head Plus 
)

Write spatial index to file.

Parameters
[out]fppointer to struct gvfile
Pluspointer to Plus_head structure
Returns
0

Definition at line 1177 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().

◆ dig_Wr_spidx_head()

◆ dig_write_areas()

int dig_write_areas ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (areas) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 368 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().

◆ dig_write_cidx()

◆ dig_write_cidx_head()

◆ dig_write_file_checks()

int dig_write_file_checks ( struct gvfile ,
struct Plus_head  
)

◆ dig_write_frmt_ascii()

int dig_write_frmt_ascii ( FILE *  ,
struct Format_info ,
int   
)

◆ dig_write_head_ascii()

int dig_write_head_ascii ( FILE *  ,
struct dig_head  
)

◆ dig_write_isles()

int dig_write_isles ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (isles) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 392 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().

◆ dig_write_lines()

int dig_write_lines ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (lines) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 344 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().

◆ dig_write_nodes()

int dig_write_nodes ( struct gvfile plus,
struct Plus_head Plus 
)

Writes topo structure (nodes) to topo file.

Parameters
[in,out]plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 321 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().

◆ dig_write_plus_file()

int dig_write_plus_file ( struct gvfile fp_plus,
struct Plus_head Plus 
)

Writes topo structure to topo file.

Parameters
[in,out]fp_plustopo file
[in]Pluspointer to Plus_head structure
Returns
0 on success
-1 on error

Definition at line 271 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().

◆ dig_x_intersect()

double dig_x_intersect ( double  beg_x,
double  end_x,
double  beg_y,
double  end_y,
double  Y 
)

Definition at line 20 of file inside.c.

References b, and Y.

◆ rtree_search()

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.

Parameters
tpointer to RTree
rsearch rectangle
shcbuser-provided callback
cbargargument for shcb
Pluspointer to Plus_head structure
Returns
number of qualifying rectangles

Definition at line 1387 of file spindex_rw.c.