|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
|
#include <inttypes.h>#include <sys/types.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <assert.h>#include <grass/vector.h>#include <grass/glocale.h>#include <grass/version.h>
Go to the source code of this file.
Macros | |
| #define | NUMSIDES 6 |
Functions | |
| int | dig_Wr_spidx_head (struct gvfile *fp, struct Plus_head *ptr) |
| Write spatial index header to file. | |
| int | dig_Rd_spidx_head (struct gvfile *fp, struct Plus_head *ptr) |
| Read spatial index header from sidx file. | |
| int | dig_Wr_spidx (struct gvfile *fp, struct Plus_head *Plus) |
| Write spatial index to file. | |
| 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. | |
| int | dig_dump_spidx (FILE *fp, const struct Plus_head *Plus) |
| Dump spatial index. | |
| 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. | |
| #define NUMSIDES 6 |
Definition at line 30 of file spindex_rw.c.
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().
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().
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().
| 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().