MobilityDB 1.3
Loading...
Searching...
No Matches
Functions
tgeo_tile.c File Reference

Functions for spatial and spatiotemporal tiles. More...

#include "geo/tgeo_tile.h"
#include <assert.h>
#include <postgres.h>
#include <float.h>
#include <utils/timestamp.h>
#include <liblwgeom.h>
#include <meos.h>
#include <meos_internal.h>
#include <meos_internal_geo.h>
#include "temporal/temporal.h"
#include "temporal/temporal_tile.h"
#include "geo/stbox.h"
#include "geo/tgeo_spatialfuncs.h"

Functions

static bool bitmatrix_get (const BitMatrix *bm, int *coords)
 Get the value of the bit in the bit matrix. More...
 
BitMatrixbitmatrix_make (int *count, int ndims)
 Create a bit matrix. More...
 
static void bitmatrix_set_cell (BitMatrix *bm, int *coords, bool value)
 Set the value of the bit in the bit matrix. More...
 
static int fastvoxel_bm (int *coords1, double *eps1, int *coords2, double *eps2, int ndims, BitMatrix *bm)
 Set in the bit matrix the bits of the tiles connecting with a line two input tiles. More...
 
STBoxstbox_get_space_tile (const GSERIALIZED *point, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin)
 Return a tile in the spatial grid of a spatiotemporal box. More...
 
STBoxstbox_get_space_time_tile (const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin)
 Return a tile in the spatiotemporal grid of a spatiotemporal box. More...
 
STBoxstbox_get_time_tile (TimestampTz t, const Interval *duration, TimestampTz torigin)
 Return a tile in the temporal grid of a spatiotemporal box. More...
 
STBoxstbox_space_tiles (const STBox *bounds, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool border_inc, int *count)
 Return the spatial grid of a spatiotemporal box. More...
 
STBoxstbox_space_time_tile (const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool hasx, bool hast)
 Return a tile in the multidimensional grid of a spatiotemporal box. More...
 
STBoxstbox_space_time_tiles (const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool border_inc, int *count)
 Return the spatiotemporal grid of a spatiotemporal box. More...
 
bool stbox_tile_state_get (STboxGridState *state, STBox *box)
 Get the current tile of the multidimensional grid. More...
 
STboxGridStatestbox_tile_state_make (const Temporal *temp, const STBox *box, double xsize, double ysize, double zsize, const Interval *duration, POINT3DZ sorigin, TimestampTz torigin, bool border_inc)
 Create the initial state that persists across multiple calls of the function. More...
 
void stbox_tile_state_next (STboxGridState *state)
 Increment the current state to the next tile of the multidimensional grid. More...
 
void stbox_tile_state_set (double x, double y, double z, TimestampTz t, double xsize, double ysize, double zsize, int64 tunits, bool hasx, bool hasz, bool hast, int32 srid, STBox *result)
 Generate a tile from the current state of the multidimensional grid. More...
 
STBoxstbox_time_tiles (const STBox *bounds, const Interval *duration, TimestampTz torigin, bool border_inc, int *count)
 Return the spatiotemporal grid of a spatiotemporal box. More...
 
STBoxtgeo_space_boxes (const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, int *count)
 Return the spatiotemporal boxes of a temporal geo split with respect to a space grid. More...
 
Temporal ** tgeo_space_split (const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, int *count)
 Return the fragments a temporal geo split according to a space and possibly a time grid. More...
 
STBoxtgeo_space_time_boxes (const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *count)
 Return the spatiotemporal boxes of a temporal point split with respect to a space and possibly a time grid. More...
 
Temporal ** tgeo_space_time_split (const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, TimestampTz **time_bins, int *count)
 Return the fragments a temporal geo split according to a space and possibly a time grid. More...
 
STboxGridStatetgeo_space_time_tile_init (const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *ntiles)
 Set the state with a temporal point and a space and possibly time grid for splitting or obtaining a set of spatiotemporal boxes. More...
 
static void tile_get_coords (double x, double y, double z, TimestampTz t, const STboxGridState *state, int *coords)
 Transform the minimum values of a tile into matrix coordinates. More...
 
static void tile_get_fpos (double dx, double dy, double dz, TimestampTz dt, const STboxGridState *state, double *fpos)
 Transform the values in a tile into relative positions in matrix cells. More...
 
int tpoint_set_tiles (const Temporal *temp, const STboxGridState *state, BitMatrix *bm)
 Set the bit corresponding to the tiles intersecting a temporal point. More...
 
static void tpointinst_get_coords_fpos (const TInstant *inst, bool hasz, bool hast, const STboxGridState *state, int *coords, double *fpos)
 Get the coordinates of the tile corresponding the temporal point instant. More...
 
static int tpointseq_cont_set_tiles (const TSequence *seq, bool hasz, bool hast, const STboxGridState *state, BitMatrix *bm)
 Set the bit corresponding to the tiles intersecting the temporal point sequence. More...
 
static int tpointseq_disc_set_tiles (const TSequence *seq, bool hasz, bool hast, const STboxGridState *state, BitMatrix *bm)
 Set the bit corresponding to the tiles intersecting a temporal point sequence. More...
 
static int tpointseq_set_tiles (const TSequence *seq, bool hasz, bool hast, const STboxGridState *state, BitMatrix *bm)
 Set the bit corresponding to the tiles intersecting the temporal point sequence. More...
 
static int tpointseqset_set_tiles (const TSequenceSet *ss, bool hasz, bool hast, const STboxGridState *state, BitMatrix *bm)
 Set the bit corresponding to the tiles intersecting a temporal point sequence set. More...
 

Detailed Description

Functions for spatial and spatiotemporal tiles.