30#ifndef __TEMPORAL_TILE_H__
31#define __TEMPORAL_TILE_H__
35#include "temporal/meos_catalog.h"
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
External API of the Mobility Engine Open Source (MEOS) library.
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
unsigned char uint8
Definition: postgres_ext_defs.in.h:14
long int int64
Definition: postgres_ext_defs.in.h:12
Definition: postgres_ext_defs.in.h:27
Datum size
Size of the values.
Definition: temporal_tile.h:50
int nbins
Total number of bins.
Definition: temporal_tile.h:56
const void * to_split
NULL when generating bins, used for splitting span sets or temporal values.
Definition: temporal_tile.h:53
Datum value
Current value.
Definition: temporal_tile.h:55
bool done
True when the state is consumed.
Definition: temporal_tile.h:47
Datum origin
Origin of the values.
Definition: temporal_tile.h:51
Span span
Bounding span.
Definition: temporal_tile.h:52
uint8 basetype
span basetype
Definition: temporal_tile.h:48
int i
Current tile number.
Definition: temporal_tile.h:49
Struct for storing the state that persists across multiple calls generating the bin list.
Definition: temporal_tile.h:46
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal boxes.
Definition: meos.h:124
int coords[2]
Coordinates of the current tile.
Definition: temporal_tile.h:74
int max_coords[2]
Maximum coordinates of the tiles.
Definition: temporal_tile.h:73
const Temporal * temp
Optional temporal number to be split.
Definition: temporal_tile.h:69
bool done
True when the state is consumed.
Definition: temporal_tile.h:64
int64 tunits
Time size.
Definition: temporal_tile.h:67
TimestampTz t
Current time.
Definition: temporal_tile.h:71
int i
Current tile number.
Definition: temporal_tile.h:65
Datum value
Current value.
Definition: temporal_tile.h:70
int ntiles
Total number of tiles.
Definition: temporal_tile.h:72
Datum vsize
Value size.
Definition: temporal_tile.h:66
TBox box
Bounding box.
Definition: temporal_tile.h:68
Struct for storing the state for tiling operations.
Definition: temporal_tile.h:63
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173
bool tbox_tile_state_get(TboxGridState *state, TBox *box)
Get the current tile of the multidimensional grid.
Definition: temporal_tile.c:725
Span * spanset_bins(const SpanSet *ss, Datum size, Datum origin, int *count)
Return the bins from a span set.
Definition: temporal_tile.c:478
void tbox_tile_state_next(TboxGridState *state)
Increment the current state to the next tile of the multidimensional grid.
Definition: temporal_tile.c:741
SpanBinState * temporal_time_bin_init(const Temporal *temp, const Interval *duration, TimestampTz torigin, int *nbins)
Set the state with a temporal value and a time bin for splitting or obtaining a set of spans.
Definition: temporal_tile.c:610
Datum datum_bin(Datum value, Datum size, Datum offset, meosType basetype)
Return the initial value of the bin that contains a number value.
Definition: temporal_tile.c:339
Span * span_bins(const Span *s, Datum size, Datum origin, int *count)
Return the bins from a span.
Definition: temporal_tile.c:429
TimestampTz timestamptz_bin_start(TimestampTz timestamp, int64 tunits, TimestampTz torigin)
Return the initial timestamp of the bin that contains a timestamptz (internal function)
Definition: temporal_tile.c:260
int span_num_bins(const Span *s, Datum size, Datum origin, Datum *start_bin, Datum *end_bin)
Get the time bins of a temporal value.
Definition: temporal_tile.c:383
TboxGridState * tbox_tile_state_make(const Temporal *temp, const TBox *box, Datum vsize, const Interval *duration, Datum xorigin, TimestampTz torigin)
Create the initial state for tiling operations.
Definition: temporal_tile.c:626
int64 interval_units(const Interval *interval)
Return the interval in the same representation as Postgres timestamps.
Definition: temporal_tile.c:210
TboxGridState * tnumber_value_time_tile_init(const Temporal *temp, Datum vsize, const Interval *duration, Datum vorigin, TimestampTz torigin, int *ntiles)
Set the state with a temporal number and a value and possibly time grid for splitting or obtaining a ...
Definition: temporal_tile.c:862
void tbox_tile_state_set(Datum value, TimestampTz t, Datum vsize, int64 tunits, meosType basetype, meosType spantype, TBox *box)
Generate a tile from the a multidimensional grid.
Definition: temporal_tile.c:693