MobilityDB  1.0
tpoint_tile.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without a written
10  * agreement is hereby granted, provided that the above copyright notice and
11  * this paragraph and the following two paragraphs appear in all copies.
12  *
13  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
16  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
17  * OF SUCH DAMAGE.
18  *
19  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
22  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
24  *
25  *****************************************************************************/
26 
32 #ifndef __TPOINT_TILE_H__
33 #define __TPOINT_TILE_H__
34 
35 #include "general/temporal.h"
36 
37 #define MAXDIMS 4
38 
39 /*****************************************************************************/
40 
44 typedef struct
45 {
46  int numdims;
47  int count[MAXDIMS];
48  uint8_t byte[1];
49 } BitMatrix;
50 
55 typedef struct STboxGridState
56 {
57  bool done;
58  int i;
59  double size;
60  int64 tunits;
65  double x;
66  double y;
67  double z;
68  TimestampTz t;
69  int coords[MAXDIMS];
71 
72 /*****************************************************************************/
73 
74 extern Datum stbox_multidim_grid(PG_FUNCTION_ARGS);
75 extern Datum stbox_multidim_tile(PG_FUNCTION_ARGS);
76 extern Datum tpoint_space_split(PG_FUNCTION_ARGS);
77 extern Datum tpoint_space_time_split(PG_FUNCTION_ARGS);
78 
79 /*****************************************************************************/
80 
81 #endif
int numdims
Number of dimensions.
Definition: tpoint_tile.h:46
int coords[MAXDIMS]
Coordinates of the current tile.
Definition: tpoint_tile.h:69
Struct for storing the state that persists across multiple calls generating a multidimensional grid...
Definition: tpoint_tile.h:55
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
double size
Size of the x, y, and z dimension.
Definition: tpoint_tile.h:59
double y
Minimum y value of the current tile.
Definition: tpoint_tile.h:66
int i
Number of current tile.
Definition: tpoint_tile.h:58
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum tpoint_space_time_split(PG_FUNCTION_ARGS)
Split a temporal point with respect to a spatiotemporal grid.
Definition: tpoint_tile.c:1098
BitMatrix * bm
Optional bit matrix for speeding up the computation of the split functions.
Definition: tpoint_tile.h:63
Basic functions for temporal types of any subtype.
Datum tpoint_space_split(PG_FUNCTION_ARGS)
Split a temporal point with respect to a spatial grid.
Definition: tpoint_tile.c:955
Structure for storing a bit matrix.
Definition: tpoint_tile.h:44
STBOX box
Bounding box of the grid.
Definition: tpoint_tile.h:61
Datum stbox_multidim_tile(PG_FUNCTION_ARGS)
Generate a tile in a multidimensional grid for temporal points.
Definition: tpoint_tile.c:700
Temporal * temp
Optional temporal point to be split.
Definition: tpoint_tile.h:62
Datum stbox_multidim_grid(PG_FUNCTION_ARGS)
Generate a multidimensional grid for temporal points.
Definition: tpoint_tile.c:593
TimestampTz t
Minimum t value of the current tile.
Definition: tpoint_tile.h:68
bool done
True when all the tiles have been processed.
Definition: tpoint_tile.h:57
#define MAXDIMS
Definition: tpoint_tile.h:37
double x
Minimum x value of the current tile.
Definition: tpoint_tile.h:65
int64 tunits
Size of the time dimension.
Definition: tpoint_tile.h:60
double z
Minimum z value of the current tile.
Definition: tpoint_tile.h:67
struct STboxGridState STboxGridState
Struct for storing the state that persists across multiple calls generating a multidimensional grid...