|
GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
|
#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. More... | |
| int | dig_Rd_spidx_head (struct gvfile *fp, struct Plus_head *ptr) |
| Read spatial index header from sidx file. More... | |
| int | dig_Wr_spidx (struct gvfile *fp, struct Plus_head *Plus) |
| Write spatial index to file. More... | |
| 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. More... | |
| int | dig_dump_spidx (FILE *fp, const struct Plus_head *Plus) |
| Dump spatial index. More... | |
| 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. More... | |
| #define NUMSIDES 6 |
Definition at line 29 of file spindex_rw.c.
| int dig_dump_spidx | ( | FILE * | fp, |
| const struct Plus_head * | Plus | ||
| ) |
Dump spatial index.
| [out] | fp | pointer to FILE |
| Plus | pointer to Plus_head structure |
Definition at line 1273 of file spindex_rw.c.
References RTree::fd, and Plus_head::Node_spidx.
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 1229 of file spindex_rw.c.
References dig_Rd_spidx_head(), dig_rewind(), dig_set_cur_port(), dig_spidx_free(), dig_spidx_init(), G_debug(), and Plus_head::spidx_port.
Read spatial index header from sidx file.
| fp | pointer to struct gvfile | |
| [in,out] | ptr | pointer to Plus_head structure |
Definition at line 267 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, Version_info::back_major, Version_info::back_minor, Plus_head::coor_size, dig__fread_port_C(), dig__fread_port_I(), dig__fread_port_L(), dig__fread_port_O(), dig_fseek(), dig_init_portable(), dig_rewind(), dig_set_cur_port(), Plus_head::Face_spidx_offset, G_debug(), G_fatal_error(), G_warning(), GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GV_SIDX_VER_MAJOR, GV_SIDX_VER_MINOR, Plus_head::Hole_spidx_offset, Plus_head::Isle_spidx, Plus_head::Isle_spidx_offset, RTree::leafcard, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, Version_info::major, RTree::min_leaf_fill, RTree::min_node_fill, Version_info::minor, RTree::n_leafs, RTree::n_nodes, RTree::ndims, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, RTree::nodecard, RTree::nodesize, RTree::nsides, Port_info::off_t_size, Plus_head::off_t_size, RTree::rootlevel, RTree::rootpos, Plus_head::spidx, Plus_head::spidx_head_size, Plus_head::spidx_port, Plus_head::spidx_with_z, t, Plus_head::version, and Plus_head::Volume_spidx_offset.
Referenced by dig_Rd_spidx().
Write spatial index to file.
| [out] | fp | pointer to struct gvfile |
| Plus | pointer to Plus_head structure |
Definition at line 1179 of file spindex_rw.c.
References dig_rewind(), dig_set_cur_port(), dig_Wr_spidx_head(), G_debug(), Plus_head::Node_spidx_offset, and Plus_head::spidx_port.
Referenced by Vect_save_sidx().
Write spatial index header to file.
| [in,out] | fp | pointer to struct gvfile |
| ptr | pointer to Plus_head structure |
Definition at line 56 of file spindex_rw.c.
References _, Plus_head::Area_spidx, Plus_head::Area_spidx_offset, Port_info::byte_order, Plus_head::coor_size, dig__fwrite_port_C(), dig__fwrite_port_I(), dig__fwrite_port_L(), dig__fwrite_port_O(), dig_ftell(), dig_rewind(), dig_set_cur_port(), Plus_head::Face_spidx_offset, G_debug(), G_fatal_error(), GV_SIDX_EARLIEST_MAJOR, GV_SIDX_EARLIEST_MINOR, GV_SIDX_VER_MAJOR, GV_SIDX_VER_MINOR, Plus_head::Hole_spidx_offset, if(), Plus_head::Isle_spidx, Plus_head::Isle_spidx_offset, RTree::leafcard, Plus_head::Line_spidx, Plus_head::Line_spidx_offset, RTree::min_leaf_fill, RTree::min_node_fill, RTree::n_leafs, RTree::n_nodes, RTree::ndims, Plus_head::Node_spidx, Plus_head::Node_spidx_offset, RTree::nodecard, RTree::nodesize, RTree::nsides, Port_info::off_t_size, Plus_head::off_t_size, PORT_INT_MAX, RTree::rootlevel, Plus_head::spidx_head_size, Plus_head::spidx_port, Plus_head::spidx_with_z, t, and Plus_head::Volume_spidx_offset.
Referenced by dig_Wr_spidx().
| 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 1397 of file spindex_rw.c.
References assert, dig_set_cur_port(), and Plus_head::spidx_port.