|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-5f4f7ad06c
|
Function prototypes for diglib (part of vector library) More...
#include <grass/gis.h>

Go to the source code of this file.
Function prototypes for diglib (part of vector library)
Definition in file dig_externs.h.
| char * color_name | ( | int | ) |
| void * dig__alloc_space | ( | int | n_wanted, |
| int * | n_elements, | ||
| int | chunk_size, | ||
| void * | ptr, | ||
| int | element_size | ||
| ) |
Definition at line 48 of file allocation.c.
References dig__frealloc(), and G_calloc.
Referenced by dig_alloc_cats(), dig_alloc_points(), and dig_alloc_space().
Get byte order.
Definition at line 1008 of file portable.c.
References dbl_order, ENDIAN_BIG, and ENDIAN_LITTLE.
Referenced by V1_open_new_nat(), Vect_cidx_save(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
Definition at line 117 of file allocation.c.
References G_calloc.
Referenced by dig_build_area_with_line(), and dig_falloc().
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 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(), V1_restore_line_nat(), and Vect_open_fidx().
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 Cur_Head, dig_fread(), and PORT_DOUBLE.
Referenced by dig_Rd_P_node(), dig_Rd_Plus_head(), and rtree_search().
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 Cur_Head, dig_fread(), and PORT_FLOAT.
Referenced by dig_Rd_P_node().
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 345 of file portable.c.
References Cur_Head, dig_fread(), ENDIAN_LITTLE, int_order, 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(), rtree_search(), and Vect_open_fidx().
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 262 of file portable.c.
References Cur_Head, dig_fread(), ENDIAN_LITTLE, lng_order, 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().
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 _, Cur_Head, dig_fread(), ENDIAN_LITTLE, G_fatal_error(), nat_off_t, and off_t_order.
Referenced by dig__read_head(), dig_Rd_P_line(), dig_Rd_Plus_head(), dig_Rd_spidx_head(), dig_read_cidx_head(), and rtree_search().
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 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().
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 428 of file portable.c.
References Cur_Head, dig_fread(), ENDIAN_LITTLE, nat_shrt, PORT_SHORT, and shrt_order.
Definition at line 132 of file allocation.c.
References b, G_calloc, and G_free().
Referenced by dig__alloc_space(), dig_build_area_with_line(), and dig_frealloc().
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 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(), V1_restore_line_nat(), and Vect_save_fidx().
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 559 of file portable.c.
References Cur_Head, dig_fwrite(), and PORT_DOUBLE.
Referenced by dig_Wr_P_node(), and dig_Wr_Plus_head().
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 597 of file portable.c.
References Cur_Head, dig_fwrite(), and PORT_FLOAT.
Referenced by dig_Wr_P_node().
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 Cur_Head, dig_fwrite(), ENDIAN_LITTLE, int_order, 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().
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 703 of file portable.c.
References Cur_Head, dig_fwrite(), ENDIAN_LITTLE, lng_order, 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 _, Cur_Head, dig_fwrite(), ENDIAN_LITTLE, G_fatal_error(), nat_off_t, and off_t_order.
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 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().
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 813 of file portable.c.
References Cur_Head, dig_fwrite(), ENDIAN_LITTLE, nat_shrt, PORT_SHORT, and shrt_order.
Definition at line 87 of file head.c.
References dig__fread_port_C(), dig__fread_port_L(), dig__fread_port_O(), 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, AMI_STREAM< T >::name(), and PORT_LONG_MAX.
Referenced by V1_open_old_nat().
Definition at line 23 of file head.c.
References dig__fwrite_port_C(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig_fseek(), dig_ftell(), dig_set_cur_port(), G_debug(), GV_COOR_HEAD_SIZE, and PORT_LONG_MAX.
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 187 of file plus_area.c.
References _, Plus_head::alloc_areas, Plus_head::Area, P_area::centroid, dig_alloc_area(), dig_alloc_areas(), dig_area_alloc_line(), dig_free_area(), dig_spidx_add_area(), G_debug(), G_warning(), P_topo_b::left, Plus_head::Line, P_area::lines, Plus_head::n_areas, P_area::n_lines, NULL, P_topo_b::right, and P_line::topo.
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 703 of file plus_area.c.
References _, Plus_head::alloc_isles, P_isle::area, dig_alloc_isle(), dig_alloc_isles(), dig_free_isle(), dig_isle_alloc_line(), dig_spidx_add_isle(), G_debug(), G_warning(), Plus_head::Isle, P_topo_b::left, Plus_head::Line, P_isle::lines, Plus_head::n_isles, P_isle::n_lines, NULL, P_topo_b::right, and P_line::topo.
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 133 of file plus_line.c.
References Plus_head::alloc_lines, dig_alloc_lines(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, Plus_head::n_blines, Plus_head::n_clines, Plus_head::n_flines, Plus_head::n_klines, Plus_head::n_lines, Plus_head::n_llines, and Plus_head::n_plines.
Referenced by V2__add_line_to_topo_nat(), V2_write_line_sfa(), and Vect_build_nat().
Add new node to plus structure.
| [in] | plus | pointer to Plus_head structure |
| [in] | x,y,z | coordinates |
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, P_node::y, and P_node::z.
Allocate new area structure.
Definition at line 266 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_add_area(), and dig_Rd_P_area().
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.
References G_realloc, and NULL.
Referenced by dig_add_area(), dig_load_plus(), and Vect__load_plus_pg().
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 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().
Allocate new isle structure.
Definition at line 301 of file struct_alloc.c.
References G_malloc, G_zero(), and NULL.
Referenced by dig_add_isle(), and dig_Rd_P_isle().
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.
References G_debug(), G_realloc, and NULL.
Referenced by dig_add_isle(), dig_load_plus(), and Vect__load_plus_pg().
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().
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.
References G_realloc, and NULL.
Referenced by dig_add_line(), dig_load_plus(), and Vect__load_map_lines_pg().
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().
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.
References G_realloc, and NULL.
Referenced by dig_add_node(), dig_load_plus(), and Vect__load_map_nodes_pg().
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.
Referenced by dig_get_poly_points(), Vect_append_point(), Vect_append_points(), Vect_copy_xyz_to_pnts(), and Vect_line_insert_point().
| void * dig_alloc_space | ( | int | n_wanted, |
| int * | n_elements, | ||
| int | chunk_size, | ||
| void * | ptr, | ||
| int | element_size | ||
| ) |
Definition at line 32 of file allocation.c.
References dig__alloc_space(), and NULL.
Allocate new topo struct.
| type | to of struct to allocate |
Definition at line 145 of file struct_alloc.c.
References G_malloc, GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, NULL, and P_line::type.
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) |
| [out] | angle |
Definition at line 474 of file plus_area.c.
References P_node::angles, G_debug(), G_fatal_error(), G_getenv_nofatal(), GV_BOUNDARY, GV_LINE, GV_LINES, GV_RIGHT, Plus_head::Line, P_node::lines, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, P_node::n_lines, Plus_head::Node, NULL, P_line::topo, and P_line::type.
Referenced by dig_build_area_with_line(), dig_node_angle_check(), V2__add_line_to_topo_nat(), and V2__delete_line_from_topo_nat().
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 265 of file plus_area.c.
References _, P_area::alloc_isles, Plus_head::Area, dig_area_alloc_isle(), G_debug(), G_fatal_error(), G_getenv_nofatal(), G_warning(), P_area::isles, P_area::n_isles, and NULL.
Referenced by Vect_attach_isle(), and Vect_remove_small_areas_nat().
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 440 of file struct_alloc.c.
References P_isle::area, G_debug(), G_realloc, and NULL.
Referenced by dig_area_add_isle(), and dig_Rd_P_area().
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 414 of file struct_alloc.c.
References P_isle::area, G_realloc, and NULL.
Referenced by dig_add_area(), and dig_Rd_P_area().
Delete isle from area.
| [in] | plus | pointer to Plus_head structure |
| [in] | area | area id |
| [in] | isle | isle id |
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 dig_del_isle(), and Vect_attach_isles().
Definition at line 64 of file vector/diglib/box.c.
References bound_box::B, bound_box::E, bound_box::N, bound_box::S, bound_box::T, and bound_box::W.
Definition at line 81 of file vector/diglib/box.c.
References bound_box::B, bound_box::E, bound_box::N, bound_box::S, bound_box::T, and bound_box::W.
Definition at line 34 of file vector/diglib/list.c.
References G_realloc, and NULL.
Referenced by Vect_select_lines_by_box().
| 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 50 of file plus_area.c.
References dig__falloc(), dig__frealloc(), dig_angle_next_line(), dig_node_angle_check(), dig_node_line_angle(), dig_out_of_memory(), G_debug(), G_getenv_nofatal(), GV_BOUNDARY, GV_LEFT, GV_RIGHT, Plus_head::Line, P_topo_b::N1, NULL, P_line::topo, and P_line::type.
Referenced by Vect_build_line_area().
Definition at line 31 of file angle.c.
References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
Referenced by dig_node_add_line().
Definition at line 83 of file angle.c.
References dig_line_degenerate(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
Referenced by dig_node_add_line().
Definition at line 72 of file diglib/cindex.c.
References Cat_index::cat, Cat_index::field, G_debug(), G_realloc, NULL, and Cat_index::type.
Referenced by V2_write_line_sfa(), Vect__load_plus_pg(), and Vect_build_nat().
Definition at line 177 of file diglib/cindex.c.
References Cat_index::cat, Cat_index::field, G_debug(), G_realloc, NULL, and Cat_index::type.
Referenced by V2__add_line_to_topo_nat().
Definition at line 267 of file diglib/cindex.c.
References Cat_index::cat, Cat_index::field, G_debug(), G_warning(), NULL, and Cat_index::type.
Referenced by V2__delete_line_from_topo_nat(), and V2_delete_line_sfa().
Definition at line 44 of file diglib/cindex.c.
References G_debug(), G_free(), and NULL.
Referenced by dig_free_plus(), dig_read_cidx(), and Vect_build_partial().
Initialize Plus_head structure (cidx)
| Plus | pointer to Plus_head structure |
Definition at line 29 of file diglib/cindex.c.
References G_debug(), and G_malloc.
Referenced by dig_init_plus(), dig_read_cidx(), and Vect_build_partial().
Definition at line 328 of file diglib/cindex.c.
References G_debug().
Referenced by Vect_build_partial(), and Vect_cidx_get_unique_cats_by_index().
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 365 of file plus_area.c.
References _, Plus_head::Area, P_topo_c::area, P_isle::area, P_area::centroid, dig_free_area(), dig_spidx_del_area(), G_debug(), G_fatal_error(), G_warning(), Plus_head::Isle, P_area::isles, Plus_head::Line, P_area::lines, P_area::n_isles, P_area::n_lines, NULL, and P_line::topo.
Referenced by V2__add_line_to_topo_nat(), V2__delete_line_from_topo_nat(), and Vect_remove_small_areas_nat().
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 781 of file plus_area.c.
References _, Plus_head::Area, P_isle::area, dig_area_del_isle(), dig_free_isle(), dig_spidx_del_isle(), G_debug(), G_fatal_error(), Plus_head::Isle, P_topo_b::left, Plus_head::Line, P_isle::lines, P_isle::n_lines, NULL, P_topo_b::right, and P_line::topo.
Referenced by V2__add_line_to_topo_nat(), V2__delete_line_from_topo_nat(), and Vect_remove_small_areas_nat().
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 217 of file plus_line.c.
References _, P_node::angles, dig_free_line(), dig_free_node(), dig_line_add_updated(), dig_node_add_updated(), dig_spidx_del_line(), dig_spidx_del_node(), G_debug(), G_fatal_error(), GV_BOUNDARY, GV_LINE, GV_LINES, Plus_head::Line, P_node::lines, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, P_node::n_lines, Plus_head::Node, NULL, P_line::offset, P_line::topo, P_line::type, Plus_head::uplist, P_node::x, P_node::y, and P_node::z.
Referenced by V2__delete_line_from_topo_nat(), V2_delete_line_sfa(), and Vect_remove_small_areas_nat().
| 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.
References st, t, x, and ZERO.
Referenced by Vect_line_distance(), Vect_line_geodesic_distance(), and Vect_snap_line().
Dump spatial index.
| [out] | fp | pointer to FILE |
| Plus | pointer to Plus_head structure |
Definition at line 1263 of file spindex_rw.c.
References RTreeFlushBuffer().
Referenced by Vect_sidx_dump().
Definition at line 90 of file allocation.c.
References dig__falloc(), G_sleep(), and NULL.
Flush struct gvfile.
| file | pointer to struct gvfile structure |
Definition at line 104 of file file.c.
References file.
Referenced by dig_Wr_spidx(), dig_write_plus_file(), V1_delete_line_nat(), and V1_restore_line_nat().
Free struct gvfile.
| file | pointer to struct gvfile structure |
Definition at line 268 of file file.c.
References file, and G_free().
Referenced by V1_close_nat().
Initialize gvfile structure.
| [in,out] | file | pointer 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_cidx_save(), Vect_open_fidx(), Vect_open_sidx(), Vect_open_topo(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
Load opened struct gvfile to memory.
Warning: position in file is set to the beginning.
| file | pointer to struct gvfile structure |
Definition at line 188 of file file.c.
References _, AMI_STREAM< T >::AMI_STREAM(), file, G_debug(), G_free(), G_fseek(), G_getenv_nofatal(), G_malloc, G_strcasecmp(), G_warning(), GV_MEMORY_ALWAYS, GV_MEMORY_AUTO, GV_MEMORY_NEVER, and NULL.
Referenced by V1_open_old_nat().
Find bounding box for given area.
| Plus | pointer to Plus_head structure | |
| area | area id | |
| [out] | box | bounding box |
Definition at line 918 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, P_area::lines, P_topo_b::N1, rtree_search(), RTreeSearch(), P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by Vect_get_area_box().
Definition at line 97 of file diglib/poly.c.
References line_pnts::n_points, line_pnts::x, and line_pnts::y.
Referenced by Vect_build_line_area(), and Vect_isle_find_area().
Find box for isle.
| Plus | pointer to Plus_head structure | |
| isle | isle id | |
| [out] | box | bounding box |
Definition at line 1014 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, P_isle::lines, P_topo_b::N1, rtree_search(), RTreeSearch(), P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by Vect_get_isle_box().
Find box for line.
| Plus | pointer to Plus_head structure | |
| line | line id | |
| [out] | box | bounding box |
Definition at line 802 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, GV_BOUNDARY, GV_LINE, GV_LINES, P_topo_l::N1, P_topo_b::N1, NULL, rtree_search(), RTreeSearch(), P_line::topo, P_line::type, P_node::x, P_node::y, and P_node::z.
Referenced by Vect_get_line_box().
Find one node by coordinates.
| Plus | pointer to Plus_head structure |
| x,y,z | coordinates |
Definition at line 717 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, rtree_search(), RTreeSearch(), and x.
Definition at line 136 of file diglib/poly.c.
References line_pnts::n_points, line_pnts::x, and line_pnts::y.
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 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().
Definition at line 102 of file allocation.c.
References dig__frealloc(), G_sleep(), and NULL.
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_add_area(), dig_del_area(), dig_free_plus_areas(), and dig_Rd_P_area().
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_add_isle(), dig_del_isle(), dig_free_plus_isles(), and dig_Rd_P_isle().
Free line structure.
| Line | 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_del_line(), dig_free_plus_lines(), and dig_Rd_P_line().
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_del_line(), dig_free_plus_nodes(), and dig_Rd_P_node().
Free Plus structure.
Structure is not inited and dig_init_plus() should follow.
| [in] | Plus | pointer 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(), Vect__open_old(), and Vect_close().
Free Plus->Area structure.
| [in] | Plus | pointer to Plus_head structure |
Definition at line 114 of file plus.c.
References dig_free_area(), G_debug(), G_free(), and NULL.
Referenced by dig_free_plus(), and Vect__build_downgrade().
Free Plus->Isle structure.
| [in] | Plus | pointer to Plus_head structure |
Definition at line 142 of file plus.c.
References dig_free_isle(), G_debug(), G_free(), and NULL.
Referenced by dig_free_plus(), and Vect__build_downgrade().
Free Plus->Line structure.
| [in] | Plus | pointer to Plus_head structure |
Definition at line 78 of file plus.c.
References dig_free_line(), G_debug(), G_free(), and NULL.
Referenced by dig_free_plus(), and Vect__build_downgrade().
Free Plus->Node structure.
| [in] | Plus | pointer to Plus_head structure |
Definition at line 50 of file plus.c.
References dig_free_node(), G_debug(), G_free(), and NULL.
Referenced by dig_free_plus(), and Vect__build_downgrade().
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 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(), rtree_search(), V1_delete_line_nat(), V1_restore_line_nat(), V1_rewind_nat(), and Vect_coor_info().
Get struct gvfile position.
| file | pointer to struct gvfile structure |
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(), 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().
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 _, 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().
| int dig_get_poly_points | ( | int | n_lines, |
| struct line_pnts ** | LPoints, | ||
| int * | direction, | ||
| struct line_pnts * | BPoints | ||
| ) |
Definition at line 34 of file diglib/poly.c.
References dig_alloc_points(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
Definition at line 22 of file vector/diglib/list.c.
References NULL.
Referenced by V2_read_line_sfa(), V2_read_next_line_ogr(), V2_read_next_line_pg(), and Vect_select_lines_by_box().
Initialize Plus_head structure.
| [in,out] | Plus | pointer to Plus_head structure |
Definition at line 30 of file plus.c.
References dig_cidx_init(), dig_spidx_init(), G_debug(), G_zero(), and GV_BUILD_NONE.
Referenced by dig_load_plus(), Vect__open_old(), and Vect__open_topo_pg().
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 900 of file portable.c.
References Port_info::byte_order, Port_info::dbl_cnvrt, dbl_cnvrt, dbl_order, Port_info::dbl_quick, ENDIAN_BIG, FALSE, Port_info::flt_cnvrt, flt_cnvrt, flt_order, Port_info::flt_quick, Port_info::int_cnvrt, int_cnvrt, int_order, Port_info::int_quick, Port_info::lng_cnvrt, lng_cnvrt, lng_order, Port_info::lng_quick, nat_off_t, Port_info::off_t_cnvrt, off_t_cnvrt, off_t_order, Port_info::off_t_quick, PORT_DOUBLE, PORT_FLOAT, port_init(), PORT_INT, PORT_LONG, PORT_SHORT, Port_info::shrt_cnvrt, 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(), V1_open_old_nat(), Vect_cidx_save(), Vect_open_fidx(), Vect_save_fidx(), Vect_save_sidx(), and Vect_save_topo().
Definition at line 135 of file angle.c.
References line_pnts::n_points, line_pnts::x, and line_pnts::y.
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 466 of file struct_alloc.c.
References G_debug(), G_realloc, and NULL.
Referenced by dig_add_isle(), and dig_Rd_P_isle().
Add new line to updated.
| Plus | pointer to Plus_head structure |
| line | line id |
| offset | line offset (negative offset is ignored) |
Definition at line 36 of file vector/diglib/update.c.
References G_debug(), and G_realloc.
Referenced by dig_del_line().
Definition at line 24 of file vector/diglib/box.c.
References Box, G_zero(), line_pnts::n_points, line_pnts::x, line_pnts::y, and line_pnts::z.
Referenced by line_check_intersection2(), V2__add_line_to_topo_nat(), V2_write_line_sfa(), Vect__load_plus_pg(), Vect_build_line_area(), Vect_build_nat(), Vect_get_line_box(), Vect_get_map_box1(), Vect_line_box(), and Vect_select_lines_by_polygon().
Definition at line 179 of file angle.c.
References G_debug(), line_pnts::n_points, line_pnts::x, and line_pnts::y.
Referenced by dig_calc_begin_angle(), dig_calc_end_angle(), Vect_line_intersection(), and Vect_line_intersection2().
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 G_debug(), GV_BOUNDARY, GV_LEFT, GV_RIGHT, P_topo_b::left, Plus_head::Line, P_topo_b::right, P_line::topo, and P_line::type.
Referenced by Vect_build_line_area().
Reset number of updated lines.
| Plus | pointer to Plus_head structure |
Definition at line 24 of file vector/diglib/update.c.
Referenced by Vect_reset_updated().
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 383 of file plus_line.c.
References GV_BOUNDARY, GV_LEFT, GV_RIGHT, P_topo_b::left, Plus_head::Line, P_topo_b::right, P_line::topo, and P_line::type.
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 195 of file plus.c.
References _, 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(), and G_fatal_error().
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 allocated 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 44 of file plus_node.c.
References P_node::angles, dig_calc_begin_angle(), dig_calc_end_angle(), dig_node_alloc_line(), G_debug(), GV_LINES, P_node::lines, P_node::n_lines, and Plus_head::Node.
Add node to updated.
| Plus | pointer to Plus_head structure |
| node | node id |
Definition at line 85 of file vector/diglib/update.c.
References G_debug(), and G_realloc.
Referenced by dig_del_line().
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.
References P_node::alloc_lines, P_node::angles, G_debug(), G_realloc, P_node::lines, P_node::n_lines, and NULL.
Referenced by dig_node_add_line(), and 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 622 of file plus_area.c.
References dig_angle_next_line(), dig_node_line_angle(), G_debug(), GV_BOUNDARY, GV_LEFT, GV_LINE, GV_LINES, GV_RIGHT, Plus_head::Line, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, P_line::topo, and P_line::type.
Referenced by dig_build_area_with_line().
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.
Referenced by dig_build_area_with_line(), and dig_node_angle_check().
Reset number of updated nodes.
| Plus | pointer to Plus_head structure |
Definition at line 74 of file vector/diglib/update.c.
Referenced by Vect_reset_updated().
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(), dig_alloc_points(), and dig_build_area_with_line().
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.
Referenced by Vect_line_prune_thresh().
Definition at line 350 of file plus_struct.c.
References P_area::centroid, dig__fread_port_P(), dig_alloc_area(), dig_area_alloc_isle(), dig_area_alloc_line(), dig_free_area(), 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 448 of file plus_struct.c.
References P_isle::area, dig__fread_port_P(), dig_alloc_isle(), dig_free_isle(), dig_isle_alloc_line(), G_debug(), P_isle::lines, P_isle::n_lines, and NULL.
Referenced by dig_load_plus().
Definition at line 162 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_free_line(), dig_type_from_store(), G_debug(), GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, GV_POINT, P_topo_b::left, P_topo_f::left, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, NULL, P_line::offset, P_topo_b::right, P_line::topo, P_line::type, and P_topo_k::volume.
Referenced by dig_load_plus().
Definition at line 51 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_free_node(), dig_node_alloc_line(), G_debug(), P_node::lines, P_node::n_lines, NULL, 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 530 of file plus_struct.c.
References _, Plus_head::Area_offset, 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(), 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, 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, Plus_head::version, Plus_head::Volume_offset, 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 1219 of file spindex_rw.c.
References dig_Rd_spidx_head(), dig_rewind(), dig_set_cur_port(), dig_spidx_free(), dig_spidx_init(), and G_debug().
Referenced by Vect_open_sidx().
Read spatial index header from sidx file.
| fp | pointer to struct gvfile | |
| [in,out] | ptr | pointer to Plus_head structure |
Definition at line 262 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, 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, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, Plus_head::off_t_size, 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(), and Vect_open_sidx().
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 296 of file cindex_rw.c.
References 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, and Plus_head::n_cidx.
Referenced by Vect_cidx_open().
Read header of cidx file.
| fp | pointer to gvfile structure |
| plus | pointer to Plus_head structure |
Definition at line 122 of file cindex_rw.c.
References _, Plus_head::a_cidx, 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(), G_debug(), G_fatal_error(), G_realloc, G_warning(), GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GV_CIDX_VER_MAJOR, GV_CIDX_VER_MINOR, Plus_head::n_cidx, NULL, Plus_head::off_t_size, PORT_LONG_MAX, t, 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 33 of file frmt.c.
References _, G_chop(), G_debug(), G_getl2(), G_store(), G_strcasecmp(), G_strlcpy(), G_warning(), G_zero(), GV_FORMAT_OGR, GV_FORMAT_POSTGIS, and GV_PG_FID_COLUMN.
Referenced by Vect__open_old().
| 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 |
| lineid | ||
| type | feature type | |
| Points | line geometry | |
| box | bounding box | |
| offset | line offset |
Definition at line 190 of file plus_line.c.
References Plus_head::n_lines.
Referenced by V2__add_line_to_topo_nat().
Rewind file position.
| file | pointer 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().
| 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 875 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, rtree_search(), RTreeSearch(), bound_box::S, bound_box::T, and bound_box::W.
Referenced by Vect_select_areas_by_box().
| 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 971 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, rtree_search(), RTreeSearch(), bound_box::S, 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 759 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, rtree_search(), RTreeSearch(), bound_box::S, bound_box::T, and bound_box::W.
Referenced by Vect_select_lines_by_box().
Select nodes by bbox.
| Plus | pointer to Plus_head structure |
| box | bounding box |
| list | list of selected lines |
Definition at line 668 of file spindex.c.
References bound_box::B, RTree_Rect::boundary, bound_box::E, G_debug(), G_malloc, bound_box::N, rtree_search(), RTreeSearch(), bound_box::S, bound_box::T, and bound_box::W.
Referenced by Vect_select_nodes_by_box().
Set current Port_info structure.
| port | pointer to Port_info structure |
Definition at line 996 of file portable.c.
References Cur_Head.
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(), V1_restore_line_nat(), Vect_open_fidx(), and Vect_save_fidx().
Definition at line 24 of file vector/diglib/line_dist.c.
Add new area to spatial index.
| Plus | pointer to Plus_head structure |
| area | area id |
| box | bounding box |
Definition at line 360 of file spindex.c.
References 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.
Referenced by dig_add_area(), and Vect__load_plus_pg().
Add new island to spatial index.
| Plus | pointer to Plus_head structure |
| isle | isle id |
| box | bounding box |
Definition at line 394 of file spindex.c.
References 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.
Referenced by dig_add_isle(), and Vect__load_plus_pg().
Add new line to spatial index.
| Plus | pointer to Plus_head structure |
| line | line id |
| box | bounding box |
Definition at line 326 of file spindex.c.
References 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 node to spatial index.
| Plus | pointer to Plus_head structure |
| node | node id |
| x,y,z | node coordinates |
Definition at line 291 of file spindex.c.
References RTree_Rect::boundary, G_debug(), G_malloc, RTreeInsertRect(), and x.
Referenced by dig_add_node().
Delete area from spatial index.
G_fatal_error() called on error.
| Plus | pointer to Plus_head structure |
| area | area id |
Definition at line 514 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, P_area::lines, P_topo_b::N1, NULL, RTreeDeleteRect(), P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by dig_del_area().
Delete isle from spatial index.
G_fatal_error() called on error.
| Plus | pointer to Plus_head structure |
| isle | isle id |
Definition at line 567 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, P_isle::lines, P_topo_b::N1, RTreeDeleteRect(), P_line::topo, P_node::x, P_node::y, and P_node::z.
Referenced by dig_del_isle().
Delete line from spatial index.
G_fatal_error() called on error.
| Plus | pointer to Plus_head structure |
| line | line id |
| x,y,z | coordinates |
Definition at line 472 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, RTreeDeleteRect(), and x.
Referenced by dig_del_line().
Delete node from spatial index.
G_fatal_error() called on error.
| Plus | pointer to Plus_head structure |
| node | node id |
Definition at line 429 of file spindex.c.
References _, RTree_Rect::boundary, G_debug(), G_fatal_error(), G_malloc, RTreeDeleteRect(), P_node::x, P_node::y, and P_node::z.
Referenced by dig_del_line().
Free spatial index (nodes, lines, areas, isles)
| Plus | pointer to Plus_head structure |
Definition at line 243 of file spindex.c.
References close, and RTreeDestroyTree().
Referenced by dig_free_plus(), dig_Rd_spidx(), and Vect_open_sidx().
Reset spatial index for areas.
| Plus | pointer to Plus_head structure |
Definition at line 177 of file spindex.c.
References close, G_free(), G_tempfile(), open, RTreeCreateTree(), and RTreeDestroyTree().
Referenced by Vect__build_downgrade().
Reset spatial index for isles.
| Plus | pointer to Plus_head structure |
Definition at line 210 of file spindex.c.
References close, G_free(), G_tempfile(), open, RTreeCreateTree(), and RTreeDestroyTree().
Referenced by Vect__build_downgrade().
Free spatial index for lines.
| Plus | pointer to Plus_head structure |
Definition at line 144 of file spindex.c.
References close, G_free(), G_tempfile(), open, RTreeCreateTree(), and RTreeDestroyTree().
Referenced by Vect__build_downgrade().
Free spatial index for nodes.
| Plus | pointer to Plus_head structure |
Definition at line 111 of file spindex.c.
References close, G_free(), G_tempfile(), open, RTreeCreateTree(), and RTreeDestroyTree().
Referenced by Vect__build_downgrade().
Initit spatial index (nodes, lines, areas, isles)
| Plus | pointer to Plus_head structure |
Definition at line 35 of file spindex.c.
References close, FALSE, G_debug(), G_free(), G_tempfile(), NULL, open, and RTreeCreateTree().
Referenced by dig_init_plus(), dig_Rd_spidx(), and Vect_open_sidx().
Convert type from store type.
| stype | feature store type |
Definition at line 56 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().
Convert type to store type.
| type | feature type |
Definition at line 25 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_Wr_P_line(), dig_write_cidx(), and dig_write_cidx_head().
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 410 of file plus_struct.c.
References 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 491 of file plus_struct.c.
References P_isle::area, dig__fwrite_port_P(), P_isle::lines, P_isle::n_lines, and NULL.
Referenced by dig_write_isles().
Definition at line 259 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, P_topo_b::left, P_topo_f::left, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, NULL, P_line::offset, P_topo_b::right, P_topo_f::right, P_line::topo, P_line::type, and P_topo_k::volume.
Referenced by dig_write_lines().
Definition at line 117 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, NULL, P_node::x, P_node::y, and P_node::z.
Referenced by dig_write_nodes().
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.
| fp | pointer to gvfile structure | |
| [in,out] | ptr | pointer to Plus_head structure |
Definition at line 710 of file plus_struct.c.
References Plus_head::Area, Plus_head::Area_offset, Plus_head::box, 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(), 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, 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, P_line::type, Plus_head::Volume_offset, 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 1173 of file spindex_rw.c.
References dig_fflush(), dig_ftell(), dig_rewind(), dig_set_cur_port(), dig_Wr_spidx_head(), and G_debug().
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 55 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, 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, Plus_head::Isle_spidx, Plus_head::Isle_spidx_offset, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, Plus_head::off_t_size, PORT_INT_MAX, 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 368 of file plus.c.
References dig_ftell(), and dig_Wr_P_area().
Referenced by dig_write_plus_file().
Definition at line 252 of file cindex_rw.c.
References 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(), and Plus_head::n_cidx.
Referenced by Vect_cidx_save().
Definition at line 25 of file cindex_rw.c.
References 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(), G_debug(), GV_CIDX_EARLIEST_MAJOR, GV_CIDX_EARLIEST_MINOR, GV_CIDX_VER_MAJOR, GV_CIDX_VER_MINOR, Plus_head::n_cidx, Plus_head::off_t_size, PORT_LONG_MAX, and t.
Referenced by dig_write_cidx().
| int dig_write_frmt_ascii | ( | FILE * | dascii, |
| struct Format_info * | finfo, | ||
| int | format | ||
| ) |
Definition at line 154 of file frmt.c.
References G_debug(), and G_fatal_error().
Writes topo structure (isles) to topo file.
| [in,out] | plus | topo file |
| [in] | Plus | pointer to Plus_head structure |
Definition at line 392 of file plus.c.
References dig_ftell(), and dig_Wr_P_isle().
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 344 of file plus.c.
References dig_ftell(), and dig_Wr_P_line().
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 321 of file plus.c.
References dig_ftell(), and dig_Wr_P_node().
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 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(), and G_warning().
Referenced by Vect_save_topo().
| 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 1383 of file spindex_rw.c.
References assert, dig__fread_port_D(), dig__fread_port_I(), dig__fread_port_O(), dig_fseek(), dig_set_cur_port(), MAXLEVEL, NUMSIDES, r, RTreeOverlap(), and t.
Referenced by dig_find_area_box(), dig_find_isle_box(), dig_find_line_box(), dig_find_node(), dig_select_areas(), dig_select_isles(), dig_select_lines(), and dig_select_nodes().