|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
|
Vector library - spatial index (lower level functions) More...
#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <string.h>#include <grass/vector.h>#include <grass/glocale.h>
Go to the source code of this file.
Vector library - spatial index (lower level functions)
Vector library - spatial index - read/write (lower level functions)
Lower level functions for reading/writing/manipulating vectors.
(C) 2001-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file spindex.c.
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().
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.
| 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().
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().