From 81450d71d1724d24c95eea106c242e91046874c1 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 19:45:02 -0500 Subject: [PATCH 01/22] [inlcude] organizing subdirectory general --- include/{ => general}/doublen.h | 0 include/{ => general}/lifting.h | 0 include/{ => general}/period.h | 0 include/{ => general}/periodset.h | 0 include/{ => general}/rangetypes_ext.h | 0 include/{ => general}/skiplist.h | 0 include/{ => general}/tbool_boolops.h | 0 include/{ => general}/tbox.h | 0 include/{ => general}/tempcache.h | 0 include/{ => general}/temporal.h | 0 include/{ => general}/temporal_aggfuncs.h | 0 include/{ => general}/temporal_analyze.h | 0 include/{ => general}/temporal_boxops.h | 0 include/{ => general}/temporal_compops.h | 0 include/{ => general}/temporal_gist.h | 0 include/{ => general}/temporal_parser.h | 0 include/{ => general}/temporal_posops.h | 0 include/{ => general}/temporal_selfuncs.h | 0 include/{ => general}/temporal_spgist.h | 0 include/{ => general}/temporal_tile.h | 0 include/{ => general}/temporal_util.h | 0 include/{ => general}/temporal_waggfuncs.h | 0 include/{ => general}/temporaltypes.h | 0 include/{ => general}/time_aggfuncs.h | 0 include/{ => general}/time_analyze.h | 0 include/{ => general}/time_gist.h | 0 include/{ => general}/time_selfuncs.h | 0 include/{ => general}/time_spgist.h | 0 include/{ => general}/timeops.h | 0 include/{ => general}/timestampset.h | 0 include/{ => general}/timetypes.h | 0 include/{ => general}/tinstant.h | 0 include/{ => general}/tinstantset.h | 0 include/{ => general}/tnumber_distance.h | 0 include/{ => general}/tnumber_gist.h | 0 include/{ => general}/tnumber_mathfuncs.h | 0 include/{ => general}/tnumber_selfuncs.h | 0 include/{ => general}/tnumber_spgist.h | 0 include/{ => general}/tsequence.h | 0 include/{ => general}/tsequenceset.h | 0 include/{ => general}/ttext_textfuncs.h | 0 41 files changed, 0 insertions(+), 0 deletions(-) rename include/{ => general}/doublen.h (100%) rename include/{ => general}/lifting.h (100%) rename include/{ => general}/period.h (100%) rename include/{ => general}/periodset.h (100%) rename include/{ => general}/rangetypes_ext.h (100%) rename include/{ => general}/skiplist.h (100%) rename include/{ => general}/tbool_boolops.h (100%) rename include/{ => general}/tbox.h (100%) rename include/{ => general}/tempcache.h (100%) rename include/{ => general}/temporal.h (100%) rename include/{ => general}/temporal_aggfuncs.h (100%) rename include/{ => general}/temporal_analyze.h (100%) rename include/{ => general}/temporal_boxops.h (100%) rename include/{ => general}/temporal_compops.h (100%) rename include/{ => general}/temporal_gist.h (100%) rename include/{ => general}/temporal_parser.h (100%) rename include/{ => general}/temporal_posops.h (100%) rename include/{ => general}/temporal_selfuncs.h (100%) rename include/{ => general}/temporal_spgist.h (100%) rename include/{ => general}/temporal_tile.h (100%) rename include/{ => general}/temporal_util.h (100%) rename include/{ => general}/temporal_waggfuncs.h (100%) rename include/{ => general}/temporaltypes.h (100%) rename include/{ => general}/time_aggfuncs.h (100%) rename include/{ => general}/time_analyze.h (100%) rename include/{ => general}/time_gist.h (100%) rename include/{ => general}/time_selfuncs.h (100%) rename include/{ => general}/time_spgist.h (100%) rename include/{ => general}/timeops.h (100%) rename include/{ => general}/timestampset.h (100%) rename include/{ => general}/timetypes.h (100%) rename include/{ => general}/tinstant.h (100%) rename include/{ => general}/tinstantset.h (100%) rename include/{ => general}/tnumber_distance.h (100%) rename include/{ => general}/tnumber_gist.h (100%) rename include/{ => general}/tnumber_mathfuncs.h (100%) rename include/{ => general}/tnumber_selfuncs.h (100%) rename include/{ => general}/tnumber_spgist.h (100%) rename include/{ => general}/tsequence.h (100%) rename include/{ => general}/tsequenceset.h (100%) rename include/{ => general}/ttext_textfuncs.h (100%) diff --git a/include/doublen.h b/include/general/doublen.h similarity index 100% rename from include/doublen.h rename to include/general/doublen.h diff --git a/include/lifting.h b/include/general/lifting.h similarity index 100% rename from include/lifting.h rename to include/general/lifting.h diff --git a/include/period.h b/include/general/period.h similarity index 100% rename from include/period.h rename to include/general/period.h diff --git a/include/periodset.h b/include/general/periodset.h similarity index 100% rename from include/periodset.h rename to include/general/periodset.h diff --git a/include/rangetypes_ext.h b/include/general/rangetypes_ext.h similarity index 100% rename from include/rangetypes_ext.h rename to include/general/rangetypes_ext.h diff --git a/include/skiplist.h b/include/general/skiplist.h similarity index 100% rename from include/skiplist.h rename to include/general/skiplist.h diff --git a/include/tbool_boolops.h b/include/general/tbool_boolops.h similarity index 100% rename from include/tbool_boolops.h rename to include/general/tbool_boolops.h diff --git a/include/tbox.h b/include/general/tbox.h similarity index 100% rename from include/tbox.h rename to include/general/tbox.h diff --git a/include/tempcache.h b/include/general/tempcache.h similarity index 100% rename from include/tempcache.h rename to include/general/tempcache.h diff --git a/include/temporal.h b/include/general/temporal.h similarity index 100% rename from include/temporal.h rename to include/general/temporal.h diff --git a/include/temporal_aggfuncs.h b/include/general/temporal_aggfuncs.h similarity index 100% rename from include/temporal_aggfuncs.h rename to include/general/temporal_aggfuncs.h diff --git a/include/temporal_analyze.h b/include/general/temporal_analyze.h similarity index 100% rename from include/temporal_analyze.h rename to include/general/temporal_analyze.h diff --git a/include/temporal_boxops.h b/include/general/temporal_boxops.h similarity index 100% rename from include/temporal_boxops.h rename to include/general/temporal_boxops.h diff --git a/include/temporal_compops.h b/include/general/temporal_compops.h similarity index 100% rename from include/temporal_compops.h rename to include/general/temporal_compops.h diff --git a/include/temporal_gist.h b/include/general/temporal_gist.h similarity index 100% rename from include/temporal_gist.h rename to include/general/temporal_gist.h diff --git a/include/temporal_parser.h b/include/general/temporal_parser.h similarity index 100% rename from include/temporal_parser.h rename to include/general/temporal_parser.h diff --git a/include/temporal_posops.h b/include/general/temporal_posops.h similarity index 100% rename from include/temporal_posops.h rename to include/general/temporal_posops.h diff --git a/include/temporal_selfuncs.h b/include/general/temporal_selfuncs.h similarity index 100% rename from include/temporal_selfuncs.h rename to include/general/temporal_selfuncs.h diff --git a/include/temporal_spgist.h b/include/general/temporal_spgist.h similarity index 100% rename from include/temporal_spgist.h rename to include/general/temporal_spgist.h diff --git a/include/temporal_tile.h b/include/general/temporal_tile.h similarity index 100% rename from include/temporal_tile.h rename to include/general/temporal_tile.h diff --git a/include/temporal_util.h b/include/general/temporal_util.h similarity index 100% rename from include/temporal_util.h rename to include/general/temporal_util.h diff --git a/include/temporal_waggfuncs.h b/include/general/temporal_waggfuncs.h similarity index 100% rename from include/temporal_waggfuncs.h rename to include/general/temporal_waggfuncs.h diff --git a/include/temporaltypes.h b/include/general/temporaltypes.h similarity index 100% rename from include/temporaltypes.h rename to include/general/temporaltypes.h diff --git a/include/time_aggfuncs.h b/include/general/time_aggfuncs.h similarity index 100% rename from include/time_aggfuncs.h rename to include/general/time_aggfuncs.h diff --git a/include/time_analyze.h b/include/general/time_analyze.h similarity index 100% rename from include/time_analyze.h rename to include/general/time_analyze.h diff --git a/include/time_gist.h b/include/general/time_gist.h similarity index 100% rename from include/time_gist.h rename to include/general/time_gist.h diff --git a/include/time_selfuncs.h b/include/general/time_selfuncs.h similarity index 100% rename from include/time_selfuncs.h rename to include/general/time_selfuncs.h diff --git a/include/time_spgist.h b/include/general/time_spgist.h similarity index 100% rename from include/time_spgist.h rename to include/general/time_spgist.h diff --git a/include/timeops.h b/include/general/timeops.h similarity index 100% rename from include/timeops.h rename to include/general/timeops.h diff --git a/include/timestampset.h b/include/general/timestampset.h similarity index 100% rename from include/timestampset.h rename to include/general/timestampset.h diff --git a/include/timetypes.h b/include/general/timetypes.h similarity index 100% rename from include/timetypes.h rename to include/general/timetypes.h diff --git a/include/tinstant.h b/include/general/tinstant.h similarity index 100% rename from include/tinstant.h rename to include/general/tinstant.h diff --git a/include/tinstantset.h b/include/general/tinstantset.h similarity index 100% rename from include/tinstantset.h rename to include/general/tinstantset.h diff --git a/include/tnumber_distance.h b/include/general/tnumber_distance.h similarity index 100% rename from include/tnumber_distance.h rename to include/general/tnumber_distance.h diff --git a/include/tnumber_gist.h b/include/general/tnumber_gist.h similarity index 100% rename from include/tnumber_gist.h rename to include/general/tnumber_gist.h diff --git a/include/tnumber_mathfuncs.h b/include/general/tnumber_mathfuncs.h similarity index 100% rename from include/tnumber_mathfuncs.h rename to include/general/tnumber_mathfuncs.h diff --git a/include/tnumber_selfuncs.h b/include/general/tnumber_selfuncs.h similarity index 100% rename from include/tnumber_selfuncs.h rename to include/general/tnumber_selfuncs.h diff --git a/include/tnumber_spgist.h b/include/general/tnumber_spgist.h similarity index 100% rename from include/tnumber_spgist.h rename to include/general/tnumber_spgist.h diff --git a/include/tsequence.h b/include/general/tsequence.h similarity index 100% rename from include/tsequence.h rename to include/general/tsequence.h diff --git a/include/tsequenceset.h b/include/general/tsequenceset.h similarity index 100% rename from include/tsequenceset.h rename to include/general/tsequenceset.h diff --git a/include/ttext_textfuncs.h b/include/general/ttext_textfuncs.h similarity index 100% rename from include/ttext_textfuncs.h rename to include/general/ttext_textfuncs.h From 2d7a52d72fdf92debfc11657f455527ee6c5e52c Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:10:10 -0500 Subject: [PATCH 02/22] [src] dos2unix applied to file and adjusted to include locations --- point/src/tpoint_tile.c | 1256 +++++++++++++++++++-------------------- 1 file changed, 628 insertions(+), 628 deletions(-) diff --git a/point/src/tpoint_tile.c b/point/src/tpoint_tile.c index 3f343bd7a9..3ac765eb5f 100644 --- a/point/src/tpoint_tile.c +++ b/point/src/tpoint_tile.c @@ -1,628 +1,628 @@ -/***************************************************************************** - * - * This MobilityDB code is provided under The PostgreSQL License. - * - * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB - * contributors - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without a written - * agreement is hereby granted, provided that the above copyright notice and - * this paragraph and the following two paragraphs appear in all copies. - * - * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING - * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, - * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON - * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  - * - *****************************************************************************/ - -/** - * @file tpoint_tile.c - * Functions for spatial and spatiotemporal tiles. - */ - -#include -#include -#include -#if POSTGRESQL_VERSION_NUMBER < 120000 -#include -#endif -#include - -#include "tpoint_tile.h" -#include "period.h" -#include "timeops.h" -#include "temporal.h" -#include "temporal_util.h" -#include "temporal_tile.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" - -/***************************************************************************** - * Grid functions - *****************************************************************************/ - -/** - * Generate a tile from the current state of the multidimensional grid - * - * @param[in] x,y,z,t Lower coordinates of the tile to output - * @param[in] size Spatial size of the tiles - * @param[in] tunits Temporal size of the tiles in PostgreSQL time units - * @param[in] hasz Whether the tile has Z dimension - * @param[in] hast Whether the tile has T dimension - * @param[in] srid SRID of the spatial coordinates - * - */ -STBOX * -stbox_tile_get(double x, double y, double z, TimestampTz t, double size, - int64 tunits, bool hasz, bool hast, int32 srid) -{ - double xmin = x; - double xmax = xmin + size; - double ymin = y; - double ymax = ymin + size; - double zmin = 0, zmax = 0; - TimestampTz tmin = 0, tmax = 0; - if (hasz) - { - zmin = z; - zmax = zmin + size; - } - if (hast) - { - tmin = t; - tmax = tmin + tunits; - } - return stbox_make(true, hasz, hast, false, srid, xmin, xmax, ymin, ymax, - zmin, zmax, tmin, tmax); -} - -/** - * Create the initial state that persists across multiple calls of the function - * - * @param[in] temp Temporal point to split - * @param[in] box Bounds for generating the multidimensional grid - * @param[in] size Spatial size of the tiles - * @param[in] tunits Temporal size of the tiles in PostgreSQL time units - * @param[in] sorigin Spatial origin of the tiles - * @param[in] torigin Time origin of the tiles - * - * @pre The xsize argument must be greater to 0. - * @note The tunits argument may be equal to 0 if it was not provided by the - * user. In that case only the spatial dimension is tiled. - */ -static STboxGridState * -stbox_tile_state_make(Temporal *temp, STBOX *box, double size, int64 tunits, - POINT3DZ sorigin, TimestampTz torigin) -{ - assert(size > 0); - /* palloc0 to initialize the missing dimensions to 0 */ - STboxGridState *state = palloc0(sizeof(STboxGridState)); - /* fill in state */ - state->done = false; - state->i = 1; - state->size = size; - state->tunits = tunits; - state->box.xmin = float_bucket_internal(box->xmin, size, sorigin.x); - state->box.xmax = float_bucket_internal(box->xmax, size, sorigin.x); - state->box.ymin = float_bucket_internal(box->ymin, size, sorigin.y); - state->box.ymax = float_bucket_internal(box->ymax, size, sorigin.y); - state->box.zmin = float_bucket_internal(box->zmin, size, sorigin.z); - state->box.zmax = float_bucket_internal(box->zmax, size, sorigin.z); - state->box.tmin = timestamptz_bucket_internal(box->tmin, size, torigin); - state->box.tmax = timestamptz_bucket_internal(box->tmax, size, torigin); - state->box.srid = box->srid; - state->box.flags = box->flags; - MOBDB_FLAGS_SET_T(state->box.flags, MOBDB_FLAGS_GET_T(box->flags) && tunits > 0); - state->x = state->box.xmin; - state->y = state->box.ymin; - state->z = state->box.zmin; - state->t = state->box.tmin; - state->temp = temp; - return state; -} - -/** - * Increment the current state to the next tile of the multidimensional grid - * - * @param[in] state State to increment - */ -void -stbox_tile_state_next(STboxGridState *state) -{ - if (!state || state->done) - return; - /* Move to the next cell. We need to to take into account whether - * hasz and/or hast and thus there are 4 possible cases */ - state->i++; - state->x += state->size; - if (state->x > state->box.xmax) - { - state->x = state->box.xmin; - state->y += state->size; - if (state->y > state->box.ymax) - { - if (MOBDB_FLAGS_GET_Z(state->box.flags)) - { - /* has Z */ - state->x = state->box.xmin; - state->y = state->box.ymin; - state->z += state->size; - if (state->z > state->box.zmax) - { - if (MOBDB_FLAGS_GET_T(state->box.flags)) - { - /* has Z and has T */ - state->x = state->box.xmin; - state->y = state->box.ymin; - state->z = state->box.zmin; - state->t += state->tunits; - if (state->t > state->box.tmax) - { - state->done = true; - return; - } - } - else - { - /* has Z and does not have T */ - state->done = true; - return; - } - } - } - else - { - if (MOBDB_FLAGS_GET_T(state->box.flags)) - { - /* does not have Z and has T */ - state->x = state->box.xmin; - state->y = state->box.ymin; - state->t += state->tunits; - if (state->t > state->box.tmax) - { - state->done = true; - return; - } - } - else - { - /* does not have Z and does have T */ - state->done = true; - return; - } - } - } - } - return; -} - -PG_FUNCTION_INFO_V1(stbox_multidim_grid); -/** - * Generate a multidimensional grid for temporal points. - */ -Datum stbox_multidim_grid(PG_FUNCTION_ARGS) -{ - FuncCallContext *funcctx; - STboxGridState *state; - bool isnull[2] = {0,0}; /* needed to say no value is null */ - Datum tuple_arr[2]; /* used to construct the composite return value */ - HeapTuple tuple; - Datum result; /* the actual composite return value */ - - if (SRF_IS_FIRSTCALL()) - { - /* Get input parameters */ - STBOX *bounds = PG_GETARG_STBOX_P(0); - ensure_not_geodetic_stbox(bounds); - ensure_has_X_stbox(bounds); - double size = PG_GETARG_FLOAT8(1); - ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); - GSERIALIZED *sorigin; - int64 tunits = 0; /* make compiler quiet */ - TimestampTz torigin = 0; /* make compiler quiet */ - if (PG_NARGS() == 3) - sorigin = PG_GETARG_GSERIALIZED_P(2); - else /* PG_NARGS() == 5 */ - { - /* If time arguments are given */ - ensure_has_T_stbox(bounds); - Interval *duration = PG_GETARG_INTERVAL_P(2); - ensure_valid_duration(duration); - tunits = get_interval_units(duration); - sorigin = PG_GETARG_GSERIALIZED_P(3); - torigin = PG_GETARG_TIMESTAMPTZ(4); - } - ensure_non_empty(sorigin); - ensure_point_type(sorigin); - /* Since we pass by default Point(0 0 0) as origin independently of the input - * STBOX, we test the same spatial dimensionality only for STBOX Z */ - if (MOBDB_FLAGS_GET_Z(bounds->flags)) - ensure_same_spatial_dimensionality_stbox_gs(bounds, sorigin); - int32 srid = bounds->srid; - int32 gs_srid = gserialized_get_srid(sorigin); - if (gs_srid != SRID_UNKNOWN) - error_if_srid_mismatch(srid, gs_srid); - POINT3DZ pt; - if (FLAGS_GET_Z(sorigin->flags)) - pt = datum_get_point3dz(PointerGetDatum(sorigin)); - else - { - /* Initialize to 0 the Z dimension if it is missing */ - memset(&pt, 0, sizeof(POINT3DZ)); - const POINT2D *p2d = gs_get_point2d_p(sorigin); - pt.x = p2d->x; - pt.y = p2d->y; - } - - /* Initialize the FuncCallContext */ - funcctx = SRF_FIRSTCALL_INIT(); - /* Switch to memory context appropriate for multiple function calls */ - MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); - /* Create function state */ - funcctx->user_fctx = stbox_tile_state_make(NULL, bounds, size, tunits, pt, - torigin); - /* Build a tuple description for a multidim_grid tuple */ - get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); - BlessTupleDesc(funcctx->tuple_desc); - MemoryContextSwitchTo(oldcontext); - } - - /* Stuff done on every call of the function */ - funcctx = SRF_PERCALL_SETUP(); - /* Get state */ - state = funcctx->user_fctx; - /* Stop when we've used up all the grid tiles */ - if (state->done) - SRF_RETURN_DONE(funcctx); - - /* Store index */ - tuple_arr[0] = Int32GetDatum(state->i); - /* Generate box */ - tuple_arr[1] = PointerGetDatum(stbox_tile_get(state->x, state->y, state->z, - state->t, state->size, state->tunits, MOBDB_FLAGS_GET_Z(state->box.flags), - MOBDB_FLAGS_GET_T(state->box.flags), state->box.srid)); - /* Advance state */ - stbox_tile_state_next(state); - /* Form tuple and return */ - tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); - result = HeapTupleGetDatum(tuple); - SRF_RETURN_NEXT(funcctx, result); -} - -PG_FUNCTION_INFO_V1(stbox_multidim_tile); -/** - * Generate a tile in a multidimensional grid for temporal points. -*/ -Datum stbox_multidim_tile(PG_FUNCTION_ARGS) -{ - GSERIALIZED *point = PG_GETARG_GSERIALIZED_P(0); - ensure_non_empty(point); - ensure_point_type(point); - TimestampTz t; - double size; - int64 tunits = 0; /* make compiler quiet */ - GSERIALIZED *sorigin; - TimestampTz torigin; - bool hast = false; - if (PG_NARGS() == 3) - { - size = PG_GETARG_FLOAT8(1); - ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); - sorigin = PG_GETARG_GSERIALIZED_P(2); - } - else /* PG_NARGS() == 6 */ - { - /* If time arguments are given */ - t = PG_GETARG_TIMESTAMPTZ(1); - size = PG_GETARG_FLOAT8(2); - ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); - Interval *duration = PG_GETARG_INTERVAL_P(3); - ensure_valid_duration(duration); - tunits = get_interval_units(duration); - sorigin = PG_GETARG_GSERIALIZED_P(4); - torigin = PG_GETARG_TIMESTAMPTZ(5); - hast = true; - } - ensure_non_empty(sorigin); - ensure_point_type(sorigin); - int32 srid = gserialized_get_srid(point); - int32 gs_srid = gserialized_get_srid(sorigin); - if (gs_srid != SRID_UNKNOWN) - ensure_same_srid_gs(point, sorigin); - POINT3DZ pt, ptorig; - bool hasz = FLAGS_GET_Z(point->flags); - if (hasz) - { - ensure_has_Z_gs(sorigin); - pt = datum_get_point3dz(PointerGetDatum(point)); - ptorig = datum_get_point3dz(PointerGetDatum(sorigin)); - } - else - { - /* Initialize to 0 the Z dimension if it is missing */ - memset(&pt, 0, sizeof(POINT3DZ)); - const POINT2D *p1 = gs_get_point2d_p(sorigin); - pt.x = p1->x; - pt.y = p1->y; - memset(&ptorig, 0, sizeof(POINT3DZ)); - const POINT2D *p2 = gs_get_point2d_p(sorigin); - ptorig.x = p2->x; - ptorig.y = p2->y; - } - double xmin = float_bucket_internal(pt.x, size, ptorig.x); - double ymin = float_bucket_internal(pt.y, size, ptorig.y); - double zmin = float_bucket_internal(pt.z, size, ptorig.z); - TimestampTz tmin = 0; /* make compiler quiet */ - if (hast) - tmin = timestamptz_bucket_internal(t, tunits, torigin); - STBOX *result = stbox_tile_get(xmin, ymin, zmin, tmin, size, tunits, hasz, - hast, srid); - PG_RETURN_POINTER(result); -} - -/***************************************************************************** - * Split functions - *****************************************************************************/ - -static Datum -stbox_upper_bound(const STBOX *box) -{ - /* Compute the 2D upper bound of the box */ - LWGEOM *points[3]; - /* Top left */ - points[0] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmin, box->ymax); - /* Top right */ - points[1] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmax, box->ymax); - /* Bottom left */ - points[2] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmax, box->ymin); - FLAGS_SET_GEODETIC(points[0]->flags, false); - FLAGS_SET_GEODETIC(points[1]->flags, false); - FLAGS_SET_GEODETIC(points[2]->flags, false); - LWGEOM *lwgeom = (LWGEOM *) lwline_from_lwgeom_array(box->srid, 3, points); - FLAGS_SET_Z(lwgeom->flags, false); - FLAGS_SET_GEODETIC(lwgeom->flags, false); - Datum result = PointerGetDatum(geo_serialize(lwgeom)); - lwgeom_free(lwgeom); - return result; -} - -PG_FUNCTION_INFO_V1(tpoint_space_split); -/** - * Split a temporal number with respect to space tiles. - */ -Datum tpoint_space_split(PG_FUNCTION_ARGS) -{ - FuncCallContext *funcctx; - STboxGridState *state; - bool isnull[2] = {0,0}; /* needed to say no value is null */ - Datum tuple_arr[2]; /* used to construct the composite return value */ - HeapTuple tuple; - Datum result; /* the actual composite return value */ - - /* If the function is being called for the first time */ - if (SRF_IS_FIRSTCALL()) - { - /* Initialize the FuncCallContext */ - funcctx = SRF_FIRSTCALL_INIT(); - /* Switch to memory context appropriate for multiple function calls */ - MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); - - /* Get input parameters */ - Temporal *temp = PG_GETARG_TEMPORAL(0); - double size = PG_GETARG_FLOAT8(1); - GSERIALIZED *sorigin = PG_GETARG_GSERIALIZED_P(2); - - /* Ensure parameter validity */ - ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); - ensure_non_empty(sorigin); - ensure_point_type(sorigin); - ensure_same_geodetic(temp->flags, sorigin->flags); - STBOX bounds; - memset(&bounds, 0, sizeof(STBOX)); - temporal_bbox(&bounds, temp); - int32 srid = bounds.srid; - int32 gs_srid = gserialized_get_srid(sorigin); - if (gs_srid != SRID_UNKNOWN) - error_if_srid_mismatch(srid, gs_srid); - /* Disallow T dimension for generating a spatial only grid */ - MOBDB_FLAGS_SET_T(bounds.flags, false); - POINT3DZ pt; - if (FLAGS_GET_Z(sorigin->flags)) - pt = datum_get_point3dz(PointerGetDatum(sorigin)); - else - { - /* Initialize to 0 the Z dimension if it is missing */ - memset(&pt, 0, sizeof(POINT3DZ)); - const POINT2D *p2d = gs_get_point2d_p(sorigin); - pt.x = p2d->x; - pt.y = p2d->y; - } - - /* Create function state */ - funcctx->user_fctx = stbox_tile_state_make(temp, &bounds, size, 0, - pt, 0); - /* Build a tuple description for a multidimensional grid tuple */ - get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); - BlessTupleDesc(funcctx->tuple_desc); - MemoryContextSwitchTo(oldcontext); - } - - /* Stuff done on every call of the function */ - funcctx = SRF_PERCALL_SETUP(); - /* Get state */ - state = funcctx->user_fctx; - /* We need to loop since atStbox may be NULL */ - while (true) - { - /* Stop when we've used up all the grid squares */ - if (state->done) - SRF_RETURN_DONE(funcctx); - - /* Generate the tile - * We must generate a 2D/3D geometry for keeping the bounds and after we - * set the box to 2D so that we can project a 3D point to a 2D geometry */ - bool hasz = MOBDB_FLAGS_GET_Z(state->temp->flags); - STBOX *box = stbox_tile_get(state->x, state->y, state->z, state->t, - state->size, state->tunits, hasz, false, state->box.srid); - /* Advance state */ - stbox_tile_state_next(state); - /* Restrict the temporal point to the box projected to 2D */ - MOBDB_FLAGS_SET_Z(box->flags, false); - Temporal *atstbox = tpoint_at_stbox_internal(state->temp, box); - if (atstbox == NULL) - continue; - if (hasz) - { - /* Filter the boxes that do not intersect in 3D with the restriction */ - STBOX box1; - memset(&box1, 0, sizeof(STBOX)); - temporal_bbox(&box1, atstbox); - if (box->zmin > box1.zmin || box1.zmin >= box->zmax) - { - pfree(atstbox); - continue; - } - } - Datum upper_bound = stbox_upper_bound(box); - Temporal *minus_upper = tpoint_restrict_geometry_internal(atstbox, - upper_bound, REST_MINUS); - pfree(DatumGetPointer(upper_bound)); - if (minus_upper != NULL) - { - /* Form tuple and return */ - tuple_arr[0] = point_make(box->xmin, box->ymin, box->zmin, - MOBDB_FLAGS_GET_Z(state->temp->flags), false, box->srid); - tuple_arr[1] = PointerGetDatum(minus_upper); - tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); - result = HeapTupleGetDatum(tuple); - SRF_RETURN_NEXT(funcctx, result); - } - } -} - -/*****************************************************************************/ - -PG_FUNCTION_INFO_V1(tpoint_space_time_split); -/** - * Split a temporal number with respect to value buckets. - */ -Datum tpoint_space_time_split(PG_FUNCTION_ARGS) -{ - FuncCallContext *funcctx; - STboxGridState *state; - bool isnull[3] = {0,0,0}; /* needed to say no value is null */ - Datum tuple_arr[3]; /* used to construct the composite return value */ - HeapTuple tuple; - Datum result; /* the actual composite return value */ - - /* If the function is being called for the first time */ - if (SRF_IS_FIRSTCALL()) - { - /* Initialize the FuncCallContext */ - funcctx = SRF_FIRSTCALL_INIT(); - /* Switch to memory context appropriate for multiple function calls */ - MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); - - /* Get input parameters */ - Temporal *temp = PG_GETARG_TEMPORAL(0); - double size = PG_GETARG_FLOAT8(1); - Interval *duration = PG_GETARG_INTERVAL_P(2); - GSERIALIZED *sorigin = PG_GETARG_GSERIALIZED_P(3); - TimestampTz torigin = PG_GETARG_TIMESTAMPTZ(4); - - /* Ensure parameter validity */ - ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); - ensure_valid_duration(duration); - int64 tunits = get_interval_units(duration); - ensure_non_empty(sorigin); - ensure_point_type(sorigin); - ensure_same_geodetic(temp->flags, sorigin->flags); - STBOX bounds; - memset(&bounds, 0, sizeof(STBOX)); - temporal_bbox(&bounds, temp); - int32 srid = bounds.srid; - int32 gs_srid = gserialized_get_srid(sorigin); - if (gs_srid != SRID_UNKNOWN) - error_if_srid_mismatch(srid, gs_srid); - POINT3DZ pt; - if (FLAGS_GET_Z(sorigin->flags)) - pt = datum_get_point3dz(PointerGetDatum(sorigin)); - else - { - /* Initialize to 0 the Z dimension if it is missing */ - memset(&pt, 0, sizeof(POINT3DZ)); - const POINT2D *p2d = gs_get_point2d_p(sorigin); - pt.x = p2d->x; - pt.y = p2d->y; - } - - /* Create function state */ - funcctx->user_fctx = stbox_tile_state_make(temp, &bounds, size, tunits, - pt, torigin); - /* Build a tuple description for a multidimensional grid tuple */ - get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); - BlessTupleDesc(funcctx->tuple_desc); - MemoryContextSwitchTo(oldcontext); - } - - /* Stuff done on every call of the function */ - funcctx = SRF_PERCALL_SETUP(); - /* Get state */ - state = funcctx->user_fctx; - /* We need to loop since atRange may be NULL */ - while (true) - { - /* Stop when we've used up all the grid squares */ - if (state->done) - SRF_RETURN_DONE(funcctx); - - /* Generate the tile - * We must generate a 2D/3D geometry for keeping the bounds and after we - * set the box to 2D so that we can project a 3D point to a 2D geometry */ - bool hasz = MOBDB_FLAGS_GET_Z(state->temp->flags); - STBOX *box = stbox_tile_get(state->x, state->y, state->z, state->t, - state->size, state->tunits, hasz, true, state->box.srid); - /* Advance state */ - stbox_tile_state_next(state); - /* Restrict the temporal point to the box projected to 2D */ - MOBDB_FLAGS_SET_Z(box->flags, false); - Temporal *atstbox = tpoint_at_stbox_internal(state->temp, box); - if (atstbox == NULL) - continue; - if (hasz) - { - /* Filter the boxes that do not intersect in 3D with the restriction */ - STBOX box1; - memset(&box1, 0, sizeof(STBOX)); - temporal_bbox(&box1, atstbox); - if (box1.zmin >= box->zmax || box->zmin >= box1.zmax) - continue; - } - Datum upper_bound = stbox_upper_bound(box); - Temporal *minus_upper = tpoint_restrict_geometry_internal(atstbox, - upper_bound, REST_MINUS); - pfree(DatumGetPointer(upper_bound)); - if (minus_upper != NULL) - { - /* Form tuple and return */ - tuple_arr[0] = point_make(box->xmin, box->ymin, box->zmin, - hasz, false, box->srid); - tuple_arr[1] = TimestampTzGetDatum(box->tmin); - tuple_arr[2] = PointerGetDatum(minus_upper); - tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); - result = HeapTupleGetDatum(tuple); - SRF_RETURN_NEXT(funcctx, result); - } - } -} - -/*****************************************************************************/ +/***************************************************************************** + * + * This MobilityDB code is provided under The PostgreSQL License. + * + * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB + * contributors + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without a written + * agreement is hereby granted, provided that the above copyright notice and + * this paragraph and the following two paragraphs appear in all copies. + * + * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING + * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, + * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON + * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  + * + *****************************************************************************/ + +/** + * @file tpoint_tile.c + * Functions for spatial and spatiotemporal tiles. + */ + +#include +#include +#include +#if POSTGRESQL_VERSION_NUMBER < 120000 +#include +#endif +#include + +#include "tpoint_tile.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporal.h" +#include "general/temporal_util.h" +#include "general/temporal_tile.h" +#include "tpoint.h" +#include "tpoint_spatialfuncs.h" + +/***************************************************************************** + * Grid functions + *****************************************************************************/ + +/** + * Generate a tile from the current state of the multidimensional grid + * + * @param[in] x,y,z,t Lower coordinates of the tile to output + * @param[in] size Spatial size of the tiles + * @param[in] tunits Temporal size of the tiles in PostgreSQL time units + * @param[in] hasz Whether the tile has Z dimension + * @param[in] hast Whether the tile has T dimension + * @param[in] srid SRID of the spatial coordinates + * + */ +STBOX * +stbox_tile_get(double x, double y, double z, TimestampTz t, double size, + int64 tunits, bool hasz, bool hast, int32 srid) +{ + double xmin = x; + double xmax = xmin + size; + double ymin = y; + double ymax = ymin + size; + double zmin = 0, zmax = 0; + TimestampTz tmin = 0, tmax = 0; + if (hasz) + { + zmin = z; + zmax = zmin + size; + } + if (hast) + { + tmin = t; + tmax = tmin + tunits; + } + return stbox_make(true, hasz, hast, false, srid, xmin, xmax, ymin, ymax, + zmin, zmax, tmin, tmax); +} + +/** + * Create the initial state that persists across multiple calls of the function + * + * @param[in] temp Temporal point to split + * @param[in] box Bounds for generating the multidimensional grid + * @param[in] size Spatial size of the tiles + * @param[in] tunits Temporal size of the tiles in PostgreSQL time units + * @param[in] sorigin Spatial origin of the tiles + * @param[in] torigin Time origin of the tiles + * + * @pre The xsize argument must be greater to 0. + * @note The tunits argument may be equal to 0 if it was not provided by the + * user. In that case only the spatial dimension is tiled. + */ +static STboxGridState * +stbox_tile_state_make(Temporal *temp, STBOX *box, double size, int64 tunits, + POINT3DZ sorigin, TimestampTz torigin) +{ + assert(size > 0); + /* palloc0 to initialize the missing dimensions to 0 */ + STboxGridState *state = palloc0(sizeof(STboxGridState)); + /* fill in state */ + state->done = false; + state->i = 1; + state->size = size; + state->tunits = tunits; + state->box.xmin = float_bucket_internal(box->xmin, size, sorigin.x); + state->box.xmax = float_bucket_internal(box->xmax, size, sorigin.x); + state->box.ymin = float_bucket_internal(box->ymin, size, sorigin.y); + state->box.ymax = float_bucket_internal(box->ymax, size, sorigin.y); + state->box.zmin = float_bucket_internal(box->zmin, size, sorigin.z); + state->box.zmax = float_bucket_internal(box->zmax, size, sorigin.z); + state->box.tmin = timestamptz_bucket_internal(box->tmin, size, torigin); + state->box.tmax = timestamptz_bucket_internal(box->tmax, size, torigin); + state->box.srid = box->srid; + state->box.flags = box->flags; + MOBDB_FLAGS_SET_T(state->box.flags, MOBDB_FLAGS_GET_T(box->flags) && tunits > 0); + state->x = state->box.xmin; + state->y = state->box.ymin; + state->z = state->box.zmin; + state->t = state->box.tmin; + state->temp = temp; + return state; +} + +/** + * Increment the current state to the next tile of the multidimensional grid + * + * @param[in] state State to increment + */ +void +stbox_tile_state_next(STboxGridState *state) +{ + if (!state || state->done) + return; + /* Move to the next cell. We need to to take into account whether + * hasz and/or hast and thus there are 4 possible cases */ + state->i++; + state->x += state->size; + if (state->x > state->box.xmax) + { + state->x = state->box.xmin; + state->y += state->size; + if (state->y > state->box.ymax) + { + if (MOBDB_FLAGS_GET_Z(state->box.flags)) + { + /* has Z */ + state->x = state->box.xmin; + state->y = state->box.ymin; + state->z += state->size; + if (state->z > state->box.zmax) + { + if (MOBDB_FLAGS_GET_T(state->box.flags)) + { + /* has Z and has T */ + state->x = state->box.xmin; + state->y = state->box.ymin; + state->z = state->box.zmin; + state->t += state->tunits; + if (state->t > state->box.tmax) + { + state->done = true; + return; + } + } + else + { + /* has Z and does not have T */ + state->done = true; + return; + } + } + } + else + { + if (MOBDB_FLAGS_GET_T(state->box.flags)) + { + /* does not have Z and has T */ + state->x = state->box.xmin; + state->y = state->box.ymin; + state->t += state->tunits; + if (state->t > state->box.tmax) + { + state->done = true; + return; + } + } + else + { + /* does not have Z and does have T */ + state->done = true; + return; + } + } + } + } + return; +} + +PG_FUNCTION_INFO_V1(stbox_multidim_grid); +/** + * Generate a multidimensional grid for temporal points. + */ +Datum stbox_multidim_grid(PG_FUNCTION_ARGS) +{ + FuncCallContext *funcctx; + STboxGridState *state; + bool isnull[2] = {0,0}; /* needed to say no value is null */ + Datum tuple_arr[2]; /* used to construct the composite return value */ + HeapTuple tuple; + Datum result; /* the actual composite return value */ + + if (SRF_IS_FIRSTCALL()) + { + /* Get input parameters */ + STBOX *bounds = PG_GETARG_STBOX_P(0); + ensure_not_geodetic_stbox(bounds); + ensure_has_X_stbox(bounds); + double size = PG_GETARG_FLOAT8(1); + ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); + GSERIALIZED *sorigin; + int64 tunits = 0; /* make compiler quiet */ + TimestampTz torigin = 0; /* make compiler quiet */ + if (PG_NARGS() == 3) + sorigin = PG_GETARG_GSERIALIZED_P(2); + else /* PG_NARGS() == 5 */ + { + /* If time arguments are given */ + ensure_has_T_stbox(bounds); + Interval *duration = PG_GETARG_INTERVAL_P(2); + ensure_valid_duration(duration); + tunits = get_interval_units(duration); + sorigin = PG_GETARG_GSERIALIZED_P(3); + torigin = PG_GETARG_TIMESTAMPTZ(4); + } + ensure_non_empty(sorigin); + ensure_point_type(sorigin); + /* Since we pass by default Point(0 0 0) as origin independently of the input + * STBOX, we test the same spatial dimensionality only for STBOX Z */ + if (MOBDB_FLAGS_GET_Z(bounds->flags)) + ensure_same_spatial_dimensionality_stbox_gs(bounds, sorigin); + int32 srid = bounds->srid; + int32 gs_srid = gserialized_get_srid(sorigin); + if (gs_srid != SRID_UNKNOWN) + error_if_srid_mismatch(srid, gs_srid); + POINT3DZ pt; + if (FLAGS_GET_Z(sorigin->flags)) + pt = datum_get_point3dz(PointerGetDatum(sorigin)); + else + { + /* Initialize to 0 the Z dimension if it is missing */ + memset(&pt, 0, sizeof(POINT3DZ)); + const POINT2D *p2d = gs_get_point2d_p(sorigin); + pt.x = p2d->x; + pt.y = p2d->y; + } + + /* Initialize the FuncCallContext */ + funcctx = SRF_FIRSTCALL_INIT(); + /* Switch to memory context appropriate for multiple function calls */ + MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); + /* Create function state */ + funcctx->user_fctx = stbox_tile_state_make(NULL, bounds, size, tunits, pt, + torigin); + /* Build a tuple description for a multidim_grid tuple */ + get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); + BlessTupleDesc(funcctx->tuple_desc); + MemoryContextSwitchTo(oldcontext); + } + + /* Stuff done on every call of the function */ + funcctx = SRF_PERCALL_SETUP(); + /* Get state */ + state = funcctx->user_fctx; + /* Stop when we've used up all the grid tiles */ + if (state->done) + SRF_RETURN_DONE(funcctx); + + /* Store index */ + tuple_arr[0] = Int32GetDatum(state->i); + /* Generate box */ + tuple_arr[1] = PointerGetDatum(stbox_tile_get(state->x, state->y, state->z, + state->t, state->size, state->tunits, MOBDB_FLAGS_GET_Z(state->box.flags), + MOBDB_FLAGS_GET_T(state->box.flags), state->box.srid)); + /* Advance state */ + stbox_tile_state_next(state); + /* Form tuple and return */ + tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); + result = HeapTupleGetDatum(tuple); + SRF_RETURN_NEXT(funcctx, result); +} + +PG_FUNCTION_INFO_V1(stbox_multidim_tile); +/** + * Generate a tile in a multidimensional grid for temporal points. +*/ +Datum stbox_multidim_tile(PG_FUNCTION_ARGS) +{ + GSERIALIZED *point = PG_GETARG_GSERIALIZED_P(0); + ensure_non_empty(point); + ensure_point_type(point); + TimestampTz t; + double size; + int64 tunits = 0; /* make compiler quiet */ + GSERIALIZED *sorigin; + TimestampTz torigin; + bool hast = false; + if (PG_NARGS() == 3) + { + size = PG_GETARG_FLOAT8(1); + ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); + sorigin = PG_GETARG_GSERIALIZED_P(2); + } + else /* PG_NARGS() == 6 */ + { + /* If time arguments are given */ + t = PG_GETARG_TIMESTAMPTZ(1); + size = PG_GETARG_FLOAT8(2); + ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); + Interval *duration = PG_GETARG_INTERVAL_P(3); + ensure_valid_duration(duration); + tunits = get_interval_units(duration); + sorigin = PG_GETARG_GSERIALIZED_P(4); + torigin = PG_GETARG_TIMESTAMPTZ(5); + hast = true; + } + ensure_non_empty(sorigin); + ensure_point_type(sorigin); + int32 srid = gserialized_get_srid(point); + int32 gs_srid = gserialized_get_srid(sorigin); + if (gs_srid != SRID_UNKNOWN) + ensure_same_srid_gs(point, sorigin); + POINT3DZ pt, ptorig; + bool hasz = FLAGS_GET_Z(point->flags); + if (hasz) + { + ensure_has_Z_gs(sorigin); + pt = datum_get_point3dz(PointerGetDatum(point)); + ptorig = datum_get_point3dz(PointerGetDatum(sorigin)); + } + else + { + /* Initialize to 0 the Z dimension if it is missing */ + memset(&pt, 0, sizeof(POINT3DZ)); + const POINT2D *p1 = gs_get_point2d_p(sorigin); + pt.x = p1->x; + pt.y = p1->y; + memset(&ptorig, 0, sizeof(POINT3DZ)); + const POINT2D *p2 = gs_get_point2d_p(sorigin); + ptorig.x = p2->x; + ptorig.y = p2->y; + } + double xmin = float_bucket_internal(pt.x, size, ptorig.x); + double ymin = float_bucket_internal(pt.y, size, ptorig.y); + double zmin = float_bucket_internal(pt.z, size, ptorig.z); + TimestampTz tmin = 0; /* make compiler quiet */ + if (hast) + tmin = timestamptz_bucket_internal(t, tunits, torigin); + STBOX *result = stbox_tile_get(xmin, ymin, zmin, tmin, size, tunits, hasz, + hast, srid); + PG_RETURN_POINTER(result); +} + +/***************************************************************************** + * Split functions + *****************************************************************************/ + +static Datum +stbox_upper_bound(const STBOX *box) +{ + /* Compute the 2D upper bound of the box */ + LWGEOM *points[3]; + /* Top left */ + points[0] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmin, box->ymax); + /* Top right */ + points[1] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmax, box->ymax); + /* Bottom left */ + points[2] = (LWGEOM *) lwpoint_make2d(box->srid, box->xmax, box->ymin); + FLAGS_SET_GEODETIC(points[0]->flags, false); + FLAGS_SET_GEODETIC(points[1]->flags, false); + FLAGS_SET_GEODETIC(points[2]->flags, false); + LWGEOM *lwgeom = (LWGEOM *) lwline_from_lwgeom_array(box->srid, 3, points); + FLAGS_SET_Z(lwgeom->flags, false); + FLAGS_SET_GEODETIC(lwgeom->flags, false); + Datum result = PointerGetDatum(geo_serialize(lwgeom)); + lwgeom_free(lwgeom); + return result; +} + +PG_FUNCTION_INFO_V1(tpoint_space_split); +/** + * Split a temporal number with respect to space tiles. + */ +Datum tpoint_space_split(PG_FUNCTION_ARGS) +{ + FuncCallContext *funcctx; + STboxGridState *state; + bool isnull[2] = {0,0}; /* needed to say no value is null */ + Datum tuple_arr[2]; /* used to construct the composite return value */ + HeapTuple tuple; + Datum result; /* the actual composite return value */ + + /* If the function is being called for the first time */ + if (SRF_IS_FIRSTCALL()) + { + /* Initialize the FuncCallContext */ + funcctx = SRF_FIRSTCALL_INIT(); + /* Switch to memory context appropriate for multiple function calls */ + MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); + + /* Get input parameters */ + Temporal *temp = PG_GETARG_TEMPORAL(0); + double size = PG_GETARG_FLOAT8(1); + GSERIALIZED *sorigin = PG_GETARG_GSERIALIZED_P(2); + + /* Ensure parameter validity */ + ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); + ensure_non_empty(sorigin); + ensure_point_type(sorigin); + ensure_same_geodetic(temp->flags, sorigin->flags); + STBOX bounds; + memset(&bounds, 0, sizeof(STBOX)); + temporal_bbox(&bounds, temp); + int32 srid = bounds.srid; + int32 gs_srid = gserialized_get_srid(sorigin); + if (gs_srid != SRID_UNKNOWN) + error_if_srid_mismatch(srid, gs_srid); + /* Disallow T dimension for generating a spatial only grid */ + MOBDB_FLAGS_SET_T(bounds.flags, false); + POINT3DZ pt; + if (FLAGS_GET_Z(sorigin->flags)) + pt = datum_get_point3dz(PointerGetDatum(sorigin)); + else + { + /* Initialize to 0 the Z dimension if it is missing */ + memset(&pt, 0, sizeof(POINT3DZ)); + const POINT2D *p2d = gs_get_point2d_p(sorigin); + pt.x = p2d->x; + pt.y = p2d->y; + } + + /* Create function state */ + funcctx->user_fctx = stbox_tile_state_make(temp, &bounds, size, 0, + pt, 0); + /* Build a tuple description for a multidimensional grid tuple */ + get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); + BlessTupleDesc(funcctx->tuple_desc); + MemoryContextSwitchTo(oldcontext); + } + + /* Stuff done on every call of the function */ + funcctx = SRF_PERCALL_SETUP(); + /* Get state */ + state = funcctx->user_fctx; + /* We need to loop since atStbox may be NULL */ + while (true) + { + /* Stop when we've used up all the grid squares */ + if (state->done) + SRF_RETURN_DONE(funcctx); + + /* Generate the tile + * We must generate a 2D/3D geometry for keeping the bounds and after we + * set the box to 2D so that we can project a 3D point to a 2D geometry */ + bool hasz = MOBDB_FLAGS_GET_Z(state->temp->flags); + STBOX *box = stbox_tile_get(state->x, state->y, state->z, state->t, + state->size, state->tunits, hasz, false, state->box.srid); + /* Advance state */ + stbox_tile_state_next(state); + /* Restrict the temporal point to the box projected to 2D */ + MOBDB_FLAGS_SET_Z(box->flags, false); + Temporal *atstbox = tpoint_at_stbox_internal(state->temp, box); + if (atstbox == NULL) + continue; + if (hasz) + { + /* Filter the boxes that do not intersect in 3D with the restriction */ + STBOX box1; + memset(&box1, 0, sizeof(STBOX)); + temporal_bbox(&box1, atstbox); + if (box->zmin > box1.zmin || box1.zmin >= box->zmax) + { + pfree(atstbox); + continue; + } + } + Datum upper_bound = stbox_upper_bound(box); + Temporal *minus_upper = tpoint_restrict_geometry_internal(atstbox, + upper_bound, REST_MINUS); + pfree(DatumGetPointer(upper_bound)); + if (minus_upper != NULL) + { + /* Form tuple and return */ + tuple_arr[0] = point_make(box->xmin, box->ymin, box->zmin, + MOBDB_FLAGS_GET_Z(state->temp->flags), false, box->srid); + tuple_arr[1] = PointerGetDatum(minus_upper); + tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); + result = HeapTupleGetDatum(tuple); + SRF_RETURN_NEXT(funcctx, result); + } + } +} + +/*****************************************************************************/ + +PG_FUNCTION_INFO_V1(tpoint_space_time_split); +/** + * Split a temporal number with respect to value buckets. + */ +Datum tpoint_space_time_split(PG_FUNCTION_ARGS) +{ + FuncCallContext *funcctx; + STboxGridState *state; + bool isnull[3] = {0,0,0}; /* needed to say no value is null */ + Datum tuple_arr[3]; /* used to construct the composite return value */ + HeapTuple tuple; + Datum result; /* the actual composite return value */ + + /* If the function is being called for the first time */ + if (SRF_IS_FIRSTCALL()) + { + /* Initialize the FuncCallContext */ + funcctx = SRF_FIRSTCALL_INIT(); + /* Switch to memory context appropriate for multiple function calls */ + MemoryContext oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); + + /* Get input parameters */ + Temporal *temp = PG_GETARG_TEMPORAL(0); + double size = PG_GETARG_FLOAT8(1); + Interval *duration = PG_GETARG_INTERVAL_P(2); + GSERIALIZED *sorigin = PG_GETARG_GSERIALIZED_P(3); + TimestampTz torigin = PG_GETARG_TIMESTAMPTZ(4); + + /* Ensure parameter validity */ + ensure_positive_datum(Float8GetDatum(size), FLOAT8OID); + ensure_valid_duration(duration); + int64 tunits = get_interval_units(duration); + ensure_non_empty(sorigin); + ensure_point_type(sorigin); + ensure_same_geodetic(temp->flags, sorigin->flags); + STBOX bounds; + memset(&bounds, 0, sizeof(STBOX)); + temporal_bbox(&bounds, temp); + int32 srid = bounds.srid; + int32 gs_srid = gserialized_get_srid(sorigin); + if (gs_srid != SRID_UNKNOWN) + error_if_srid_mismatch(srid, gs_srid); + POINT3DZ pt; + if (FLAGS_GET_Z(sorigin->flags)) + pt = datum_get_point3dz(PointerGetDatum(sorigin)); + else + { + /* Initialize to 0 the Z dimension if it is missing */ + memset(&pt, 0, sizeof(POINT3DZ)); + const POINT2D *p2d = gs_get_point2d_p(sorigin); + pt.x = p2d->x; + pt.y = p2d->y; + } + + /* Create function state */ + funcctx->user_fctx = stbox_tile_state_make(temp, &bounds, size, tunits, + pt, torigin); + /* Build a tuple description for a multidimensional grid tuple */ + get_call_result_type(fcinfo, 0, &funcctx->tuple_desc); + BlessTupleDesc(funcctx->tuple_desc); + MemoryContextSwitchTo(oldcontext); + } + + /* Stuff done on every call of the function */ + funcctx = SRF_PERCALL_SETUP(); + /* Get state */ + state = funcctx->user_fctx; + /* We need to loop since atRange may be NULL */ + while (true) + { + /* Stop when we've used up all the grid squares */ + if (state->done) + SRF_RETURN_DONE(funcctx); + + /* Generate the tile + * We must generate a 2D/3D geometry for keeping the bounds and after we + * set the box to 2D so that we can project a 3D point to a 2D geometry */ + bool hasz = MOBDB_FLAGS_GET_Z(state->temp->flags); + STBOX *box = stbox_tile_get(state->x, state->y, state->z, state->t, + state->size, state->tunits, hasz, true, state->box.srid); + /* Advance state */ + stbox_tile_state_next(state); + /* Restrict the temporal point to the box projected to 2D */ + MOBDB_FLAGS_SET_Z(box->flags, false); + Temporal *atstbox = tpoint_at_stbox_internal(state->temp, box); + if (atstbox == NULL) + continue; + if (hasz) + { + /* Filter the boxes that do not intersect in 3D with the restriction */ + STBOX box1; + memset(&box1, 0, sizeof(STBOX)); + temporal_bbox(&box1, atstbox); + if (box1.zmin >= box->zmax || box->zmin >= box1.zmax) + continue; + } + Datum upper_bound = stbox_upper_bound(box); + Temporal *minus_upper = tpoint_restrict_geometry_internal(atstbox, + upper_bound, REST_MINUS); + pfree(DatumGetPointer(upper_bound)); + if (minus_upper != NULL) + { + /* Form tuple and return */ + tuple_arr[0] = point_make(box->xmin, box->ymin, box->zmin, + hasz, false, box->srid); + tuple_arr[1] = TimestampTzGetDatum(box->tmin); + tuple_arr[2] = PointerGetDatum(minus_upper); + tuple = heap_form_tuple(funcctx->tuple_desc, tuple_arr, isnull); + result = HeapTupleGetDatum(tuple); + SRF_RETURN_NEXT(funcctx, result); + } + } +} + +/*****************************************************************************/ From 509cb6bf62f794f6f15e8df72c40d8cc1181867e Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:10:46 -0500 Subject: [PATCH 03/22] [src] adjusted to include location --- npoint/include/tnpoint.h | 2 +- npoint/include/tnpoint_boxops.h | 2 +- npoint/include/tnpoint_distance.h | 2 +- npoint/include/tnpoint_parser.h | 2 +- npoint/include/tnpoint_spatialfuncs.h | 2 +- npoint/src/tnpoint.c | 10 ++++----- npoint/src/tnpoint_aggfuncs.c | 2 +- npoint/src/tnpoint_analyze.c | 8 +++---- npoint/src/tnpoint_boxops.c | 4 ++-- npoint/src/tnpoint_distance.c | 6 +++--- npoint/src/tnpoint_parser.c | 4 ++-- npoint/src/tnpoint_spatialfuncs.c | 10 ++++----- npoint/src/tnpoint_spatialrels.c | 2 +- npoint/src/tnpoint_static.c | 8 +++---- npoint/src/tnpoint_tempspatialrels.c | 8 +++---- point/include/postgis.h | 2 +- point/include/stbox.h | 2 +- point/include/tpoint.h | 2 +- point/include/tpoint_aggfuncs.h | 4 ++-- point/include/tpoint_analytics.h | 2 +- point/include/tpoint_boxops.h | 4 ++-- point/include/tpoint_distance.h | 2 +- point/include/tpoint_gist.h | 2 +- point/include/tpoint_parser.h | 2 +- point/include/tpoint_posops.h | 2 +- point/include/tpoint_selfuncs.h | 2 +- point/include/tpoint_spatialfuncs.h | 2 +- point/include/tpoint_spatialrels.h | 2 +- point/include/tpoint_spgist.h | 2 +- point/include/tpoint_tempspatialrels.h | 2 +- point/include/tpoint_tile.h | 2 +- point/src/projection_gk.c | 6 +++--- point/src/stbox.c | 10 ++++----- point/src/tpoint.c | 10 ++++----- point/src/tpoint_aggfuncs.c | 12 +++++------ point/src/tpoint_analytics.c | 16 +++++++------- point/src/tpoint_analyze.c | 12 +++++------ point/src/tpoint_boxops.c | 10 ++++----- point/src/tpoint_datagen.c | 6 +++--- point/src/tpoint_distance.c | 6 +++--- point/src/tpoint_gist.c | 8 +++---- point/src/tpoint_in.c | 6 +++--- point/src/tpoint_out.c | 6 +++--- point/src/tpoint_parser.c | 8 +++---- point/src/tpoint_selfuncs.c | 4 ++-- point/src/tpoint_spatialfuncs.c | 12 +++++------ point/src/tpoint_spatialrels.c | 6 +++--- point/src/tpoint_spgist.c | 12 +++++------ point/src/tpoint_tempspatialrels.c | 12 +++++------ src/doublen.c | 2 +- src/lifting.c | 10 ++++----- src/period.c | 14 ++++++------ src/periodset.c | 12 +++++------ src/rangetypes_ext.c | 10 ++++----- src/skiplist.c | 14 ++++++------ src/tbool_boolops.c | 6 +++--- src/tbox.c | 20 ++++++++--------- src/tempcache.c | 4 ++-- src/temporal.c | 18 ++++++++-------- src/temporal_aggfuncs.c | 22 +++++++++---------- src/temporal_analyze.c | 16 +++++++------- src/temporal_boxops.c | 20 ++++++++--------- src/temporal_compops.c | 8 +++---- src/temporal_gist.c | 10 ++++----- src/temporal_parser.c | 12 +++++------ src/temporal_posops.c | 8 +++---- src/temporal_selfuncs.c | 30 +++++++++++++------------- src/temporal_spgist.c | 14 ++++++------ src/temporal_tile.c | 16 +++++++------- src/temporal_util.c | 10 ++++----- src/temporal_waggfuncs.c | 14 ++++++------ src/time_aggfuncs.c | 16 +++++++------- src/time_analyze.c | 12 +++++------ src/time_gist.c | 16 +++++++------- src/time_selfuncs.c | 14 ++++++------ src/time_spgist.c | 16 +++++++------- src/timeops.c | 12 +++++------ src/timestampset.c | 10 ++++----- src/tinstant.c | 22 +++++++++---------- src/tinstantset.c | 22 +++++++++---------- src/tnumber_distance.c | 14 ++++++------ src/tnumber_gist.c | 20 ++++++++--------- src/tnumber_mathfuncs.c | 12 +++++------ src/tnumber_selfuncs.c | 30 +++++++++++++------------- src/tnumber_spgist.c | 10 ++++----- src/tsequence.c | 22 +++++++++---------- src/tsequenceset.c | 20 ++++++++--------- src/ttext_textfuncs.c | 8 +++---- 88 files changed, 418 insertions(+), 418 deletions(-) diff --git a/npoint/include/tnpoint.h b/npoint/include/tnpoint.h index 058d23a672..682fd08e6b 100644 --- a/npoint/include/tnpoint.h +++ b/npoint/include/tnpoint.h @@ -34,7 +34,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" /***************************************************************************** * Struct definitions diff --git a/npoint/include/tnpoint_boxops.h b/npoint/include/tnpoint_boxops.h index 56c7fcecf6..8da3f27c73 100644 --- a/npoint/include/tnpoint_boxops.h +++ b/npoint/include/tnpoint_boxops.h @@ -35,7 +35,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" #include "tnpoint.h" /*****************************************************************************/ diff --git a/npoint/include/tnpoint_distance.h b/npoint/include/tnpoint_distance.h index eec94e25c5..7a7ab4b40b 100644 --- a/npoint/include/tnpoint_distance.h +++ b/npoint/include/tnpoint_distance.h @@ -34,7 +34,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/npoint/include/tnpoint_parser.h b/npoint/include/tnpoint_parser.h index dda4c7cd0b..85e5c7b5a6 100644 --- a/npoint/include/tnpoint_parser.h +++ b/npoint/include/tnpoint_parser.h @@ -32,7 +32,7 @@ #ifndef __TNPOINT_PARSER_H__ #define __TNPOINT_PARSER_H__ -#include "temporal.h" +#include "general/temporal.h" #include "tnpoint.h" /*****************************************************************************/ diff --git a/npoint/include/tnpoint_spatialfuncs.h b/npoint/include/tnpoint_spatialfuncs.h index d0fada4eda..4fdde07a75 100644 --- a/npoint/include/tnpoint_spatialfuncs.h +++ b/npoint/include/tnpoint_spatialfuncs.h @@ -35,7 +35,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" #include "tnpoint_static.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint.c b/npoint/src/tnpoint.c index 2ba4490b09..aeb5b4919f 100644 --- a/npoint/src/tnpoint.c +++ b/npoint/src/tnpoint.c @@ -33,11 +33,11 @@ #include -#include "temporaltypes.h" -#include "temporal_parser.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/temporal_parser.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/lifting.h" #include "tpoint_spatialfuncs.h" #include "tnpoint_static.h" diff --git a/npoint/src/tnpoint_aggfuncs.c b/npoint/src/tnpoint_aggfuncs.c index fd8f5c35f0..5381a7b7e9 100644 --- a/npoint/src/tnpoint_aggfuncs.c +++ b/npoint/src/tnpoint_aggfuncs.c @@ -35,7 +35,7 @@ #include -#include "temporal_aggfuncs.h" +#include "general/temporal_aggfuncs.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" #include "tpoint_aggfuncs.h" diff --git a/npoint/src/tnpoint_analyze.c b/npoint/src/tnpoint_analyze.c index b7157f60f4..8c378b4362 100644 --- a/npoint/src/tnpoint_analyze.c +++ b/npoint/src/tnpoint_analyze.c @@ -33,10 +33,10 @@ #include -#include "period.h" -#include "time_analyze.h" -#include "temporal.h" -#include "temporal_analyze.h" +#include "general/period.h" +#include "general/time_analyze.h" +#include "general/temporal.h" +#include "general/temporal_analyze.h" #include "postgis.h" #include "tpoint.h" #include "tpoint_selfuncs.h" diff --git a/npoint/src/tnpoint_boxops.c b/npoint/src/tnpoint_boxops.c index 30ca8a7dfe..c7b7ff0a3d 100644 --- a/npoint/src/tnpoint_boxops.c +++ b/npoint/src/tnpoint_boxops.c @@ -40,8 +40,8 @@ #include -#include "temporaltypes.h" -#include "temporal_util.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" #include "stbox.h" #include "tpoint_boxops.h" #include "tpoint_spatialfuncs.h" diff --git a/npoint/src/tnpoint_distance.c b/npoint/src/tnpoint_distance.c index 1663a0c63b..ffa1e4e404 100644 --- a/npoint/src/tnpoint_distance.c +++ b/npoint/src/tnpoint_distance.c @@ -31,9 +31,9 @@ #include "tnpoint_distance.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/lifting.h" #include "tpoint_spatialfuncs.h" #include "tpoint_distance.h" #include "tnpoint.h" diff --git a/npoint/src/tnpoint_parser.c b/npoint/src/tnpoint_parser.c index 3da4f0522b..831b826ba7 100644 --- a/npoint/src/tnpoint_parser.c +++ b/npoint/src/tnpoint_parser.c @@ -31,8 +31,8 @@ #include "tnpoint_parser.h" -#include "temporaltypes.h" -#include "temporal_parser.h" +#include "general/temporaltypes.h" +#include "general/temporal_parser.h" #include "tnpoint.h" #include "tnpoint_static.h" diff --git a/npoint/src/tnpoint_spatialfuncs.c b/npoint/src/tnpoint_spatialfuncs.c index e864f2751c..a8cb21dfae 100644 --- a/npoint/src/tnpoint_spatialfuncs.c +++ b/npoint/src/tnpoint_spatialfuncs.c @@ -34,11 +34,11 @@ #include #include -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" #include "tpoint_spatialfuncs.h" #include "tpoint_distance.h" #include "tpoint_boxops.h" diff --git a/npoint/src/tnpoint_spatialrels.c b/npoint/src/tnpoint_spatialrels.c index 6633d0b331..036a69fc5e 100644 --- a/npoint/src/tnpoint_spatialrels.c +++ b/npoint/src/tnpoint_spatialrels.c @@ -37,7 +37,7 @@ #include "tnpoint_spatialrels.h" -#include "lifting.h" +#include "general/lifting.h" #include "tpoint_spatialrels.h" #include "tnpoint.h" #include "tnpoint_static.h" diff --git a/npoint/src/tnpoint_static.c b/npoint/src/tnpoint_static.c index 068f3465ad..86d1c34395 100644 --- a/npoint/src/tnpoint_static.c +++ b/npoint/src/tnpoint_static.c @@ -41,10 +41,10 @@ #include #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "tnumber_mathfuncs.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/tnumber_mathfuncs.h" #include "tpoint_out.h" #include "tpoint_spatialfuncs.h" diff --git a/npoint/src/tnpoint_tempspatialrels.c b/npoint/src/tnpoint_tempspatialrels.c index 50f1ed060f..61ed680bb5 100644 --- a/npoint/src/tnpoint_tempspatialrels.c +++ b/npoint/src/tnpoint_tempspatialrels.c @@ -39,10 +39,10 @@ #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/lifting.h" #include "tpoint_spatialfuncs.h" #include "tpoint_spatialrels.h" #include "tpoint_tempspatialrels.h" diff --git a/point/include/postgis.h b/point/include/postgis.h index ce18361807..8b7039a040 100644 --- a/point/include/postgis.h +++ b/point/include/postgis.h @@ -310,7 +310,7 @@ extern Datum geography_lt(PG_FUNCTION_ARGS); #define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno))) #define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno))) -#include "temporal.h" +#include "general/temporal.h" #include #endif /* __TEMPORAL_POSTGIS_H__ */ diff --git a/point/include/stbox.h b/point/include/stbox.h index 41eba87a3b..c43c59d610 100644 --- a/point/include/stbox.h +++ b/point/include/stbox.h @@ -41,7 +41,7 @@ #endif #include -#include "timetypes.h" +#include "general/timetypes.h" /***************************************************************************** * Struct definition diff --git a/point/include/tpoint.h b/point/include/tpoint.h index 82498bd102..1b70d13d91 100644 --- a/point/include/tpoint.h +++ b/point/include/tpoint.h @@ -37,7 +37,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" #include #include "stbox.h" diff --git a/point/include/tpoint_aggfuncs.h b/point/include/tpoint_aggfuncs.h index 647d0bc504..9d50c37c45 100644 --- a/point/include/tpoint_aggfuncs.h +++ b/point/include/tpoint_aggfuncs.h @@ -36,8 +36,8 @@ #include #include -#include "temporal.h" -#include "skiplist.h" +#include "general/temporal.h" +#include "general/skiplist.h" /*****************************************************************************/ diff --git a/point/include/tpoint_analytics.h b/point/include/tpoint_analytics.h index 1614fdebb3..1b824fb540 100644 --- a/point/include/tpoint_analytics.h +++ b/point/include/tpoint_analytics.h @@ -35,7 +35,7 @@ #include #include -#include "temporaltypes.h" +#include "general/temporaltypes.h" /*****************************************************************************/ diff --git a/point/include/tpoint_boxops.h b/point/include/tpoint_boxops.h index fc9d9e47cf..3ef2bcb08c 100644 --- a/point/include/tpoint_boxops.h +++ b/point/include/tpoint_boxops.h @@ -38,8 +38,8 @@ #include #include -#include "temporal.h" -#include "temporal_util.h" +#include "general/temporal.h" +#include "general/temporal_util.h" #include "stbox.h" /*****************************************************************************/ diff --git a/point/include/tpoint_distance.h b/point/include/tpoint_distance.h index 2003a37771..6bd46574ad 100644 --- a/point/include/tpoint_distance.h +++ b/point/include/tpoint_distance.h @@ -38,7 +38,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" #include #include "tpoint.h" diff --git a/point/include/tpoint_gist.h b/point/include/tpoint_gist.h index 0a490c3a4e..c26c7c6ec3 100644 --- a/point/include/tpoint_gist.h +++ b/point/include/tpoint_gist.h @@ -35,7 +35,7 @@ #include #include #include -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/point/include/tpoint_parser.h b/point/include/tpoint_parser.h index 13fa907518..34cdefef88 100644 --- a/point/include/tpoint_parser.h +++ b/point/include/tpoint_parser.h @@ -32,7 +32,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/point/include/tpoint_posops.h b/point/include/tpoint_posops.h index 53d76a81e8..823c0e0216 100644 --- a/point/include/tpoint_posops.h +++ b/point/include/tpoint_posops.h @@ -34,7 +34,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/point/include/tpoint_selfuncs.h b/point/include/tpoint_selfuncs.h index ae77c46909..d79ff82012 100644 --- a/point/include/tpoint_selfuncs.h +++ b/point/include/tpoint_selfuncs.h @@ -39,7 +39,7 @@ #include #include -#include "tempcache.h" +#include "general/tempcache.h" #include "tpoint.h" #include "tpoint_analyze.h" diff --git a/point/include/tpoint_spatialfuncs.h b/point/include/tpoint_spatialfuncs.h index fa994869f8..799ae452e9 100644 --- a/point/include/tpoint_spatialfuncs.h +++ b/point/include/tpoint_spatialfuncs.h @@ -37,7 +37,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" #include "tpoint.h" /*****************************************************************************/ diff --git a/point/include/tpoint_spatialrels.h b/point/include/tpoint_spatialrels.h index c20dc9f6f8..a5dcd599ee 100644 --- a/point/include/tpoint_spatialrels.h +++ b/point/include/tpoint_spatialrels.h @@ -35,7 +35,7 @@ #include #include #include -#include "lifting.h" +#include "general/lifting.h" /*****************************************************************************/ diff --git a/point/include/tpoint_spgist.h b/point/include/tpoint_spgist.h index 90b23d80bd..0458af632c 100644 --- a/point/include/tpoint_spgist.h +++ b/point/include/tpoint_spgist.h @@ -35,7 +35,7 @@ #include #include #include -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/point/include/tpoint_tempspatialrels.h b/point/include/tpoint_tempspatialrels.h index 99af565ecc..e3f021df66 100644 --- a/point/include/tpoint_tempspatialrels.h +++ b/point/include/tpoint_tempspatialrels.h @@ -36,7 +36,7 @@ #include #include -#include "temporal.h" +#include "general/temporal.h" /* Compute either the tintersects or the tdisjoint relationship */ #define TINTERSECTS true diff --git a/point/include/tpoint_tile.h b/point/include/tpoint_tile.h index 387c1be5c6..fde9eba767 100644 --- a/point/include/tpoint_tile.h +++ b/point/include/tpoint_tile.h @@ -32,7 +32,7 @@ #ifndef __TPOINT_TILE_H__ #define __TPOINT_TILE_H__ -#include "temporal.h" +#include "general/temporal.h" /*****************************************************************************/ diff --git a/point/src/projection_gk.c b/point/src/projection_gk.c index 0a89ec80cf..c9354a446e 100644 --- a/point/src/projection_gk.c +++ b/point/src/projection_gk.c @@ -38,9 +38,9 @@ #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/lifting.h" #include "postgis.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/stbox.c b/point/src/stbox.c index 82348d9cdf..81880115d0 100644 --- a/point/src/stbox.c +++ b/point/src/stbox.c @@ -34,11 +34,11 @@ #include #include -#include "period.h" -#include "timestampset.h" -#include "periodset.h" -#include "temporal_util.h" -#include "tnumber_mathfuncs.h" +#include "general/period.h" +#include "general/timestampset.h" +#include "general/periodset.h" +#include "general/temporal_util.h" +#include "general/tnumber_mathfuncs.h" #include "tpoint.h" #include "tpoint_parser.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint.c b/point/src/tpoint.c index cbe12f32d6..2e93ecfaed 100644 --- a/point/src/tpoint.c +++ b/point/src/tpoint.c @@ -34,11 +34,11 @@ #include #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "lifting.h" -#include "temporal_compops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/lifting.h" +#include "general/temporal_compops.h" #include "stbox.h" #include "tpoint_parser.h" #include "tpoint_boxops.h" diff --git a/point/src/tpoint_aggfuncs.c b/point/src/tpoint_aggfuncs.c index 422ce8e3ad..8ce22e2130 100644 --- a/point/src/tpoint_aggfuncs.c +++ b/point/src/tpoint_aggfuncs.c @@ -35,12 +35,12 @@ #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "doublen.h" -#include "skiplist.h" -#include "temporal_aggfuncs.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/doublen.h" +#include "general/skiplist.h" +#include "general/temporal_aggfuncs.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint_analytics.c b/point/src/tpoint_analytics.c index a9630d743c..decbf4f7a3 100644 --- a/point/src/tpoint_analytics.c +++ b/point/src/tpoint_analytics.c @@ -44,14 +44,14 @@ #include #endif -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "lifting.h" -#include "tnumber_mathfuncs.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/lifting.h" +#include "general/tnumber_mathfuncs.h" #include "postgis.h" #include "geography_funcs.h" diff --git a/point/src/tpoint_analyze.c b/point/src/tpoint_analyze.c index 300863c628..5ed17c8210 100644 --- a/point/src/tpoint_analyze.c +++ b/point/src/tpoint_analyze.c @@ -57,12 +57,12 @@ #include #include -#include "period.h" -#include "time_analyze.h" -#include "temporal.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_analyze.h" +#include "general/period.h" +#include "general/time_analyze.h" +#include "general/temporal.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_analyze.h" #include "postgis.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint_boxops.c b/point/src/tpoint_boxops.c index 690b7b2b53..91fd7a76fc 100644 --- a/point/src/tpoint_boxops.c +++ b/point/src/tpoint_boxops.c @@ -45,11 +45,11 @@ #include #include -#include "timestampset.h" -#include "periodset.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "temporal_boxops.h" +#include "general/timestampset.h" +#include "general/periodset.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/temporal_boxops.h" #include "tpoint.h" #include "stbox.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint_datagen.c b/point/src/tpoint_datagen.c index 0cc8f7afe6..e0da144570 100644 --- a/point/src/tpoint_datagen.c +++ b/point/src/tpoint_datagen.c @@ -50,9 +50,9 @@ #define RADIANS_PER_DEGREE 0.0174532925199432957692 #endif -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" #include "postgis.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint_distance.c b/point/src/tpoint_distance.c index d6d279e650..b9fc6dfc7c 100644 --- a/point/src/tpoint_distance.c +++ b/point/src/tpoint_distance.c @@ -41,9 +41,9 @@ #include #endif -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" #include "postgis.h" #include "geography_funcs.h" #include "tpoint.h" diff --git a/point/src/tpoint_gist.c b/point/src/tpoint_gist.c index caaf88c5ca..98dbe8a8ad 100644 --- a/point/src/tpoint_gist.c +++ b/point/src/tpoint_gist.c @@ -40,11 +40,11 @@ #include #endif -#include "time_gist.h" -#include "temporaltypes.h" -#include "tempcache.h" +#include "general/time_gist.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" #include "tpoint.h" -#include "tnumber_gist.h" +#include "general/tnumber_gist.h" #include "tpoint_boxops.h" #include "tpoint_distance.h" #include "tpoint_posops.h" diff --git a/point/src/tpoint_in.c b/point/src/tpoint_in.c index 00a7c4cd14..4dc565d90b 100644 --- a/point/src/tpoint_in.c +++ b/point/src/tpoint_in.c @@ -35,9 +35,9 @@ #include #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" #include "postgis.h" #include "tpoint.h" #include "tpoint_parser.h" diff --git a/point/src/tpoint_out.c b/point/src/tpoint_out.c index bce6326778..75052208c8 100644 --- a/point/src/tpoint_out.c +++ b/point/src/tpoint_out.c @@ -35,9 +35,9 @@ #include #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/point/src/tpoint_parser.c b/point/src/tpoint_parser.c index b202949c3a..12039c48ff 100644 --- a/point/src/tpoint_parser.c +++ b/point/src/tpoint_parser.c @@ -31,12 +31,12 @@ #include "tpoint_parser.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "tempcache.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" -#include "temporal_parser.h" +#include "general/temporal_parser.h" #include "stbox.h" /*****************************************************************************/ diff --git a/point/src/tpoint_selfuncs.c b/point/src/tpoint_selfuncs.c index 11e039a770..01a71175b9 100644 --- a/point/src/tpoint_selfuncs.c +++ b/point/src/tpoint_selfuncs.c @@ -34,8 +34,8 @@ #include #include -#include "period.h" -#include "temporal_selfuncs.h" +#include "general/period.h" +#include "general/temporal_selfuncs.h" #include "stbox.h" #include "tpoint.h" #include "tpoint_analyze.h" diff --git a/point/src/tpoint_spatialfuncs.c b/point/src/tpoint_spatialfuncs.c index 5a13bd4b73..f433841d6b 100644 --- a/point/src/tpoint_spatialfuncs.c +++ b/point/src/tpoint_spatialfuncs.c @@ -34,12 +34,12 @@ #include #include -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "tnumber_mathfuncs.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/tnumber_mathfuncs.h" #include "postgis.h" #include "stbox.h" diff --git a/point/src/tpoint_spatialrels.c b/point/src/tpoint_spatialrels.c index 2244ff88e8..362b5aedae 100644 --- a/point/src/tpoint_spatialrels.c +++ b/point/src/tpoint_spatialrels.c @@ -47,9 +47,9 @@ #include "tpoint_spatialrels.h" #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" #include "tpoint_distance.h" diff --git a/point/src/tpoint_spgist.c b/point/src/tpoint_spgist.c index ea5e0a3a08..cec6212bd5 100644 --- a/point/src/tpoint_spgist.c +++ b/point/src/tpoint_spgist.c @@ -102,12 +102,12 @@ #include #endif -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "tempcache.h" -#include "tnumber_spgist.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" +#include "general/tnumber_spgist.h" #include "tpoint.h" #include "tpoint_boxops.h" #include "tpoint_distance.h" diff --git a/point/src/tpoint_tempspatialrels.c b/point/src/tpoint_tempspatialrels.c index 193e0445a9..fa24bfbc24 100644 --- a/point/src/tpoint_tempspatialrels.c +++ b/point/src/tpoint_tempspatialrels.c @@ -69,12 +69,12 @@ #include #include -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "tbool_boolops.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/tbool_boolops.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" #include "tpoint_spatialrels.h" diff --git a/src/doublen.c b/src/doublen.c index 2f2a74fb95..f6b0266bf2 100644 --- a/src/doublen.c +++ b/src/doublen.c @@ -38,7 +38,7 @@ * sum and the last one stores the count of the values. The final function * computes the average from the `doubleN` values. */ -#include "doublen.h" +#include "general/doublen.h" #include #include diff --git a/src/lifting.c b/src/lifting.c index 26b7565bab..47a8da65a9 100644 --- a/src/lifting.c +++ b/src/lifting.c @@ -133,15 +133,15 @@ * @endcode */ -#include "lifting.h" +#include "general/lifting.h" #include #include -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" /***************************************************************************** * Functions where the argument is a temporal type. diff --git a/src/period.c b/src/period.c index 2e9e97f71d..a1220ec7b5 100644 --- a/src/period.c +++ b/src/period.c @@ -30,19 +30,19 @@ * two Boolean values stating whether the bounds are inclusive or not. */ -#include "period.h" +#include "general/period.h" #include #include #include #include -#include "periodset.h" -#include "timeops.h" -#include "temporal.h" -#include "temporal_util.h" -#include "temporal_parser.h" -#include "rangetypes_ext.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporal.h" +#include "general/temporal_util.h" +#include "general/temporal_parser.h" +#include "general/rangetypes_ext.h" /***************************************************************************** * Utility functions diff --git a/src/periodset.c b/src/periodset.c index bba3fda505..5df7fdcad7 100644 --- a/src/periodset.c +++ b/src/periodset.c @@ -29,18 +29,18 @@ * Basic functions for set of disjoint periods. */ -#include "periodset.h" +#include "general/periodset.h" #include #include #include #include -#include "timestampset.h" -#include "period.h" -#include "timeops.h" -#include "temporal_util.h" -#include "temporal_parser.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporal_util.h" +#include "general/temporal_parser.h" /***************************************************************************** * General functions diff --git a/src/rangetypes_ext.c b/src/rangetypes_ext.c index 1689bd8b90..6875276b50 100644 --- a/src/rangetypes_ext.c +++ b/src/rangetypes_ext.c @@ -31,16 +31,16 @@ * These operators have been submitted as a PR to PostgreSQL. */ -#include "rangetypes_ext.h" +#include "general/rangetypes_ext.h" #include #include #include -#include "temporal.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "tnumber_mathfuncs.h" +#include "general/temporal.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/tnumber_mathfuncs.h" /***************************************************************************** * Generic range functions diff --git a/src/skiplist.c b/src/skiplist.c index 678d9cae74..51781fe8d4 100644 --- a/src/skiplist.c +++ b/src/skiplist.c @@ -29,7 +29,7 @@ * Functions manipulating skiplists */ -#include "skiplist.h" +#include "general/skiplist.h" #include #include @@ -38,12 +38,12 @@ #include #include -#include "skiplist.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporal_util.h" +#include "general/skiplist.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporal_util.h" /***************************************************************************** * Functions manipulating skip lists diff --git a/src/tbool_boolops.c b/src/tbool_boolops.c index 125ccc8697..1bf91f3031 100644 --- a/src/tbool_boolops.c +++ b/src/tbool_boolops.c @@ -29,10 +29,10 @@ * Temporal Boolean operators (and, or, not). */ -#include "tbool_boolops.h" +#include "general/tbool_boolops.h" -#include "temporaltypes.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/lifting.h" /***************************************************************************** * Boolean operations functions on datums diff --git a/src/tbox.c b/src/tbox.c index 1c0191f26b..67b856a2fb 100644 --- a/src/tbox.c +++ b/src/tbox.c @@ -29,20 +29,20 @@ * Functions for temporal bounding boxes. */ -#include "tbox.h" +#include "general/tbox.h" #include #include -#include "tempcache.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "rangetypes_ext.h" -#include "temporal.h" -#include "temporal_parser.h" -#include "temporal_util.h" -#include "tnumber_mathfuncs.h" +#include "general/tempcache.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/rangetypes_ext.h" +#include "general/temporal.h" +#include "general/temporal_parser.h" +#include "general/temporal_util.h" +#include "general/tnumber_mathfuncs.h" /** Buffer size for input and output of TBOX values */ #define MAXTBOXLEN 128 diff --git a/src/tempcache.c b/src/tempcache.c index 1903d14acc..32f1439246 100644 --- a/src/tempcache.c +++ b/src/tempcache.c @@ -44,7 +44,7 @@ * The invalid combinations will be initialized to 0. */ -#include "tempcache.h" +#include "general/tempcache.h" #if POSTGRESQL_VERSION_NUMBER >= 120000 #include @@ -54,7 +54,7 @@ #include #include -#include "temporaltypes.h" +#include "general/temporaltypes.h" /*****************************************************************************/ diff --git a/src/temporal.c b/src/temporal.c index 46e7b802a1..da4b662da2 100644 --- a/src/temporal.c +++ b/src/temporal.c @@ -29,7 +29,7 @@ * Basic functions for temporal types of any subtype. */ -#include "temporal.h" +#include "general/temporal.h" #include #include @@ -48,14 +48,14 @@ #include #include -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_boxops.h" -#include "temporal_parser.h" -#include "rangetypes_ext.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_boxops.h" +#include "general/temporal_parser.h" +#include "general/rangetypes_ext.h" #include "tpoint_spatialfuncs.h" #include "tnpoint_static.h" diff --git a/src/temporal_aggfuncs.c b/src/temporal_aggfuncs.c index 3540a1cf9a..6d9017328a 100644 --- a/src/temporal_aggfuncs.c +++ b/src/temporal_aggfuncs.c @@ -29,7 +29,7 @@ * Temporal aggregate functions */ -#include "temporal_aggfuncs.h" +#include "general/temporal_aggfuncs.h" #include #include @@ -39,16 +39,16 @@ #include #include -#include "skiplist.h" -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "tbool_boolops.h" -#include "temporal_boxops.h" -#include "doublen.h" -#include "time_aggfuncs.h" +#include "general/skiplist.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/tbool_boolops.h" +#include "general/temporal_boxops.h" +#include "general/doublen.h" +#include "general/time_aggfuncs.h" TInstant ** tinstant_tagg(TInstant **instants1, int count1, TInstant **instants2, diff --git a/src/temporal_analyze.c b/src/temporal_analyze.c index e1acc09342..a3b7cc9256 100644 --- a/src/temporal_analyze.c +++ b/src/temporal_analyze.c @@ -58,7 +58,7 @@ * the statistics for the temporal part are stored in slots 1 and 2. */ -#include "temporal_analyze.h" +#include "general/temporal_analyze.h" #include #include @@ -81,13 +81,13 @@ #include #include -#include "period.h" -#include "time_analyze.h" -#include "rangetypes_ext.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_analyze.h" +#include "general/period.h" +#include "general/time_analyze.h" +#include "general/rangetypes_ext.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_analyze.h" /* * To avoid consuming too much memory, IO and CPU load during analysis, and/or diff --git a/src/temporal_boxops.c b/src/temporal_boxops.c index a6b33e8e33..1aa8893214 100644 --- a/src/temporal_boxops.c +++ b/src/temporal_boxops.c @@ -40,21 +40,21 @@ * the value and the time dimensions. */ -#include "temporal_boxops.h" +#include "general/temporal_boxops.h" #include #include #include -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "rangetypes_ext.h" -#include "tbox.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/rangetypes_ext.h" +#include "general/tbox.h" #include "tpoint.h" #include "stbox.h" #include "tpoint_boxops.h" diff --git a/src/temporal_compops.c b/src/temporal_compops.c index ba88b9b719..276e3794fa 100644 --- a/src/temporal_compops.c +++ b/src/temporal_compops.c @@ -29,13 +29,13 @@ * Temporal comparison operators (=, <>, <, >, <=, >=). */ -#include "temporal_compops.h" +#include "general/temporal_compops.h" #include -#include "temporaltypes.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/lifting.h" #include "tpoint_spatialfuncs.h" /***************************************************************************** diff --git a/src/temporal_gist.c b/src/temporal_gist.c index 7877972906..c8dc249671 100644 --- a/src/temporal_gist.c +++ b/src/temporal_gist.c @@ -30,14 +30,14 @@ * is taken into account for indexing, currently, tbool and ttext. */ -#include "temporal_gist.h" +#include "general/temporal_gist.h" #include -#include "timetypes.h" -#include "temporal.h" -#include "tempcache.h" -#include "time_gist.h" +#include "general/timetypes.h" +#include "general/temporal.h" +#include "general/tempcache.h" +#include "general/time_gist.h" /***************************************************************************** * GiST compress method for temporal values diff --git a/src/temporal_parser.c b/src/temporal_parser.c index dece3baadd..1997315d2b 100644 --- a/src/temporal_parser.c +++ b/src/temporal_parser.c @@ -34,13 +34,13 @@ * moment which is both correct and simple. */ -#include "temporal_parser.h" +#include "general/temporal_parser.h" -#include "periodset.h" -#include "period.h" -#include "timestampset.h" -#include "temporaltypes.h" -#include "temporal_util.h" +#include "general/periodset.h" +#include "general/period.h" +#include "general/timestampset.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" /*****************************************************************************/ diff --git a/src/temporal_posops.c b/src/temporal_posops.c index 2f039f2064..7fb4f7041c 100644 --- a/src/temporal_posops.c +++ b/src/temporal_posops.c @@ -33,13 +33,13 @@ * - `before`, `overbefore`, `after`, `overafter`for the time dimension */ -#include "temporal_posops.h" +#include "general/temporal_posops.h" #include -#include "timeops.h" -#include "temporal.h" -#include "temporal_boxops.h" +#include "general/timeops.h" +#include "general/temporal.h" +#include "general/temporal_boxops.h" /*****************************************************************************/ /* Period op Temporal */ diff --git a/src/temporal_selfuncs.c b/src/temporal_selfuncs.c index ccce36cf00..d36890f09e 100644 --- a/src/temporal_selfuncs.c +++ b/src/temporal_selfuncs.c @@ -6,20 +6,20 @@ * contributors * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without a written + * documentation for any purpose, without fee, and without a written * agreement is hereby granted, provided that the above copyright notice and * this paragraph and the following two paragraphs appear in all copies. * * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, - * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY + * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON - * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO + * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  * *****************************************************************************/ @@ -33,7 +33,7 @@ * - B-tree comparison operators: `<`, `<=`, `>`, `>=` * - Bounding box operators: `&&`, `@>`, `<@`, `~=` * - Relative position operators: `<<#`, `&<#`, `#>>`, `#>>` - * - Ever/always comparison operators: `?=`, `%=`, `?<>`, `%<>`, `?<, `%<`, + * - Ever/always comparison operators: `?=`, `%=`, `?<>`, `%<>`, `?<, `%<`, * ... These still need to be defined. TODO * * Due to implicit casting, a condition such as `tbool <<# timestamptz` will be @@ -41,7 +41,7 @@ * cases for the operator definitions, indexes, selectivity, etc. */ -#include "temporal_selfuncs.h" +#include "general/temporal_selfuncs.h" #include #include @@ -65,15 +65,15 @@ #include #include #include -#include -#include - -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "time_selfuncs.h" -#include "rangetypes_ext.h" -#include "temporal_analyze.h" +#include "general/temporal_boxops.h" +#include "general/timetypes.h" + +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/time_selfuncs.h" +#include "general/rangetypes_ext.h" +#include "general/temporal_analyze.h" #include "tpoint.h" /***************************************************************************** diff --git a/src/temporal_spgist.c b/src/temporal_spgist.c index a65900039a..d3bb2be1c1 100644 --- a/src/temporal_spgist.c +++ b/src/temporal_spgist.c @@ -33,18 +33,18 @@ #if POSTGRESQL_VERSION_NUMBER >= 110000 -#include "temporal_spgist.h" +#include "general/temporal_spgist.h" #include #include #include -#include "timetypes.h" -#include "tempcache.h" -#include "period.h" -#include "time_gist.h" -#include "time_spgist.h" -#include "temporaltypes.h" +#include "general/timetypes.h" +#include "general/tempcache.h" +#include "general/period.h" +#include "general/time_gist.h" +#include "general/time_spgist.h" +#include "general/temporaltypes.h" /***************************************************************************** * SP-GiST compress functions diff --git a/src/temporal_tile.c b/src/temporal_tile.c index 7395b283a7..43de163042 100644 --- a/src/temporal_tile.c +++ b/src/temporal_tile.c @@ -41,14 +41,14 @@ #include #include -#include "temporal_tile.h" -#include "tempcache.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "rangetypes_ext.h" -#include "temporal.h" -#include "temporal_util.h" +#include "general/temporal_tile.h" +#include "general/tempcache.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/rangetypes_ext.h" +#include "general/temporal.h" +#include "general/temporal_util.h" /***************************************************************************** * Number bucket functions diff --git a/src/temporal_util.c b/src/temporal_util.c index ef14ecc57e..8318e90f8f 100644 --- a/src/temporal_util.c +++ b/src/temporal_util.c @@ -29,7 +29,7 @@ * Miscellaneous utility functions for temporal types. */ -#include "temporal_util.h" +#include "general/temporal_util.h" #include #include @@ -39,10 +39,10 @@ #include #include -#include "period.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "doublen.h" +#include "general/period.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/doublen.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/src/temporal_waggfuncs.c b/src/temporal_waggfuncs.c index 2aeb781fcf..8f33ed7d9a 100644 --- a/src/temporal_waggfuncs.c +++ b/src/temporal_waggfuncs.c @@ -29,17 +29,17 @@ * Window temporal aggregate functions */ -#include "temporal_waggfuncs.h" +#include "general/temporal_waggfuncs.h" #include #include -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "doublen.h" -#include "time_aggfuncs.h" -#include "temporal_aggfuncs.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/doublen.h" +#include "general/time_aggfuncs.h" +#include "general/temporal_aggfuncs.h" /***************************************************************************** * Generic functions diff --git a/src/time_aggfuncs.c b/src/time_aggfuncs.c index d830c7253b..9421a5c430 100644 --- a/src/time_aggfuncs.c +++ b/src/time_aggfuncs.c @@ -29,20 +29,20 @@ * Aggregate functions for time types */ -#include "time_aggfuncs.h" +#include "general/time_aggfuncs.h" #include #include #include #include -#include "skiplist.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" +#include "general/skiplist.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" TimestampTz * timestamp_agg(TimestampTz *times1, int count1, TimestampTz *times2, int count2, diff --git a/src/time_analyze.c b/src/time_analyze.c index 8149263ad8..395f4fd8b7 100644 --- a/src/time_analyze.c +++ b/src/time_analyze.c @@ -39,17 +39,17 @@ * come from different tuples. In theory, the standard scalar selectivity * functions could be used with the combined histogram. */ -#include "time_analyze.h" +#include "general/time_analyze.h" #include #include #include -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "temporal.h" -#include "tempcache.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/temporal.h" +#include "general/tempcache.h" static void timetype_compute_stats(CachedType type, VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, int samplerows); diff --git a/src/time_gist.c b/src/time_gist.c index bb39d645e4..2700603ad4 100644 --- a/src/time_gist.c +++ b/src/time_gist.c @@ -31,19 +31,19 @@ * These functions are based on those in the file `rangetypes_gist.c`. */ -#include "time_gist.h" +#include "general/time_gist.h" #include #include #include -#include "timetypes.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporal_util.h" -#include "tempcache.h" +#include "general/timetypes.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" /***************************************************************************** * GiST consistent methods diff --git a/src/time_selfuncs.c b/src/time_selfuncs.c index ca6f47bfb0..4fa7e61f10 100644 --- a/src/time_selfuncs.c +++ b/src/time_selfuncs.c @@ -32,7 +32,7 @@ * Estimates are based on histograms of lower and upper bounds. */ -#include "time_selfuncs.h" +#include "general/time_selfuncs.h" #include #include @@ -43,12 +43,12 @@ #include #include -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "time_analyze.h" -#include "tempcache.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/time_analyze.h" +#include "general/tempcache.h" /*****************************************************************************/ diff --git a/src/time_spgist.c b/src/time_spgist.c index 5de4bf9492..45701c22e5 100644 --- a/src/time_spgist.c +++ b/src/time_spgist.c @@ -34,19 +34,19 @@ #if POSTGRESQL_VERSION_NUMBER >= 110000 -#include "time_spgist.h" +#include "general/time_spgist.h" #include #include #include -#include "timetypes.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "time_gist.h" -#include "temporal_util.h" -#include "tempcache.h" +#include "general/timetypes.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/time_gist.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" /***************************************************************************** * SP-GiST config function diff --git a/src/timeops.c b/src/timeops.c index 2ca89c1fd2..bb0cff138b 100644 --- a/src/timeops.c +++ b/src/timeops.c @@ -29,16 +29,16 @@ * Operators for time types. */ -#include "timeops.h" +#include "general/timeops.h" #include #include -#include "period.h" -#include "periodset.h" -#include "timestampset.h" -#include "tempcache.h" -#include "temporal_util.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timestampset.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" typedef enum { diff --git a/src/timestampset.c b/src/timestampset.c index 9576fb0e1b..302ce33fce 100644 --- a/src/timestampset.c +++ b/src/timestampset.c @@ -29,16 +29,16 @@ * Basic functions for set of (distinct) timestamps. */ -#include "timestampset.h" +#include "general/timestampset.h" #include #include #include -#include "temporal.h" -#include "temporal_parser.h" -#include "period.h" -#include "temporal_util.h" +#include "general/temporal.h" +#include "general/temporal_parser.h" +#include "general/period.h" +#include "general/temporal_util.h" /***************************************************************************** * General functions diff --git a/src/tinstant.c b/src/tinstant.c index 4caa48a989..c051102332 100644 --- a/src/tinstant.c +++ b/src/tinstant.c @@ -29,7 +29,7 @@ * Basic functions for temporal instants. */ -#include "tinstant.h" +#include "general/tinstant.h" #include #include @@ -37,16 +37,16 @@ #include /* for get_typlenbyval */ #include -#include "timetypes.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_boxops.h" -#include "rangetypes_ext.h" +#include "general/timetypes.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_boxops.h" +#include "general/rangetypes_ext.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/src/tinstantset.c b/src/tinstantset.c index 987b1c3974..93fb9276f5 100644 --- a/src/tinstantset.c +++ b/src/tinstantset.c @@ -29,7 +29,7 @@ * Basic functions for temporal instant sets. */ -#include "tinstantset.h" +#include "general/tinstantset.h" #include #include @@ -37,16 +37,16 @@ #include #include -#include "timetypes.h" -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_boxops.h" -#include "rangetypes_ext.h" +#include "general/timetypes.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_boxops.h" +#include "general/rangetypes_ext.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/src/tnumber_distance.c b/src/tnumber_distance.c index 6832457ce6..2612e6f58d 100644 --- a/src/tnumber_distance.c +++ b/src/tnumber_distance.c @@ -29,7 +29,7 @@ * Distance functions for temporal numbers. */ -#include "tnumber_distance.h" +#include "general/tnumber_distance.h" #include #include @@ -41,12 +41,12 @@ #include #endif -#include "period.h" -#include "timeops.h" -#include "rangetypes_ext.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/rangetypes_ext.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/lifting.h" /***************************************************************************** * Temporal distance diff --git a/src/tnumber_gist.c b/src/tnumber_gist.c index 6577014e36..d1269a0ff9 100644 --- a/src/tnumber_gist.c +++ b/src/tnumber_gist.c @@ -31,7 +31,7 @@ * These functions are based on those in the file `gistproc.c`. */ -#include "tnumber_gist.h" +#include "general/tnumber_gist.h" #include #include @@ -43,15 +43,15 @@ #include #endif -#include "rangetypes_ext.h" -#include "period.h" -#include "timeops.h" -#include "time_gist.h" -#include "temporal_util.h" -#include "tempcache.h" -#include "temporal_boxops.h" -#include "temporal_posops.h" -#include "tnumber_distance.h" +#include "general/rangetypes_ext.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/time_gist.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" +#include "general/temporal_boxops.h" +#include "general/temporal_posops.h" +#include "general/tnumber_distance.h" /***************************************************************************** * GiST consistent methods diff --git a/src/tnumber_mathfuncs.c b/src/tnumber_mathfuncs.c index 53a68b14da..be7d59ae46 100644 --- a/src/tnumber_mathfuncs.c +++ b/src/tnumber_mathfuncs.c @@ -29,17 +29,17 @@ * Temporal mathematical operators (+, -, *, /) and functions (round, degrees). */ -#include "tnumber_mathfuncs.h" +#include "general/tnumber_mathfuncs.h" #include #include #include -#include "period.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/period.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/lifting.h" /***************************************************************************** * Miscellaneous functions on datums diff --git a/src/tnumber_selfuncs.c b/src/tnumber_selfuncs.c index a48e67cd4f..f998f74405 100644 --- a/src/tnumber_selfuncs.c +++ b/src/tnumber_selfuncs.c @@ -6,20 +6,20 @@ * contributors * * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose, without fee, and without a written + * documentation for any purpose, without fee, and without a written * agreement is hereby granted, provided that the above copyright notice and * this paragraph and the following two paragraphs appear in all copies. * * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, - * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY + * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON - * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO + * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.  * *****************************************************************************/ @@ -29,7 +29,7 @@ * Functions for selectivity estimation of operators on temporal number types */ -#include "tnumber_selfuncs.h" +#include "general/tnumber_selfuncs.h" #include #include @@ -44,16 +44,16 @@ #include #endif #include -#include - -#include "period.h" -#include "rangetypes_ext.h" -#include "temporal_util.h" -#include "tempcache.h" -#include "tbox.h" -#include "time_selfuncs.h" -#include "temporal_analyze.h" -#include "temporal_selfuncs.h" +#include "general/temporal_boxops.h" + +#include "general/period.h" +#include "general/rangetypes_ext.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" +#include "general/tbox.h" +#include "general/time_selfuncs.h" +#include "general/temporal_analyze.h" +#include "general/temporal_selfuncs.h" /***************************************************************************** * Functions copied from PostgreSQL file rangetypes_selfuncs.c since they diff --git a/src/tnumber_spgist.c b/src/tnumber_spgist.c index 2dd5cf5fe1..bf4e4d3d79 100644 --- a/src/tnumber_spgist.c +++ b/src/tnumber_spgist.c @@ -92,7 +92,7 @@ #if POSTGRESQL_VERSION_NUMBER >= 110000 -#include "tnumber_spgist.h" +#include "general/tnumber_spgist.h" #include #include @@ -102,10 +102,10 @@ #include #endif -#include "temporal_util.h" -#include "tempcache.h" -#include "temporal_boxops.h" -#include "tnumber_gist.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" +#include "general/temporal_boxops.h" +#include "general/tnumber_gist.h" #if POSTGRESQL_VERSION_NUMBER >= 120000 /* To avoid including "access/spgist_private.h" since it conflicts with the diff --git a/src/tsequence.c b/src/tsequence.c index f04df273ce..35a3fd21b1 100644 --- a/src/tsequence.c +++ b/src/tsequence.c @@ -29,7 +29,7 @@ * Basic functions for temporal sequences. */ -#include "tsequence.h" +#include "general/tsequence.h" #include #include @@ -39,16 +39,16 @@ #include #include -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "doublen.h" -#include "temporaltypes.h" -#include "tempcache.h" -#include "temporal_util.h" -#include "temporal_boxops.h" -#include "rangetypes_ext.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/doublen.h" +#include "general/temporaltypes.h" +#include "general/tempcache.h" +#include "general/temporal_util.h" +#include "general/temporal_boxops.h" +#include "general/rangetypes_ext.h" #include "tpoint.h" #include "tpoint_boxops.h" diff --git a/src/tsequenceset.c b/src/tsequenceset.c index a25ae0e2c2..c87b4bb73b 100644 --- a/src/tsequenceset.c +++ b/src/tsequenceset.c @@ -29,7 +29,7 @@ * Basic functions for temporal sequence sets. */ -#include "tsequenceset.h" +#include "general/tsequenceset.h" #include #include @@ -37,15 +37,15 @@ #include #include -#include "timestampset.h" -#include "period.h" -#include "periodset.h" -#include "timeops.h" -#include "temporaltypes.h" -#include "temporal_util.h" -#include "tempcache.h" -#include "temporal_boxops.h" -#include "rangetypes_ext.h" +#include "general/timestampset.h" +#include "general/period.h" +#include "general/periodset.h" +#include "general/timeops.h" +#include "general/temporaltypes.h" +#include "general/temporal_util.h" +#include "general/tempcache.h" +#include "general/temporal_boxops.h" +#include "general/rangetypes_ext.h" #include "tpoint.h" #include "tpoint_spatialfuncs.h" diff --git a/src/ttext_textfuncs.c b/src/ttext_textfuncs.c index ad96f1d366..5c79e0a35d 100644 --- a/src/ttext_textfuncs.c +++ b/src/ttext_textfuncs.c @@ -29,12 +29,12 @@ * Temporal text functions: `textcat`, `lower`, `upper`. */ -#include "ttext_textfuncs.h" +#include "general/ttext_textfuncs.h" #include -#include "temporal.h" -#include "temporal_util.h" -#include "lifting.h" +#include "general/temporal.h" +#include "general/temporal_util.h" +#include "general/lifting.h" /***************************************************************************** * Textual functions on datums From 6db582fa1d8aac0d9da207b251dc7c41a1cd862f Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:12:47 -0500 Subject: [PATCH 04/22] [inlcude] organizing subdirectory point --- {point/include => include/point}/geography_funcs.h | 0 {point/include => include/point}/postgis.h | 0 {point/include => include/point}/projection_gk.h | 0 {point/include => include/point}/stbox.h | 0 {point/include => include/point}/tpoint.h | 0 {point/include => include/point}/tpoint_aggfuncs.h | 0 {point/include => include/point}/tpoint_analytics.h | 0 {point/include => include/point}/tpoint_analyze.h | 0 {point/include => include/point}/tpoint_boxops.h | 0 {point/include => include/point}/tpoint_datagen.h | 0 {point/include => include/point}/tpoint_distance.h | 0 {point/include => include/point}/tpoint_gist.h | 0 {point/include => include/point}/tpoint_in.h | 0 {point/include => include/point}/tpoint_out.h | 0 {point/include => include/point}/tpoint_parser.h | 0 {point/include => include/point}/tpoint_posops.h | 0 {point/include => include/point}/tpoint_selfuncs.h | 0 {point/include => include/point}/tpoint_spatialfuncs.h | 0 {point/include => include/point}/tpoint_spatialrels.h | 0 {point/include => include/point}/tpoint_spgist.h | 0 {point/include => include/point}/tpoint_tempspatialrels.h | 0 {point/include => include/point}/tpoint_tile.h | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {point/include => include/point}/geography_funcs.h (100%) rename {point/include => include/point}/postgis.h (100%) rename {point/include => include/point}/projection_gk.h (100%) rename {point/include => include/point}/stbox.h (100%) rename {point/include => include/point}/tpoint.h (100%) rename {point/include => include/point}/tpoint_aggfuncs.h (100%) rename {point/include => include/point}/tpoint_analytics.h (100%) rename {point/include => include/point}/tpoint_analyze.h (100%) rename {point/include => include/point}/tpoint_boxops.h (100%) rename {point/include => include/point}/tpoint_datagen.h (100%) rename {point/include => include/point}/tpoint_distance.h (100%) rename {point/include => include/point}/tpoint_gist.h (100%) rename {point/include => include/point}/tpoint_in.h (100%) rename {point/include => include/point}/tpoint_out.h (100%) rename {point/include => include/point}/tpoint_parser.h (100%) rename {point/include => include/point}/tpoint_posops.h (100%) rename {point/include => include/point}/tpoint_selfuncs.h (100%) rename {point/include => include/point}/tpoint_spatialfuncs.h (100%) rename {point/include => include/point}/tpoint_spatialrels.h (100%) rename {point/include => include/point}/tpoint_spgist.h (100%) rename {point/include => include/point}/tpoint_tempspatialrels.h (100%) rename {point/include => include/point}/tpoint_tile.h (100%) diff --git a/point/include/geography_funcs.h b/include/point/geography_funcs.h similarity index 100% rename from point/include/geography_funcs.h rename to include/point/geography_funcs.h diff --git a/point/include/postgis.h b/include/point/postgis.h similarity index 100% rename from point/include/postgis.h rename to include/point/postgis.h diff --git a/point/include/projection_gk.h b/include/point/projection_gk.h similarity index 100% rename from point/include/projection_gk.h rename to include/point/projection_gk.h diff --git a/point/include/stbox.h b/include/point/stbox.h similarity index 100% rename from point/include/stbox.h rename to include/point/stbox.h diff --git a/point/include/tpoint.h b/include/point/tpoint.h similarity index 100% rename from point/include/tpoint.h rename to include/point/tpoint.h diff --git a/point/include/tpoint_aggfuncs.h b/include/point/tpoint_aggfuncs.h similarity index 100% rename from point/include/tpoint_aggfuncs.h rename to include/point/tpoint_aggfuncs.h diff --git a/point/include/tpoint_analytics.h b/include/point/tpoint_analytics.h similarity index 100% rename from point/include/tpoint_analytics.h rename to include/point/tpoint_analytics.h diff --git a/point/include/tpoint_analyze.h b/include/point/tpoint_analyze.h similarity index 100% rename from point/include/tpoint_analyze.h rename to include/point/tpoint_analyze.h diff --git a/point/include/tpoint_boxops.h b/include/point/tpoint_boxops.h similarity index 100% rename from point/include/tpoint_boxops.h rename to include/point/tpoint_boxops.h diff --git a/point/include/tpoint_datagen.h b/include/point/tpoint_datagen.h similarity index 100% rename from point/include/tpoint_datagen.h rename to include/point/tpoint_datagen.h diff --git a/point/include/tpoint_distance.h b/include/point/tpoint_distance.h similarity index 100% rename from point/include/tpoint_distance.h rename to include/point/tpoint_distance.h diff --git a/point/include/tpoint_gist.h b/include/point/tpoint_gist.h similarity index 100% rename from point/include/tpoint_gist.h rename to include/point/tpoint_gist.h diff --git a/point/include/tpoint_in.h b/include/point/tpoint_in.h similarity index 100% rename from point/include/tpoint_in.h rename to include/point/tpoint_in.h diff --git a/point/include/tpoint_out.h b/include/point/tpoint_out.h similarity index 100% rename from point/include/tpoint_out.h rename to include/point/tpoint_out.h diff --git a/point/include/tpoint_parser.h b/include/point/tpoint_parser.h similarity index 100% rename from point/include/tpoint_parser.h rename to include/point/tpoint_parser.h diff --git a/point/include/tpoint_posops.h b/include/point/tpoint_posops.h similarity index 100% rename from point/include/tpoint_posops.h rename to include/point/tpoint_posops.h diff --git a/point/include/tpoint_selfuncs.h b/include/point/tpoint_selfuncs.h similarity index 100% rename from point/include/tpoint_selfuncs.h rename to include/point/tpoint_selfuncs.h diff --git a/point/include/tpoint_spatialfuncs.h b/include/point/tpoint_spatialfuncs.h similarity index 100% rename from point/include/tpoint_spatialfuncs.h rename to include/point/tpoint_spatialfuncs.h diff --git a/point/include/tpoint_spatialrels.h b/include/point/tpoint_spatialrels.h similarity index 100% rename from point/include/tpoint_spatialrels.h rename to include/point/tpoint_spatialrels.h diff --git a/point/include/tpoint_spgist.h b/include/point/tpoint_spgist.h similarity index 100% rename from point/include/tpoint_spgist.h rename to include/point/tpoint_spgist.h diff --git a/point/include/tpoint_tempspatialrels.h b/include/point/tpoint_tempspatialrels.h similarity index 100% rename from point/include/tpoint_tempspatialrels.h rename to include/point/tpoint_tempspatialrels.h diff --git a/point/include/tpoint_tile.h b/include/point/tpoint_tile.h similarity index 100% rename from point/include/tpoint_tile.h rename to include/point/tpoint_tile.h From e96b91a2dc3f85de165fad9d6fe1b1fdce917c20 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:21:17 -0500 Subject: [PATCH 05/22] [src] adjusted to include/point location --- include/general/temporal.h | 2 +- include/general/temporal_util.h | 2 +- include/general/tinstant.h | 2 +- npoint/src/tnpoint.c | 2 +- npoint/src/tnpoint_aggfuncs.c | 6 +++--- npoint/src/tnpoint_analyze.c | 8 ++++---- npoint/src/tnpoint_boxops.c | 6 +++--- npoint/src/tnpoint_distance.c | 4 ++-- npoint/src/tnpoint_indexes.c | 2 +- npoint/src/tnpoint_posops.c | 8 ++++---- npoint/src/tnpoint_spatialfuncs.c | 6 +++--- npoint/src/tnpoint_spatialrels.c | 2 +- npoint/src/tnpoint_static.c | 4 ++-- npoint/src/tnpoint_tempspatialrels.c | 6 +++--- point/src/geography_functions.c | 4 ++-- point/src/projection_gk.c | 8 ++++---- point/src/stbox.c | 8 ++++---- point/src/tpoint.c | 10 +++++----- point/src/tpoint_aggfuncs.c | 6 +++--- point/src/tpoint_analytics.c | 14 +++++++------- point/src/tpoint_analyze.c | 8 ++++---- point/src/tpoint_boxops.c | 8 ++++---- point/src/tpoint_datagen.c | 8 ++++---- point/src/tpoint_distance.c | 14 +++++++------- point/src/tpoint_gist.c | 10 +++++----- point/src/tpoint_in.c | 10 +++++----- point/src/tpoint_out.c | 6 +++--- point/src/tpoint_parser.c | 8 ++++---- point/src/tpoint_posops.c | 10 +++++----- point/src/tpoint_selfuncs.c | 10 +++++----- point/src/tpoint_spatialfuncs.c | 12 ++++++------ point/src/tpoint_spatialrels.c | 8 ++++---- point/src/tpoint_spgist.c | 10 +++++----- point/src/tpoint_tempspatialrels.c | 8 ++++---- point/src/tpoint_tile.c | 6 +++--- src/temporal.c | 2 +- src/temporal_boxops.c | 6 +++--- src/temporal_compops.c | 2 +- src/temporal_selfuncs.c | 2 +- src/temporal_util.c | 4 ++-- src/tinstant.c | 4 ++-- src/tinstantset.c | 4 ++-- src/tsequence.c | 6 +++--- src/tsequenceset.c | 4 ++-- 44 files changed, 140 insertions(+), 140 deletions(-) diff --git a/include/general/temporal.h b/include/general/temporal.h index f656380950..62b48584e4 100644 --- a/include/general/temporal.h +++ b/include/general/temporal.h @@ -40,7 +40,7 @@ #include "timetypes.h" #include "tbox.h" -#include "stbox.h" +#include "point/stbox.h" #if POSTGRESQL_VERSION_NUMBER < 130000 #ifndef USE_FLOAT4_BYVAL diff --git a/include/general/temporal_util.h b/include/general/temporal_util.h index d8de1a1ba3..c19fe309ad 100644 --- a/include/general/temporal_util.h +++ b/include/general/temporal_util.h @@ -41,7 +41,7 @@ #include #include "temporal.h" -#include "postgis.h" +#include "point/postgis.h" /*****************************************************************************/ diff --git a/include/general/tinstant.h b/include/general/tinstant.h index 9ef0d5b56e..80179f2a66 100644 --- a/include/general/tinstant.h +++ b/include/general/tinstant.h @@ -38,7 +38,7 @@ #include #include "temporal.h" -#include "postgis.h" +#include "point/postgis.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint.c b/npoint/src/tnpoint.c index aeb5b4919f..c96afa3cdb 100644 --- a/npoint/src/tnpoint.c +++ b/npoint/src/tnpoint.c @@ -39,7 +39,7 @@ #include "general/temporal_util.h" #include "general/lifting.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint_static.h" #include "tnpoint_parser.h" diff --git a/npoint/src/tnpoint_aggfuncs.c b/npoint/src/tnpoint_aggfuncs.c index 5381a7b7e9..14f721ac3e 100644 --- a/npoint/src/tnpoint_aggfuncs.c +++ b/npoint/src/tnpoint_aggfuncs.c @@ -36,9 +36,9 @@ #include #include "general/temporal_aggfuncs.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_aggfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_aggfuncs.h" #include "tnpoint.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint_analyze.c b/npoint/src/tnpoint_analyze.c index 8c378b4362..c6d88aa493 100644 --- a/npoint/src/tnpoint_analyze.c +++ b/npoint/src/tnpoint_analyze.c @@ -37,10 +37,10 @@ #include "general/time_analyze.h" #include "general/temporal.h" #include "general/temporal_analyze.h" -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_selfuncs.h" -#include "tpoint_analyze.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_selfuncs.h" +#include "point/tpoint_analyze.h" #include "tnpoint_spatialfuncs.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint_boxops.c b/npoint/src/tnpoint_boxops.c index c7b7ff0a3d..952cb1bbda 100644 --- a/npoint/src/tnpoint_boxops.c +++ b/npoint/src/tnpoint_boxops.c @@ -42,9 +42,9 @@ #include "general/temporaltypes.h" #include "general/temporal_util.h" -#include "stbox.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialfuncs.h" +#include "point/stbox.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_spatialfuncs.h" diff --git a/npoint/src/tnpoint_distance.c b/npoint/src/tnpoint_distance.c index ffa1e4e404..dd2357be26 100644 --- a/npoint/src/tnpoint_distance.c +++ b/npoint/src/tnpoint_distance.c @@ -34,8 +34,8 @@ #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/lifting.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_distance.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_distance.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_spatialfuncs.h" diff --git a/npoint/src/tnpoint_indexes.c b/npoint/src/tnpoint_indexes.c index cc96eabff3..8b32c2f104 100644 --- a/npoint/src/tnpoint_indexes.c +++ b/npoint/src/tnpoint_indexes.c @@ -32,7 +32,7 @@ #include "tnpoint_indexes.h" #include -#include "tpoint.h" +#include "point/tpoint.h" #include "tnpoint.h" /***************************************************************************** diff --git a/npoint/src/tnpoint_posops.c b/npoint/src/tnpoint_posops.c index 6504d4a65c..943ee267a4 100644 --- a/npoint/src/tnpoint_posops.c +++ b/npoint/src/tnpoint_posops.c @@ -45,10 +45,10 @@ #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 #include -#include "postgis.h" -#include "tpoint_boxops.h" -#include "tpoint_posops.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_posops.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_boxops.h" diff --git a/npoint/src/tnpoint_spatialfuncs.c b/npoint/src/tnpoint_spatialfuncs.c index a8cb21dfae..149a4c46c6 100644 --- a/npoint/src/tnpoint_spatialfuncs.c +++ b/npoint/src/tnpoint_spatialfuncs.c @@ -39,9 +39,9 @@ #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/temporal_util.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_distance.h" -#include "tpoint_boxops.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_distance.h" +#include "point/tpoint_boxops.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_distance.h" diff --git a/npoint/src/tnpoint_spatialrels.c b/npoint/src/tnpoint_spatialrels.c index 036a69fc5e..7a828369ce 100644 --- a/npoint/src/tnpoint_spatialrels.c +++ b/npoint/src/tnpoint_spatialrels.c @@ -38,7 +38,7 @@ #include "tnpoint_spatialrels.h" #include "general/lifting.h" -#include "tpoint_spatialrels.h" +#include "point/tpoint_spatialrels.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_spatialfuncs.h" diff --git a/npoint/src/tnpoint_static.c b/npoint/src/tnpoint_static.c index 86d1c34395..8cb4d296cb 100644 --- a/npoint/src/tnpoint_static.c +++ b/npoint/src/tnpoint_static.c @@ -46,8 +46,8 @@ #include "general/temporal_util.h" #include "general/tnumber_mathfuncs.h" -#include "tpoint_out.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint_out.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint.h" #include "tnpoint_parser.h" diff --git a/npoint/src/tnpoint_tempspatialrels.c b/npoint/src/tnpoint_tempspatialrels.c index 61ed680bb5..091a56671d 100644 --- a/npoint/src/tnpoint_tempspatialrels.c +++ b/npoint/src/tnpoint_tempspatialrels.c @@ -43,9 +43,9 @@ #include "general/tempcache.h" #include "general/temporal_util.h" #include "general/lifting.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_spatialrels.h" -#include "tpoint_tempspatialrels.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_spatialrels.h" +#include "point/tpoint_tempspatialrels.h" #include "tnpoint.h" #include "tnpoint_static.h" #include "tnpoint_spatialfuncs.h" diff --git a/point/src/geography_functions.c b/point/src/geography_functions.c index a5d9632c7c..1ff7c88fc2 100644 --- a/point/src/geography_functions.c +++ b/point/src/geography_functions.c @@ -41,8 +41,8 @@ #include #include -#include "postgis.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint_spatialfuncs.h" extern void lwerror(const char *fmt, ...); diff --git a/point/src/projection_gk.c b/point/src/projection_gk.c index c9354a446e..238df3f102 100644 --- a/point/src/projection_gk.c +++ b/point/src/projection_gk.c @@ -33,7 +33,7 @@ * of MobilityDB and Secondo. */ -#include "projection_gk.h" +#include "point/projection_gk.h" #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 @@ -41,9 +41,9 @@ #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/lifting.h" -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" double Pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164; double awgs = 6378137.0; diff --git a/point/src/stbox.c b/point/src/stbox.c index 81880115d0..5f50de9bf4 100644 --- a/point/src/stbox.c +++ b/point/src/stbox.c @@ -29,7 +29,7 @@ * Functions for spatiotemporal bounding boxes. */ -#include "stbox.h" +#include "point/stbox.h" #include #include @@ -39,9 +39,9 @@ #include "general/periodset.h" #include "general/temporal_util.h" #include "general/tnumber_mathfuncs.h" -#include "tpoint.h" -#include "tpoint_parser.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_parser.h" +#include "point/tpoint_spatialfuncs.h" /* Buffer size for input and output of STBOX */ #define MAXSTBOXLEN 256 diff --git a/point/src/tpoint.c b/point/src/tpoint.c index 2e93ecfaed..e373e5a5e1 100644 --- a/point/src/tpoint.c +++ b/point/src/tpoint.c @@ -29,7 +29,7 @@ * Basic functions for temporal points. */ -#include "tpoint.h" +#include "point/tpoint.h" #include #include @@ -39,10 +39,10 @@ #include "general/temporal_util.h" #include "general/lifting.h" #include "general/temporal_compops.h" -#include "stbox.h" -#include "tpoint_parser.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialfuncs.h" +#include "point/stbox.h" +#include "point/tpoint_parser.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Miscellaneous functions diff --git a/point/src/tpoint_aggfuncs.c b/point/src/tpoint_aggfuncs.c index 8ce22e2130..d71f901a63 100644 --- a/point/src/tpoint_aggfuncs.c +++ b/point/src/tpoint_aggfuncs.c @@ -31,7 +31,7 @@ * The only functions currently provided are extent and temporal centroid. */ -#include "tpoint_aggfuncs.h" +#include "point/tpoint_aggfuncs.h" #include @@ -41,8 +41,8 @@ #include "general/doublen.h" #include "general/skiplist.h" #include "general/temporal_aggfuncs.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Generic functions diff --git a/point/src/tpoint_analytics.c b/point/src/tpoint_analytics.c index decbf4f7a3..6a3e608f5c 100644 --- a/point/src/tpoint_analytics.c +++ b/point/src/tpoint_analytics.c @@ -29,7 +29,7 @@ * Analytic functions for temporal points and temporal floats. */ -#include "tpoint_analytics.h" +#include "point/tpoint_analytics.h" #include #include @@ -53,12 +53,12 @@ #include "general/lifting.h" #include "general/tnumber_mathfuncs.h" -#include "postgis.h" -#include "geography_funcs.h" -#include "tpoint.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialrels.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/geography_funcs.h" +#include "point/tpoint.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialrels.h" +#include "point/tpoint_spatialfuncs.h" /* Timestamps in PostgreSQL are encoded as MICROseconds since '2000-01-01' * while Unix epoch are encoded as MILLIseconds since '1970-01-01'. diff --git a/point/src/tpoint_analyze.c b/point/src/tpoint_analyze.c index 5ed17c8210..09a0627256 100644 --- a/point/src/tpoint_analyze.c +++ b/point/src/tpoint_analyze.c @@ -49,7 +49,7 @@ * the subtype. Please refer to file temporal_analyze.c for more information. */ -#include "tpoint_analyze.h" +#include "point/tpoint_analyze.h" #include #include @@ -63,9 +63,9 @@ #include "general/tempcache.h" #include "general/temporal_util.h" #include "general/temporal_analyze.h" -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint_spatialfuncs.h" /***************************************************************************** diff --git a/point/src/tpoint_boxops.c b/point/src/tpoint_boxops.c index 91fd7a76fc..b5d34092de 100644 --- a/point/src/tpoint_boxops.c +++ b/point/src/tpoint_boxops.c @@ -39,7 +39,7 @@ * the space and the time dimensions. */ -#include "tpoint_boxops.h" +#include "point/tpoint_boxops.h" #include #include @@ -50,9 +50,9 @@ #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/temporal_boxops.h" -#include "tpoint.h" -#include "stbox.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/stbox.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Functions computing the bounding box at the creation of a temporal point diff --git a/point/src/tpoint_datagen.c b/point/src/tpoint_datagen.c index e0da144570..b4e25aa226 100644 --- a/point/src/tpoint_datagen.c +++ b/point/src/tpoint_datagen.c @@ -32,7 +32,7 @@ * https://github.com/MobilityDB/MobilityDB-BerlinMOD */ -#include "tpoint_datagen.h" +#include "point/tpoint_datagen.h" #include #include /* for * () */ @@ -53,9 +53,9 @@ #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/temporal_util.h" -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /*****************************************************************************/ diff --git a/point/src/tpoint_distance.c b/point/src/tpoint_distance.c index b9fc6dfc7c..7e9c5a302b 100644 --- a/point/src/tpoint_distance.c +++ b/point/src/tpoint_distance.c @@ -29,7 +29,7 @@ * Distance functions for temporal points. */ -#include "tpoint_distance.h" +#include "point/tpoint_distance.h" #include #include @@ -44,12 +44,12 @@ #include "general/period.h" #include "general/timeops.h" #include "general/temporaltypes.h" -#include "postgis.h" -#include "geography_funcs.h" -#include "tpoint.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialrels.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/geography_funcs.h" +#include "point/tpoint.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialrels.h" +#include "point/tpoint_spatialfuncs.h" /*****************************************************************************/ diff --git a/point/src/tpoint_gist.c b/point/src/tpoint_gist.c index 98dbe8a8ad..4a2fe750a0 100644 --- a/point/src/tpoint_gist.c +++ b/point/src/tpoint_gist.c @@ -29,7 +29,7 @@ * R-tree GiST index for temporal points. */ -#include "tpoint_gist.h" +#include "point/tpoint_gist.h" #include #include @@ -43,11 +43,11 @@ #include "general/time_gist.h" #include "general/temporaltypes.h" #include "general/tempcache.h" -#include "tpoint.h" +#include "point/tpoint.h" #include "general/tnumber_gist.h" -#include "tpoint_boxops.h" -#include "tpoint_distance.h" -#include "tpoint_posops.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_distance.h" +#include "point/tpoint_posops.h" /***************************************************************************** * GiST consistent methods diff --git a/point/src/tpoint_in.c b/point/src/tpoint_in.c index 4dc565d90b..ee834ffc2f 100644 --- a/point/src/tpoint_in.c +++ b/point/src/tpoint_in.c @@ -29,7 +29,7 @@ * Input of temporal points in WKT, EWKT and MF-JSON format */ -#include "tpoint_in.h" +#include "point/tpoint_in.h" #include #include @@ -38,10 +38,10 @@ #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/temporal_util.h" -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_parser.h" -#include "tpoint_spatialfuncs.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_parser.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Input in MFJSON format diff --git a/point/src/tpoint_out.c b/point/src/tpoint_out.c index 75052208c8..88cf75b335 100644 --- a/point/src/tpoint_out.c +++ b/point/src/tpoint_out.c @@ -29,7 +29,7 @@ * Output of temporal points in WKT, EWKT, WKB, EWKB, and MF-JSON format */ -#include "tpoint_out.h" +#include "point/tpoint_out.h" #include #include @@ -38,8 +38,8 @@ #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/temporal_util.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /* The following definitions are taken from PostGIS */ diff --git a/point/src/tpoint_parser.c b/point/src/tpoint_parser.c index 12039c48ff..bbf9e86f58 100644 --- a/point/src/tpoint_parser.c +++ b/point/src/tpoint_parser.c @@ -29,15 +29,15 @@ * Functions for parsing temporal points. */ -#include "tpoint_parser.h" +#include "point/tpoint_parser.h" #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/tempcache.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" #include "general/temporal_parser.h" -#include "stbox.h" +#include "point/stbox.h" /*****************************************************************************/ diff --git a/point/src/tpoint_posops.c b/point/src/tpoint_posops.c index 859cb1eba4..de9bdbfeb0 100644 --- a/point/src/tpoint_posops.c +++ b/point/src/tpoint_posops.c @@ -41,14 +41,14 @@ * `STBOX`. */ -#include "tpoint_posops.h" +#include "point/tpoint_posops.h" #include -#include "postgis.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_boxops.h" +#include "point/postgis.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_boxops.h" /*****************************************************************************/ /* geom op Temporal */ diff --git a/point/src/tpoint_selfuncs.c b/point/src/tpoint_selfuncs.c index 01a71175b9..e4676ae7cd 100644 --- a/point/src/tpoint_selfuncs.c +++ b/point/src/tpoint_selfuncs.c @@ -29,17 +29,17 @@ * Functions for selectivity estimation of operators on temporal points */ -#include "tpoint_selfuncs.h" +#include "point/tpoint_selfuncs.h" #include #include #include "general/period.h" #include "general/temporal_selfuncs.h" -#include "stbox.h" -#include "tpoint.h" -#include "tpoint_analyze.h" -#include "tpoint_boxops.h" +#include "point/stbox.h" +#include "point/tpoint.h" +#include "point/tpoint_analyze.h" +#include "point/tpoint_boxops.h" /***************************************************************************** * PostGIS functions copied from the file gserialized_estimate.c since they diff --git a/point/src/tpoint_spatialfuncs.c b/point/src/tpoint_spatialfuncs.c index f433841d6b..b1f5667703 100644 --- a/point/src/tpoint_spatialfuncs.c +++ b/point/src/tpoint_spatialfuncs.c @@ -29,7 +29,7 @@ * Spatial functions for temporal points. */ -#include "tpoint_spatialfuncs.h" +#include "point/tpoint_spatialfuncs.h" #include #include @@ -41,11 +41,11 @@ #include "general/tempcache.h" #include "general/tnumber_mathfuncs.h" -#include "postgis.h" -#include "stbox.h" -#include "tpoint.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialrels.h" +#include "point/postgis.h" +#include "point/stbox.h" +#include "point/tpoint.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialrels.h" /***************************************************************************** * PostGIS cache functions diff --git a/point/src/tpoint_spatialrels.c b/point/src/tpoint_spatialrels.c index 362b5aedae..3cc1f713ec 100644 --- a/point/src/tpoint_spatialrels.c +++ b/point/src/tpoint_spatialrels.c @@ -44,15 +44,15 @@ * Only `dwithin` and `intersects` are supported for 3D geometries. */ -#include "tpoint_spatialrels.h" +#include "point/tpoint_spatialrels.h" #include #include "general/temporaltypes.h" #include "general/tempcache.h" #include "general/temporal_util.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_distance.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_distance.h" /***************************************************************************** * Spatial relationship functions diff --git a/point/src/tpoint_spgist.c b/point/src/tpoint_spgist.c index cec6212bd5..1b9849eeb1 100644 --- a/point/src/tpoint_spgist.c +++ b/point/src/tpoint_spgist.c @@ -91,7 +91,7 @@ #if POSTGRESQL_VERSION_NUMBER >= 110000 -#include "tpoint_spgist.h" +#include "point/tpoint_spgist.h" #include #include @@ -108,10 +108,10 @@ #include "general/temporal_util.h" #include "general/tempcache.h" #include "general/tnumber_spgist.h" -#include "tpoint.h" -#include "tpoint_boxops.h" -#include "tpoint_distance.h" -#include "tpoint_gist.h" +#include "point/tpoint.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_distance.h" +#include "point/tpoint_gist.h" #if POSTGRESQL_VERSION_NUMBER >= 120000 /* To avoid including "access/spgist_private.h" since it conflicts with the diff --git a/point/src/tpoint_tempspatialrels.c b/point/src/tpoint_tempspatialrels.c index fa24bfbc24..580d73a0c3 100644 --- a/point/src/tpoint_tempspatialrels.c +++ b/point/src/tpoint_tempspatialrels.c @@ -64,7 +64,7 @@ * which amounts to solve the equation distance(seg1(t), seg2(t)) = d. */ -#include "tpoint_tempspatialrels.h" +#include "point/tpoint_tempspatialrels.h" #include #include @@ -75,9 +75,9 @@ #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/tbool_boolops.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" -#include "tpoint_spatialrels.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" +#include "point/tpoint_spatialrels.h" /***************************************************************************** * Generic functions for computing the temporal spatial relationships diff --git a/point/src/tpoint_tile.c b/point/src/tpoint_tile.c index 3ac765eb5f..b61144424c 100644 --- a/point/src/tpoint_tile.c +++ b/point/src/tpoint_tile.c @@ -37,14 +37,14 @@ #endif #include -#include "tpoint_tile.h" +#include "point/tpoint_tile.h" #include "general/period.h" #include "general/timeops.h" #include "general/temporal.h" #include "general/temporal_util.h" #include "general/temporal_tile.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Grid functions diff --git a/src/temporal.c b/src/temporal.c index da4b662da2..6d13a060ef 100644 --- a/src/temporal.c +++ b/src/temporal.c @@ -57,7 +57,7 @@ #include "general/temporal_parser.h" #include "general/rangetypes_ext.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint_static.h" #include "tnpoint_spatialfuncs.h" diff --git a/src/temporal_boxops.c b/src/temporal_boxops.c index 1aa8893214..2ca0ee8d98 100644 --- a/src/temporal_boxops.c +++ b/src/temporal_boxops.c @@ -55,9 +55,9 @@ #include "general/temporal_util.h" #include "general/rangetypes_ext.h" #include "general/tbox.h" -#include "tpoint.h" -#include "stbox.h" -#include "tpoint_boxops.h" +#include "point/tpoint.h" +#include "point/stbox.h" +#include "point/tpoint_boxops.h" #include "tnpoint_boxops.h" /***************************************************************************** diff --git a/src/temporal_compops.c b/src/temporal_compops.c index 276e3794fa..7f8282a34f 100644 --- a/src/temporal_compops.c +++ b/src/temporal_compops.c @@ -36,7 +36,7 @@ #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/lifting.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * Generic dispatch function diff --git a/src/temporal_selfuncs.c b/src/temporal_selfuncs.c index d36890f09e..bbcddc341f 100644 --- a/src/temporal_selfuncs.c +++ b/src/temporal_selfuncs.c @@ -74,7 +74,7 @@ #include "general/time_selfuncs.h" #include "general/rangetypes_ext.h" #include "general/temporal_analyze.h" -#include "tpoint.h" +#include "point/tpoint.h" /***************************************************************************** * This function is exported only after PostgreSQL version 12 diff --git a/src/temporal_util.c b/src/temporal_util.c index 8318e90f8f..d14280fa4a 100644 --- a/src/temporal_util.c +++ b/src/temporal_util.c @@ -44,8 +44,8 @@ #include "general/tempcache.h" #include "general/doublen.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint_static.h" diff --git a/src/tinstant.c b/src/tinstant.c index c051102332..a9d0d873c7 100644 --- a/src/tinstant.c +++ b/src/tinstant.c @@ -48,8 +48,8 @@ #include "general/temporal_boxops.h" #include "general/rangetypes_ext.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * General functions diff --git a/src/tinstantset.c b/src/tinstantset.c index 93fb9276f5..9cf41ca0ce 100644 --- a/src/tinstantset.c +++ b/src/tinstantset.c @@ -48,8 +48,8 @@ #include "general/temporal_boxops.h" #include "general/rangetypes_ext.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * General functions diff --git a/src/tsequence.c b/src/tsequence.c index 35a3fd21b1..553903adf8 100644 --- a/src/tsequence.c +++ b/src/tsequence.c @@ -50,9 +50,9 @@ #include "general/temporal_boxops.h" #include "general/rangetypes_ext.h" -#include "tpoint.h" -#include "tpoint_boxops.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_boxops.h" +#include "point/tpoint_spatialfuncs.h" #include "tnpoint_spatialfuncs.h" diff --git a/src/tsequenceset.c b/src/tsequenceset.c index c87b4bb73b..b04901eb6c 100644 --- a/src/tsequenceset.c +++ b/src/tsequenceset.c @@ -47,8 +47,8 @@ #include "general/temporal_boxops.h" #include "general/rangetypes_ext.h" -#include "tpoint.h" -#include "tpoint_spatialfuncs.h" +#include "point/tpoint.h" +#include "point/tpoint_spatialfuncs.h" /***************************************************************************** * General functions From 6a5b1aea14891088884c840b8d9b85cbad665ca2 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:24:35 -0500 Subject: [PATCH 06/22] [inlcude] organizing subdirectory npoint --- {npoint/include => include/npoint}/tnpoint.h | 0 {npoint/include => include/npoint}/tnpoint_aggfuncs.h | 0 {npoint/include => include/npoint}/tnpoint_analyze.h | 0 {npoint/include => include/npoint}/tnpoint_boxops.h | 0 {npoint/include => include/npoint}/tnpoint_distance.h | 0 {npoint/include => include/npoint}/tnpoint_indexes.h | 0 {npoint/include => include/npoint}/tnpoint_parser.h | 0 {npoint/include => include/npoint}/tnpoint_posops.h | 0 {npoint/include => include/npoint}/tnpoint_selfuncs.h | 0 {npoint/include => include/npoint}/tnpoint_spatialfuncs.h | 0 {npoint/include => include/npoint}/tnpoint_spatialrels.h | 0 {npoint/include => include/npoint}/tnpoint_static.h | 0 {npoint/include => include/npoint}/tnpoint_tempspatialrels.h | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename {npoint/include => include/npoint}/tnpoint.h (100%) rename {npoint/include => include/npoint}/tnpoint_aggfuncs.h (100%) rename {npoint/include => include/npoint}/tnpoint_analyze.h (100%) rename {npoint/include => include/npoint}/tnpoint_boxops.h (100%) rename {npoint/include => include/npoint}/tnpoint_distance.h (100%) rename {npoint/include => include/npoint}/tnpoint_indexes.h (100%) rename {npoint/include => include/npoint}/tnpoint_parser.h (100%) rename {npoint/include => include/npoint}/tnpoint_posops.h (100%) rename {npoint/include => include/npoint}/tnpoint_selfuncs.h (100%) rename {npoint/include => include/npoint}/tnpoint_spatialfuncs.h (100%) rename {npoint/include => include/npoint}/tnpoint_spatialrels.h (100%) rename {npoint/include => include/npoint}/tnpoint_static.h (100%) rename {npoint/include => include/npoint}/tnpoint_tempspatialrels.h (100%) diff --git a/npoint/include/tnpoint.h b/include/npoint/tnpoint.h similarity index 100% rename from npoint/include/tnpoint.h rename to include/npoint/tnpoint.h diff --git a/npoint/include/tnpoint_aggfuncs.h b/include/npoint/tnpoint_aggfuncs.h similarity index 100% rename from npoint/include/tnpoint_aggfuncs.h rename to include/npoint/tnpoint_aggfuncs.h diff --git a/npoint/include/tnpoint_analyze.h b/include/npoint/tnpoint_analyze.h similarity index 100% rename from npoint/include/tnpoint_analyze.h rename to include/npoint/tnpoint_analyze.h diff --git a/npoint/include/tnpoint_boxops.h b/include/npoint/tnpoint_boxops.h similarity index 100% rename from npoint/include/tnpoint_boxops.h rename to include/npoint/tnpoint_boxops.h diff --git a/npoint/include/tnpoint_distance.h b/include/npoint/tnpoint_distance.h similarity index 100% rename from npoint/include/tnpoint_distance.h rename to include/npoint/tnpoint_distance.h diff --git a/npoint/include/tnpoint_indexes.h b/include/npoint/tnpoint_indexes.h similarity index 100% rename from npoint/include/tnpoint_indexes.h rename to include/npoint/tnpoint_indexes.h diff --git a/npoint/include/tnpoint_parser.h b/include/npoint/tnpoint_parser.h similarity index 100% rename from npoint/include/tnpoint_parser.h rename to include/npoint/tnpoint_parser.h diff --git a/npoint/include/tnpoint_posops.h b/include/npoint/tnpoint_posops.h similarity index 100% rename from npoint/include/tnpoint_posops.h rename to include/npoint/tnpoint_posops.h diff --git a/npoint/include/tnpoint_selfuncs.h b/include/npoint/tnpoint_selfuncs.h similarity index 100% rename from npoint/include/tnpoint_selfuncs.h rename to include/npoint/tnpoint_selfuncs.h diff --git a/npoint/include/tnpoint_spatialfuncs.h b/include/npoint/tnpoint_spatialfuncs.h similarity index 100% rename from npoint/include/tnpoint_spatialfuncs.h rename to include/npoint/tnpoint_spatialfuncs.h diff --git a/npoint/include/tnpoint_spatialrels.h b/include/npoint/tnpoint_spatialrels.h similarity index 100% rename from npoint/include/tnpoint_spatialrels.h rename to include/npoint/tnpoint_spatialrels.h diff --git a/npoint/include/tnpoint_static.h b/include/npoint/tnpoint_static.h similarity index 100% rename from npoint/include/tnpoint_static.h rename to include/npoint/tnpoint_static.h diff --git a/npoint/include/tnpoint_tempspatialrels.h b/include/npoint/tnpoint_tempspatialrels.h similarity index 100% rename from npoint/include/tnpoint_tempspatialrels.h rename to include/npoint/tnpoint_tempspatialrels.h From bd8b35408e1299354d0170e0bde446eff60cde25 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:25:02 -0500 Subject: [PATCH 07/22] [src] adjusted to include/npoint location --- npoint/src/tnpoint.c | 6 +++--- npoint/src/tnpoint_aggfuncs.c | 4 ++-- npoint/src/tnpoint_analyze.c | 4 ++-- npoint/src/tnpoint_boxops.c | 8 ++++---- npoint/src/tnpoint_distance.c | 10 +++++----- npoint/src/tnpoint_indexes.c | 4 ++-- npoint/src/tnpoint_parser.c | 6 +++--- npoint/src/tnpoint_posops.c | 10 +++++----- npoint/src/tnpoint_selfuncs.c | 2 +- npoint/src/tnpoint_spatialfuncs.c | 10 +++++----- npoint/src/tnpoint_spatialrels.c | 8 ++++---- npoint/src/tnpoint_static.c | 6 +++--- npoint/src/tnpoint_tempspatialrels.c | 10 +++++----- point/src/tpoint_analyze.c | 2 +- src/temporal.c | 4 ++-- src/temporal_boxops.c | 2 +- src/temporal_util.c | 2 +- src/tsequence.c | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/npoint/src/tnpoint.c b/npoint/src/tnpoint.c index c96afa3cdb..cd0dc644e1 100644 --- a/npoint/src/tnpoint.c +++ b/npoint/src/tnpoint.c @@ -29,7 +29,7 @@ * Basic functions for temporal network points. */ -#include "tnpoint.h" +#include "npoint/tnpoint.h" #include @@ -40,8 +40,8 @@ #include "general/lifting.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint_static.h" -#include "tnpoint_parser.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_parser.h" /***************************************************************************** * Input/output functions diff --git a/npoint/src/tnpoint_aggfuncs.c b/npoint/src/tnpoint_aggfuncs.c index 14f721ac3e..2da7a06648 100644 --- a/npoint/src/tnpoint_aggfuncs.c +++ b/npoint/src/tnpoint_aggfuncs.c @@ -31,7 +31,7 @@ * The only function currently provided is temporal centroid. */ -#include "tnpoint_aggfuncs.h" +#include "npoint/tnpoint_aggfuncs.h" #include @@ -39,7 +39,7 @@ #include "point/tpoint.h" #include "point/tpoint_spatialfuncs.h" #include "point/tpoint_aggfuncs.h" -#include "tnpoint.h" +#include "npoint/tnpoint.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint_analyze.c b/npoint/src/tnpoint_analyze.c index c6d88aa493..fbdc47bcda 100644 --- a/npoint/src/tnpoint_analyze.c +++ b/npoint/src/tnpoint_analyze.c @@ -29,7 +29,7 @@ * Functions for gathering statistics from temporal network point columns */ -#include "tnpoint_analyze.h" +#include "npoint/tnpoint_analyze.h" #include @@ -41,7 +41,7 @@ #include "point/tpoint.h" #include "point/tpoint_selfuncs.h" #include "point/tpoint_analyze.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_spatialfuncs.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint_boxops.c b/npoint/src/tnpoint_boxops.c index 952cb1bbda..8f96cd659a 100644 --- a/npoint/src/tnpoint_boxops.c +++ b/npoint/src/tnpoint_boxops.c @@ -36,7 +36,7 @@ * the space and the time dimensions. */ -#include "tnpoint_boxops.h" +#include "npoint/tnpoint_boxops.h" #include @@ -45,9 +45,9 @@ #include "point/stbox.h" #include "point/tpoint_boxops.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_spatialfuncs.h" /***************************************************************************** * Transform a temporal npoint to a STBOX diff --git a/npoint/src/tnpoint_distance.c b/npoint/src/tnpoint_distance.c index dd2357be26..5818518722 100644 --- a/npoint/src/tnpoint_distance.c +++ b/npoint/src/tnpoint_distance.c @@ -29,17 +29,17 @@ * Temporal distance for temporal network points. */ -#include "tnpoint_distance.h" +#include "npoint/tnpoint_distance.h" #include "general/temporaltypes.h" #include "general/temporal_util.h" #include "general/lifting.h" #include "point/tpoint_spatialfuncs.h" #include "point/tpoint_distance.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_spatialfuncs.h" -#include "tnpoint_tempspatialrels.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_tempspatialrels.h" /***************************************************************************** * Temporal distance diff --git a/npoint/src/tnpoint_indexes.c b/npoint/src/tnpoint_indexes.c index 8b32c2f104..ceeff2157a 100644 --- a/npoint/src/tnpoint_indexes.c +++ b/npoint/src/tnpoint_indexes.c @@ -29,11 +29,11 @@ * R-tree GiST and SP-GiST indexes for temporal network points. */ -#include "tnpoint_indexes.h" +#include "npoint/tnpoint_indexes.h" #include #include "point/tpoint.h" -#include "tnpoint.h" +#include "npoint/tnpoint.h" /***************************************************************************** * GiST compress function diff --git a/npoint/src/tnpoint_parser.c b/npoint/src/tnpoint_parser.c index 831b826ba7..c0f14eb61d 100644 --- a/npoint/src/tnpoint_parser.c +++ b/npoint/src/tnpoint_parser.c @@ -29,12 +29,12 @@ * Functions for parsing static network types. */ -#include "tnpoint_parser.h" +#include "npoint/tnpoint_parser.h" #include "general/temporaltypes.h" #include "general/temporal_parser.h" -#include "tnpoint.h" -#include "tnpoint_static.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" /*****************************************************************************/ diff --git a/npoint/src/tnpoint_posops.c b/npoint/src/tnpoint_posops.c index 943ee267a4..9f9ec6281c 100644 --- a/npoint/src/tnpoint_posops.c +++ b/npoint/src/tnpoint_posops.c @@ -40,7 +40,7 @@ * arguments is a stbox. */ -#include "tnpoint_posops.h" +#include "npoint/tnpoint_posops.h" #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 @@ -49,10 +49,10 @@ #include "point/tpoint_boxops.h" #include "point/tpoint_posops.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_boxops.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_boxops.h" +#include "npoint/tnpoint_spatialfuncs.h" /***************************************************************************** * Generic box functions diff --git a/npoint/src/tnpoint_selfuncs.c b/npoint/src/tnpoint_selfuncs.c index 72b27b5812..4824942b9c 100644 --- a/npoint/src/tnpoint_selfuncs.c +++ b/npoint/src/tnpoint_selfuncs.c @@ -31,7 +31,7 @@ * These functions are only stubs, they need to be written TODO */ -#include "tnpoint_selfuncs.h" +#include "npoint/tnpoint_selfuncs.h" /* * Selectivity functions for temporal types operators. These are bogus -- diff --git a/npoint/src/tnpoint_spatialfuncs.c b/npoint/src/tnpoint_spatialfuncs.c index 149a4c46c6..dcb2fe1f0b 100644 --- a/npoint/src/tnpoint_spatialfuncs.c +++ b/npoint/src/tnpoint_spatialfuncs.c @@ -29,7 +29,7 @@ * Geospatial functions for temporal network points. */ -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_spatialfuncs.h" #include #include @@ -42,10 +42,10 @@ #include "point/tpoint_spatialfuncs.h" #include "point/tpoint_distance.h" #include "point/tpoint_boxops.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_distance.h" -#include "tnpoint_tempspatialrels.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_distance.h" +#include "npoint/tnpoint_tempspatialrels.h" /***************************************************************************** * Parameter tests diff --git a/npoint/src/tnpoint_spatialrels.c b/npoint/src/tnpoint_spatialrels.c index 7a828369ce..90525ff85f 100644 --- a/npoint/src/tnpoint_spatialrels.c +++ b/npoint/src/tnpoint_spatialrels.c @@ -35,13 +35,13 @@ * contains, disjoint, intersects, touches, and dwithin */ -#include "tnpoint_spatialrels.h" +#include "npoint/tnpoint_spatialrels.h" #include "general/lifting.h" #include "point/tpoint_spatialrels.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_spatialfuncs.h" /***************************************************************************** * Generic binary functions for tnpoint geo diff --git a/npoint/src/tnpoint_static.c b/npoint/src/tnpoint_static.c index 8cb4d296cb..1c8b205c20 100644 --- a/npoint/src/tnpoint_static.c +++ b/npoint/src/tnpoint_static.c @@ -32,7 +32,7 @@ * They are kept if needed in the future. */ -#include "tnpoint_static.h" +#include "npoint/tnpoint_static.h" #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 @@ -48,8 +48,8 @@ #include "point/tpoint_out.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint.h" -#include "tnpoint_parser.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_parser.h" /** Buffer size for input and output of npoint values */ #define MAXNPOINTLEN 128 diff --git a/npoint/src/tnpoint_tempspatialrels.c b/npoint/src/tnpoint_tempspatialrels.c index 091a56671d..5a75f3ceed 100644 --- a/npoint/src/tnpoint_tempspatialrels.c +++ b/npoint/src/tnpoint_tempspatialrels.c @@ -33,7 +33,7 @@ * tcontains, tdisjoint, tintersects, ttouches, and tdwithin */ -#include "tnpoint_tempspatialrels.h" +#include "npoint/tnpoint_tempspatialrels.h" #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 @@ -46,10 +46,10 @@ #include "point/tpoint_spatialfuncs.h" #include "point/tpoint_spatialrels.h" #include "point/tpoint_tempspatialrels.h" -#include "tnpoint.h" -#include "tnpoint_static.h" -#include "tnpoint_spatialfuncs.h" -#include "tnpoint_distance.h" +#include "npoint/tnpoint.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_distance.h" /***************************************************************************** * Generic functions diff --git a/point/src/tpoint_analyze.c b/point/src/tpoint_analyze.c index 09a0627256..90142b8621 100644 --- a/point/src/tpoint_analyze.c +++ b/point/src/tpoint_analyze.c @@ -66,7 +66,7 @@ #include "point/postgis.h" #include "point/tpoint.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_spatialfuncs.h" /***************************************************************************** * Functions copied from PostGIS file gserialized_estimate.c diff --git a/src/temporal.c b/src/temporal.c index 6d13a060ef..fb5c978c37 100644 --- a/src/temporal.c +++ b/src/temporal.c @@ -58,8 +58,8 @@ #include "general/rangetypes_ext.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint_static.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_static.h" +#include "npoint/tnpoint_spatialfuncs.h" /* * This is required in a SINGLE file for builds against pgsql diff --git a/src/temporal_boxops.c b/src/temporal_boxops.c index 2ca0ee8d98..5b6e8ed3dc 100644 --- a/src/temporal_boxops.c +++ b/src/temporal_boxops.c @@ -58,7 +58,7 @@ #include "point/tpoint.h" #include "point/stbox.h" #include "point/tpoint_boxops.h" -#include "tnpoint_boxops.h" +#include "npoint/tnpoint_boxops.h" /***************************************************************************** * Functions on generic bounding boxes of temporal types diff --git a/src/temporal_util.c b/src/temporal_util.c index d14280fa4a..b04534d274 100644 --- a/src/temporal_util.c +++ b/src/temporal_util.c @@ -47,7 +47,7 @@ #include "point/tpoint.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint_static.h" +#include "npoint/tnpoint_static.h" /***************************************************************************** * Temporal/base types tests diff --git a/src/tsequence.c b/src/tsequence.c index 553903adf8..bbfeff3c65 100644 --- a/src/tsequence.c +++ b/src/tsequence.c @@ -54,7 +54,7 @@ #include "point/tpoint_boxops.h" #include "point/tpoint_spatialfuncs.h" -#include "tnpoint_spatialfuncs.h" +#include "npoint/tnpoint_spatialfuncs.h" /***************************************************************************** * Compute the intersection, if any, of a segment of a temporal sequence and From 4b2cd16533e1b8e45f559b8b7de46daf2866bdb6 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 20:37:46 -0500 Subject: [PATCH 08/22] [build] removing useless include_directories and grouping mobilitydb parts --- CMakeLists.txt | 29 ++++++++++++++++++++--------- npoint/npoint.cmake | 2 -- point/point.cmake | 2 -- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a9f7189ed..51024a8f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,9 +88,6 @@ endif() #-------------------------------- -include_directories("include") -#-------------------------------- - add_definitions(-Wall -Wextra -std=gnu1x -Wno-unused-parameter) if (CMAKE_COMPILER_IS_GNUCC) if (WITH_COVERAGE) @@ -111,7 +108,6 @@ set(MOBILITYDB_EXTENSION_FILE "${MOBILITYDB_LOWERCASE_NAME}--${MOBILITYDB_VERSIO add_custom_target(sqlscript ALL DEPENDS ${CMAKE_BINARY_DIR}/${MOBILITYDB_EXTENSION_FILE}) add_custom_target(control ALL DEPENDS ${CMAKE_BINARY_DIR}/${CONTROLOUT}) -add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS}) if (APPLE) SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup -bundle_loader /usr/local/bin/postgres") @@ -122,6 +118,15 @@ find_package(POSTGIS 2.5 EXACT REQUIRED) add_definitions(-DPOSTGIS_VERSION_STR="${POSTGIS_VERSION_STR}") add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) + +#-------------------------------- +# Belongs to MobilityDB +# Must go before target_link_libraries + +add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS}) + +#-------------------------------- + find_package(JSON-C REQUIRED) include_directories(${JSON-C_INCLUDE_DIRS}) target_link_libraries(${CMAKE_PROJECT_NAME} ${JSON-C_LIBRARIES}) @@ -138,18 +143,24 @@ find_package(GSL REQUIRED) target_link_libraries(${CMAKE_PROJECT_NAME} ${GSL_LIBRARY}) target_link_libraries(${CMAKE_PROJECT_NAME} ${GSL_CLBAS_LIBRARY}) +check_symbol_exists(ffsl "string.h" HAS_FFSL) +if(NOT HAS_FFSL) + add_definitions(-D NO_FFSL) +endif() + +#-------------------------------- +# Belongs to MobilityDB -add_subdirectory(test) +include_directories("include") include("point/point.cmake") include("npoint/npoint.cmake") -check_symbol_exists(ffsl "string.h" HAS_FFSL) -if(NOT HAS_FFSL) - add_definitions(-D NO_FFSL) -endif() +add_subdirectory(test) + add_subdirectory(sql) + add_custom_command( OUTPUT ${CONTROLOUT} COMMAND cat ${CONTROLIN} | sed -e's/LIBNAME/${CMAKE_PROJECT_NAME}/' -e's/VERSION/${MOBILITYDB_VERSION}/' > ${CMAKE_BINARY_DIR}/${CONTROLOUT} diff --git a/npoint/npoint.cmake b/npoint/npoint.cmake index 5dd3544258..3a4db3120e 100644 --- a/npoint/npoint.cmake +++ b/npoint/npoint.cmake @@ -1,7 +1,5 @@ add_definitions(-DWITH_POSTGIS) -include_directories("npoint/include") - set(SRCNPOINT npoint/src/tnpoint.c npoint/src/tnpoint_aggfuncs.c diff --git a/point/point.cmake b/point/point.cmake index cf8c93c130..aee0576d1d 100644 --- a/point/point.cmake +++ b/point/point.cmake @@ -1,7 +1,5 @@ add_definitions(-DWITH_POSTGIS) -include_directories("point/include") - set(SRCPOINT point/src/stbox.c point/src/tpoint_aggfuncs.c From 635f3d674efcabc943a4f6e224ac45ee04bceebb Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:04:13 -0500 Subject: [PATCH 09/22] [src] Organizing general subdirectory --- src/{ => general}/doublen.c | 0 src/{ => general}/geo_constructors.c | 0 src/{ => general}/lifting.c | 0 src/{ => general}/period.c | 0 src/{ => general}/periodset.c | 0 src/{ => general}/rangetypes_ext.c | 0 src/{ => general}/skiplist.c | 0 src/{ => general}/tbool_boolops.c | 0 src/{ => general}/tbox.c | 0 src/{ => general}/tempcache.c | 0 src/{ => general}/temporal.c | 0 src/{ => general}/temporal_aggfuncs.c | 0 src/{ => general}/temporal_analyze.c | 0 src/{ => general}/temporal_boxops.c | 0 src/{ => general}/temporal_compops.c | 0 src/{ => general}/temporal_gist.c | 0 src/{ => general}/temporal_parser.c | 0 src/{ => general}/temporal_posops.c | 0 src/{ => general}/temporal_selfuncs.c | 0 src/{ => general}/temporal_spgist.c | 0 src/{ => general}/temporal_tile.c | 0 src/{ => general}/temporal_util.c | 0 src/{ => general}/temporal_waggfuncs.c | 0 src/{ => general}/time_aggfuncs.c | 0 src/{ => general}/time_analyze.c | 0 src/{ => general}/time_gist.c | 0 src/{ => general}/time_selfuncs.c | 0 src/{ => general}/time_spgist.c | 0 src/{ => general}/timeops.c | 0 src/{ => general}/timestampset.c | 0 src/{ => general}/tinstant.c | 0 src/{ => general}/tinstantset.c | 0 src/{ => general}/tnumber_distance.c | 0 src/{ => general}/tnumber_gist.c | 0 src/{ => general}/tnumber_mathfuncs.c | 0 src/{ => general}/tnumber_selfuncs.c | 0 src/{ => general}/tnumber_spgist.c | 0 src/{ => general}/tsequence.c | 0 src/{ => general}/tsequenceset.c | 0 src/{ => general}/ttext_textfuncs.c | 0 40 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => general}/doublen.c (100%) rename src/{ => general}/geo_constructors.c (100%) rename src/{ => general}/lifting.c (100%) rename src/{ => general}/period.c (100%) rename src/{ => general}/periodset.c (100%) rename src/{ => general}/rangetypes_ext.c (100%) rename src/{ => general}/skiplist.c (100%) rename src/{ => general}/tbool_boolops.c (100%) rename src/{ => general}/tbox.c (100%) rename src/{ => general}/tempcache.c (100%) rename src/{ => general}/temporal.c (100%) rename src/{ => general}/temporal_aggfuncs.c (100%) rename src/{ => general}/temporal_analyze.c (100%) rename src/{ => general}/temporal_boxops.c (100%) rename src/{ => general}/temporal_compops.c (100%) rename src/{ => general}/temporal_gist.c (100%) rename src/{ => general}/temporal_parser.c (100%) rename src/{ => general}/temporal_posops.c (100%) rename src/{ => general}/temporal_selfuncs.c (100%) rename src/{ => general}/temporal_spgist.c (100%) rename src/{ => general}/temporal_tile.c (100%) rename src/{ => general}/temporal_util.c (100%) rename src/{ => general}/temporal_waggfuncs.c (100%) rename src/{ => general}/time_aggfuncs.c (100%) rename src/{ => general}/time_analyze.c (100%) rename src/{ => general}/time_gist.c (100%) rename src/{ => general}/time_selfuncs.c (100%) rename src/{ => general}/time_spgist.c (100%) rename src/{ => general}/timeops.c (100%) rename src/{ => general}/timestampset.c (100%) rename src/{ => general}/tinstant.c (100%) rename src/{ => general}/tinstantset.c (100%) rename src/{ => general}/tnumber_distance.c (100%) rename src/{ => general}/tnumber_gist.c (100%) rename src/{ => general}/tnumber_mathfuncs.c (100%) rename src/{ => general}/tnumber_selfuncs.c (100%) rename src/{ => general}/tnumber_spgist.c (100%) rename src/{ => general}/tsequence.c (100%) rename src/{ => general}/tsequenceset.c (100%) rename src/{ => general}/ttext_textfuncs.c (100%) diff --git a/src/doublen.c b/src/general/doublen.c similarity index 100% rename from src/doublen.c rename to src/general/doublen.c diff --git a/src/geo_constructors.c b/src/general/geo_constructors.c similarity index 100% rename from src/geo_constructors.c rename to src/general/geo_constructors.c diff --git a/src/lifting.c b/src/general/lifting.c similarity index 100% rename from src/lifting.c rename to src/general/lifting.c diff --git a/src/period.c b/src/general/period.c similarity index 100% rename from src/period.c rename to src/general/period.c diff --git a/src/periodset.c b/src/general/periodset.c similarity index 100% rename from src/periodset.c rename to src/general/periodset.c diff --git a/src/rangetypes_ext.c b/src/general/rangetypes_ext.c similarity index 100% rename from src/rangetypes_ext.c rename to src/general/rangetypes_ext.c diff --git a/src/skiplist.c b/src/general/skiplist.c similarity index 100% rename from src/skiplist.c rename to src/general/skiplist.c diff --git a/src/tbool_boolops.c b/src/general/tbool_boolops.c similarity index 100% rename from src/tbool_boolops.c rename to src/general/tbool_boolops.c diff --git a/src/tbox.c b/src/general/tbox.c similarity index 100% rename from src/tbox.c rename to src/general/tbox.c diff --git a/src/tempcache.c b/src/general/tempcache.c similarity index 100% rename from src/tempcache.c rename to src/general/tempcache.c diff --git a/src/temporal.c b/src/general/temporal.c similarity index 100% rename from src/temporal.c rename to src/general/temporal.c diff --git a/src/temporal_aggfuncs.c b/src/general/temporal_aggfuncs.c similarity index 100% rename from src/temporal_aggfuncs.c rename to src/general/temporal_aggfuncs.c diff --git a/src/temporal_analyze.c b/src/general/temporal_analyze.c similarity index 100% rename from src/temporal_analyze.c rename to src/general/temporal_analyze.c diff --git a/src/temporal_boxops.c b/src/general/temporal_boxops.c similarity index 100% rename from src/temporal_boxops.c rename to src/general/temporal_boxops.c diff --git a/src/temporal_compops.c b/src/general/temporal_compops.c similarity index 100% rename from src/temporal_compops.c rename to src/general/temporal_compops.c diff --git a/src/temporal_gist.c b/src/general/temporal_gist.c similarity index 100% rename from src/temporal_gist.c rename to src/general/temporal_gist.c diff --git a/src/temporal_parser.c b/src/general/temporal_parser.c similarity index 100% rename from src/temporal_parser.c rename to src/general/temporal_parser.c diff --git a/src/temporal_posops.c b/src/general/temporal_posops.c similarity index 100% rename from src/temporal_posops.c rename to src/general/temporal_posops.c diff --git a/src/temporal_selfuncs.c b/src/general/temporal_selfuncs.c similarity index 100% rename from src/temporal_selfuncs.c rename to src/general/temporal_selfuncs.c diff --git a/src/temporal_spgist.c b/src/general/temporal_spgist.c similarity index 100% rename from src/temporal_spgist.c rename to src/general/temporal_spgist.c diff --git a/src/temporal_tile.c b/src/general/temporal_tile.c similarity index 100% rename from src/temporal_tile.c rename to src/general/temporal_tile.c diff --git a/src/temporal_util.c b/src/general/temporal_util.c similarity index 100% rename from src/temporal_util.c rename to src/general/temporal_util.c diff --git a/src/temporal_waggfuncs.c b/src/general/temporal_waggfuncs.c similarity index 100% rename from src/temporal_waggfuncs.c rename to src/general/temporal_waggfuncs.c diff --git a/src/time_aggfuncs.c b/src/general/time_aggfuncs.c similarity index 100% rename from src/time_aggfuncs.c rename to src/general/time_aggfuncs.c diff --git a/src/time_analyze.c b/src/general/time_analyze.c similarity index 100% rename from src/time_analyze.c rename to src/general/time_analyze.c diff --git a/src/time_gist.c b/src/general/time_gist.c similarity index 100% rename from src/time_gist.c rename to src/general/time_gist.c diff --git a/src/time_selfuncs.c b/src/general/time_selfuncs.c similarity index 100% rename from src/time_selfuncs.c rename to src/general/time_selfuncs.c diff --git a/src/time_spgist.c b/src/general/time_spgist.c similarity index 100% rename from src/time_spgist.c rename to src/general/time_spgist.c diff --git a/src/timeops.c b/src/general/timeops.c similarity index 100% rename from src/timeops.c rename to src/general/timeops.c diff --git a/src/timestampset.c b/src/general/timestampset.c similarity index 100% rename from src/timestampset.c rename to src/general/timestampset.c diff --git a/src/tinstant.c b/src/general/tinstant.c similarity index 100% rename from src/tinstant.c rename to src/general/tinstant.c diff --git a/src/tinstantset.c b/src/general/tinstantset.c similarity index 100% rename from src/tinstantset.c rename to src/general/tinstantset.c diff --git a/src/tnumber_distance.c b/src/general/tnumber_distance.c similarity index 100% rename from src/tnumber_distance.c rename to src/general/tnumber_distance.c diff --git a/src/tnumber_gist.c b/src/general/tnumber_gist.c similarity index 100% rename from src/tnumber_gist.c rename to src/general/tnumber_gist.c diff --git a/src/tnumber_mathfuncs.c b/src/general/tnumber_mathfuncs.c similarity index 100% rename from src/tnumber_mathfuncs.c rename to src/general/tnumber_mathfuncs.c diff --git a/src/tnumber_selfuncs.c b/src/general/tnumber_selfuncs.c similarity index 100% rename from src/tnumber_selfuncs.c rename to src/general/tnumber_selfuncs.c diff --git a/src/tnumber_spgist.c b/src/general/tnumber_spgist.c similarity index 100% rename from src/tnumber_spgist.c rename to src/general/tnumber_spgist.c diff --git a/src/tsequence.c b/src/general/tsequence.c similarity index 100% rename from src/tsequence.c rename to src/general/tsequence.c diff --git a/src/tsequenceset.c b/src/general/tsequenceset.c similarity index 100% rename from src/tsequenceset.c rename to src/general/tsequenceset.c diff --git a/src/ttext_textfuncs.c b/src/general/ttext_textfuncs.c similarity index 100% rename from src/ttext_textfuncs.c rename to src/general/ttext_textfuncs.c From 8ecf8f53f2f344f393f91adf75deac7df2bea47a Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:04:38 -0500 Subject: [PATCH 10/22] [build] using new location --- CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51024a8f03..6be4518e61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ string(TOLOWER ${CMAKE_PROJECT_NAME} MOBILITYDB_LOWERCASE_NAME) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckSymbolExists) +#[[ set(SRCS src/geo_constructors.c src/doublen.c @@ -55,11 +56,20 @@ src/tnumber_selfuncs.c src/tnumber_spgist.c src/ttext_textfuncs.c ) +]] include(CTest) enable_testing() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(CheckCCompilerFlag) +if(NOT WIN32) + CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC) + if(C_COMPILER_SUPPORTS_FPIC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ") + endif() +endif() + #------------------------------------- # Verify PostgreSQL Version #------------------------------------- @@ -123,7 +133,11 @@ add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) # Belongs to MobilityDB # Must go before target_link_libraries -add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS}) +include_directories("include") +add_subdirectory("src/general") +set(PROJECT_OBJECTS "$") +add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS} ${PROJECT_OBJECTS}) + #-------------------------------- @@ -151,7 +165,6 @@ endif() #-------------------------------- # Belongs to MobilityDB -include_directories("include") include("point/point.cmake") include("npoint/npoint.cmake") From aa7c7a591de5cee2978376d925a58adb7eb2a6d5 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:12:23 -0500 Subject: [PATCH 11/22] [src] Organizing point subdirectory --- {point/src => src/point}/geography_functions.c | 0 {point/src => src/point}/projection_gk.c | 0 {point/src => src/point}/stbox.c | 0 {point/src => src/point}/tpoint.c | 0 {point/src => src/point}/tpoint_aggfuncs.c | 0 {point/src => src/point}/tpoint_analytics.c | 0 {point/src => src/point}/tpoint_analyze.c | 0 {point/src => src/point}/tpoint_boxops.c | 0 {point/src => src/point}/tpoint_datagen.c | 0 {point/src => src/point}/tpoint_distance.c | 0 {point/src => src/point}/tpoint_gist.c | 0 {point/src => src/point}/tpoint_in.c | 0 {point/src => src/point}/tpoint_out.c | 0 {point/src => src/point}/tpoint_parser.c | 0 {point/src => src/point}/tpoint_posops.c | 0 {point/src => src/point}/tpoint_selfuncs.c | 0 {point/src => src/point}/tpoint_spatialfuncs.c | 0 {point/src => src/point}/tpoint_spatialrels.c | 0 {point/src => src/point}/tpoint_spgist.c | 0 {point/src => src/point}/tpoint_tempspatialrels.c | 0 {point/src => src/point}/tpoint_tile.c | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename {point/src => src/point}/geography_functions.c (100%) rename {point/src => src/point}/projection_gk.c (100%) rename {point/src => src/point}/stbox.c (100%) rename {point/src => src/point}/tpoint.c (100%) rename {point/src => src/point}/tpoint_aggfuncs.c (100%) rename {point/src => src/point}/tpoint_analytics.c (100%) rename {point/src => src/point}/tpoint_analyze.c (100%) rename {point/src => src/point}/tpoint_boxops.c (100%) rename {point/src => src/point}/tpoint_datagen.c (100%) rename {point/src => src/point}/tpoint_distance.c (100%) rename {point/src => src/point}/tpoint_gist.c (100%) rename {point/src => src/point}/tpoint_in.c (100%) rename {point/src => src/point}/tpoint_out.c (100%) rename {point/src => src/point}/tpoint_parser.c (100%) rename {point/src => src/point}/tpoint_posops.c (100%) rename {point/src => src/point}/tpoint_selfuncs.c (100%) rename {point/src => src/point}/tpoint_spatialfuncs.c (100%) rename {point/src => src/point}/tpoint_spatialrels.c (100%) rename {point/src => src/point}/tpoint_spgist.c (100%) rename {point/src => src/point}/tpoint_tempspatialrels.c (100%) rename {point/src => src/point}/tpoint_tile.c (100%) diff --git a/point/src/geography_functions.c b/src/point/geography_functions.c similarity index 100% rename from point/src/geography_functions.c rename to src/point/geography_functions.c diff --git a/point/src/projection_gk.c b/src/point/projection_gk.c similarity index 100% rename from point/src/projection_gk.c rename to src/point/projection_gk.c diff --git a/point/src/stbox.c b/src/point/stbox.c similarity index 100% rename from point/src/stbox.c rename to src/point/stbox.c diff --git a/point/src/tpoint.c b/src/point/tpoint.c similarity index 100% rename from point/src/tpoint.c rename to src/point/tpoint.c diff --git a/point/src/tpoint_aggfuncs.c b/src/point/tpoint_aggfuncs.c similarity index 100% rename from point/src/tpoint_aggfuncs.c rename to src/point/tpoint_aggfuncs.c diff --git a/point/src/tpoint_analytics.c b/src/point/tpoint_analytics.c similarity index 100% rename from point/src/tpoint_analytics.c rename to src/point/tpoint_analytics.c diff --git a/point/src/tpoint_analyze.c b/src/point/tpoint_analyze.c similarity index 100% rename from point/src/tpoint_analyze.c rename to src/point/tpoint_analyze.c diff --git a/point/src/tpoint_boxops.c b/src/point/tpoint_boxops.c similarity index 100% rename from point/src/tpoint_boxops.c rename to src/point/tpoint_boxops.c diff --git a/point/src/tpoint_datagen.c b/src/point/tpoint_datagen.c similarity index 100% rename from point/src/tpoint_datagen.c rename to src/point/tpoint_datagen.c diff --git a/point/src/tpoint_distance.c b/src/point/tpoint_distance.c similarity index 100% rename from point/src/tpoint_distance.c rename to src/point/tpoint_distance.c diff --git a/point/src/tpoint_gist.c b/src/point/tpoint_gist.c similarity index 100% rename from point/src/tpoint_gist.c rename to src/point/tpoint_gist.c diff --git a/point/src/tpoint_in.c b/src/point/tpoint_in.c similarity index 100% rename from point/src/tpoint_in.c rename to src/point/tpoint_in.c diff --git a/point/src/tpoint_out.c b/src/point/tpoint_out.c similarity index 100% rename from point/src/tpoint_out.c rename to src/point/tpoint_out.c diff --git a/point/src/tpoint_parser.c b/src/point/tpoint_parser.c similarity index 100% rename from point/src/tpoint_parser.c rename to src/point/tpoint_parser.c diff --git a/point/src/tpoint_posops.c b/src/point/tpoint_posops.c similarity index 100% rename from point/src/tpoint_posops.c rename to src/point/tpoint_posops.c diff --git a/point/src/tpoint_selfuncs.c b/src/point/tpoint_selfuncs.c similarity index 100% rename from point/src/tpoint_selfuncs.c rename to src/point/tpoint_selfuncs.c diff --git a/point/src/tpoint_spatialfuncs.c b/src/point/tpoint_spatialfuncs.c similarity index 100% rename from point/src/tpoint_spatialfuncs.c rename to src/point/tpoint_spatialfuncs.c diff --git a/point/src/tpoint_spatialrels.c b/src/point/tpoint_spatialrels.c similarity index 100% rename from point/src/tpoint_spatialrels.c rename to src/point/tpoint_spatialrels.c diff --git a/point/src/tpoint_spgist.c b/src/point/tpoint_spgist.c similarity index 100% rename from point/src/tpoint_spgist.c rename to src/point/tpoint_spgist.c diff --git a/point/src/tpoint_tempspatialrels.c b/src/point/tpoint_tempspatialrels.c similarity index 100% rename from point/src/tpoint_tempspatialrels.c rename to src/point/tpoint_tempspatialrels.c diff --git a/point/src/tpoint_tile.c b/src/point/tpoint_tile.c similarity index 100% rename from point/src/tpoint_tile.c rename to src/point/tpoint_tile.c From 6882b19c0a66dd93808e7f67f10fef7d8d20374b Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:13:21 -0500 Subject: [PATCH 12/22] [build] adding CMakeLists files --- src/CMakeLists.txt | 2 ++ src/general/CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++++++ src/point/CMakeLists.txt | 23 +++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/general/CMakeLists.txt create mode 100644 src/point/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..ef312aace8 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(general) +add_subdirectory(point) diff --git a/src/general/CMakeLists.txt b/src/general/CMakeLists.txt new file mode 100644 index 0000000000..fe349733cb --- /dev/null +++ b/src/general/CMakeLists.txt @@ -0,0 +1,42 @@ +add_library(general OBJECT + doublen.c + geo_constructors.c + lifting.c + period.c + periodset.c + rangetypes_ext.c + skiplist.c + tbool_boolops.c + tbox.c + tempcache.c + temporal_aggfuncs.c + temporal_analyze.c + temporal_boxops.c + temporal.c + temporal_compops.c + temporal_gist.c + temporal_parser.c + temporal_posops.c + temporal_selfuncs.c + temporal_spgist.c + temporal_tile.c + temporal_util.c + temporal_waggfuncs.c + time_aggfuncs.c + time_analyze.c + time_gist.c + timeops.c + time_selfuncs.c + time_spgist.c + timestampset.c + tinstant.c + tinstantset.c + tnumber_distance.c + tnumber_gist.c + tnumber_mathfuncs.c + tnumber_selfuncs.c + tnumber_spgist.c + tsequence.c + tsequenceset.c + ttext_textfuncs.c + ) diff --git a/src/point/CMakeLists.txt b/src/point/CMakeLists.txt new file mode 100644 index 0000000000..3dc8e8dbb3 --- /dev/null +++ b/src/point/CMakeLists.txt @@ -0,0 +1,23 @@ +add_library(point OBJECT + geography_functions.c + projection_gk.c + stbox.c + tpoint_aggfuncs.c + tpoint_analytics.c + tpoint_analyze.c + tpoint_boxops.c + tpoint.c + tpoint_datagen.c + tpoint_distance.c + tpoint_gist.c + tpoint_in.c + tpoint_out.c + tpoint_parser.c + tpoint_posops.c + tpoint_selfuncs.c + tpoint_spatialfuncs.c + tpoint_spatialrels.c + tpoint_spgist.c + tpoint_tempspatialrels.c + tpoint_tile.c + ) From bf50533df6f2c4eaf0792fe243b35dbd0196bb4d Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:13:48 -0500 Subject: [PATCH 13/22] [build] Using the changes --- CMakeLists.txt | 3 ++- point/point.cmake | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6be4518e61..63dcfb09d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,8 +134,9 @@ add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) # Must go before target_link_libraries include_directories("include") -add_subdirectory("src/general") +add_subdirectory("src") set(PROJECT_OBJECTS "$") +set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS} ${PROJECT_OBJECTS}) diff --git a/point/point.cmake b/point/point.cmake index aee0576d1d..2aad615cee 100644 --- a/point/point.cmake +++ b/point/point.cmake @@ -1,5 +1,5 @@ add_definitions(-DWITH_POSTGIS) - +#[[ set(SRCPOINT point/src/stbox.c point/src/tpoint_aggfuncs.c @@ -23,8 +23,8 @@ point/src/tpoint_selfuncs.c point/src/tpoint_tempspatialrels.c point/src/tpoint_analytics.c ) - target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${SRCPOINT}) +]] set(CONTROLIN "${CONTROLIN};point/control.in") From e00d37dd06beba1f494a6d3052e9f225dd7ea0d7 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:20:01 -0500 Subject: [PATCH 14/22] [src] Organizing npoint subdirectory --- {npoint/src => src/npoint}/tnpoint.c | 0 {npoint/src => src/npoint}/tnpoint_aggfuncs.c | 0 {npoint/src => src/npoint}/tnpoint_analyze.c | 0 {npoint/src => src/npoint}/tnpoint_boxops.c | 0 {npoint/src => src/npoint}/tnpoint_distance.c | 0 {npoint/src => src/npoint}/tnpoint_indexes.c | 0 {npoint/src => src/npoint}/tnpoint_parser.c | 0 {npoint/src => src/npoint}/tnpoint_posops.c | 0 {npoint/src => src/npoint}/tnpoint_selfuncs.c | 0 {npoint/src => src/npoint}/tnpoint_spatialfuncs.c | 0 {npoint/src => src/npoint}/tnpoint_spatialrels.c | 0 {npoint/src => src/npoint}/tnpoint_static.c | 0 {npoint/src => src/npoint}/tnpoint_tempspatialrels.c | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename {npoint/src => src/npoint}/tnpoint.c (100%) rename {npoint/src => src/npoint}/tnpoint_aggfuncs.c (100%) rename {npoint/src => src/npoint}/tnpoint_analyze.c (100%) rename {npoint/src => src/npoint}/tnpoint_boxops.c (100%) rename {npoint/src => src/npoint}/tnpoint_distance.c (100%) rename {npoint/src => src/npoint}/tnpoint_indexes.c (100%) rename {npoint/src => src/npoint}/tnpoint_parser.c (100%) rename {npoint/src => src/npoint}/tnpoint_posops.c (100%) rename {npoint/src => src/npoint}/tnpoint_selfuncs.c (100%) rename {npoint/src => src/npoint}/tnpoint_spatialfuncs.c (100%) rename {npoint/src => src/npoint}/tnpoint_spatialrels.c (100%) rename {npoint/src => src/npoint}/tnpoint_static.c (100%) rename {npoint/src => src/npoint}/tnpoint_tempspatialrels.c (100%) diff --git a/npoint/src/tnpoint.c b/src/npoint/tnpoint.c similarity index 100% rename from npoint/src/tnpoint.c rename to src/npoint/tnpoint.c diff --git a/npoint/src/tnpoint_aggfuncs.c b/src/npoint/tnpoint_aggfuncs.c similarity index 100% rename from npoint/src/tnpoint_aggfuncs.c rename to src/npoint/tnpoint_aggfuncs.c diff --git a/npoint/src/tnpoint_analyze.c b/src/npoint/tnpoint_analyze.c similarity index 100% rename from npoint/src/tnpoint_analyze.c rename to src/npoint/tnpoint_analyze.c diff --git a/npoint/src/tnpoint_boxops.c b/src/npoint/tnpoint_boxops.c similarity index 100% rename from npoint/src/tnpoint_boxops.c rename to src/npoint/tnpoint_boxops.c diff --git a/npoint/src/tnpoint_distance.c b/src/npoint/tnpoint_distance.c similarity index 100% rename from npoint/src/tnpoint_distance.c rename to src/npoint/tnpoint_distance.c diff --git a/npoint/src/tnpoint_indexes.c b/src/npoint/tnpoint_indexes.c similarity index 100% rename from npoint/src/tnpoint_indexes.c rename to src/npoint/tnpoint_indexes.c diff --git a/npoint/src/tnpoint_parser.c b/src/npoint/tnpoint_parser.c similarity index 100% rename from npoint/src/tnpoint_parser.c rename to src/npoint/tnpoint_parser.c diff --git a/npoint/src/tnpoint_posops.c b/src/npoint/tnpoint_posops.c similarity index 100% rename from npoint/src/tnpoint_posops.c rename to src/npoint/tnpoint_posops.c diff --git a/npoint/src/tnpoint_selfuncs.c b/src/npoint/tnpoint_selfuncs.c similarity index 100% rename from npoint/src/tnpoint_selfuncs.c rename to src/npoint/tnpoint_selfuncs.c diff --git a/npoint/src/tnpoint_spatialfuncs.c b/src/npoint/tnpoint_spatialfuncs.c similarity index 100% rename from npoint/src/tnpoint_spatialfuncs.c rename to src/npoint/tnpoint_spatialfuncs.c diff --git a/npoint/src/tnpoint_spatialrels.c b/src/npoint/tnpoint_spatialrels.c similarity index 100% rename from npoint/src/tnpoint_spatialrels.c rename to src/npoint/tnpoint_spatialrels.c diff --git a/npoint/src/tnpoint_static.c b/src/npoint/tnpoint_static.c similarity index 100% rename from npoint/src/tnpoint_static.c rename to src/npoint/tnpoint_static.c diff --git a/npoint/src/tnpoint_tempspatialrels.c b/src/npoint/tnpoint_tempspatialrels.c similarity index 100% rename from npoint/src/tnpoint_tempspatialrels.c rename to src/npoint/tnpoint_tempspatialrels.c From e075b98db56c3c4bf2bc9bdb23eefc9101e5dda4 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:20:47 -0500 Subject: [PATCH 15/22] [build] adding CMakeLists files --- src/npoint/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/npoint/CMakeLists.txt diff --git a/src/npoint/CMakeLists.txt b/src/npoint/CMakeLists.txt new file mode 100644 index 0000000000..df6cfcf9f9 --- /dev/null +++ b/src/npoint/CMakeLists.txt @@ -0,0 +1,15 @@ +add_library(npoint OBJECT + tnpoint_aggfuncs.c + tnpoint_analyze.c + tnpoint_boxops.c + tnpoint.c + tnpoint_distance.c + tnpoint_indexes.c + tnpoint_parser.c + tnpoint_posops.c + tnpoint_selfuncs.c + tnpoint_spatialfuncs.c + tnpoint_spatialrels.c + tnpoint_static.c + tnpoint_tempspatialrels.c + ) From c90fb1a98e4552bd65fd5f141eb3b9c9524e8464 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:21:04 -0500 Subject: [PATCH 16/22] [build] Using the changes --- CMakeLists.txt | 3 ++- npoint/npoint.cmake | 3 ++- src/CMakeLists.txt | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63dcfb09d5..c4a50cce8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,7 +137,8 @@ include_directories("include") add_subdirectory("src") set(PROJECT_OBJECTS "$") set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") -add_library(${CMAKE_PROJECT_NAME} MODULE ${SRCS} ${PROJECT_OBJECTS}) +set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") +add_library(${CMAKE_PROJECT_NAME} MODULE ${PROJECT_OBJECTS}) #-------------------------------- diff --git a/npoint/npoint.cmake b/npoint/npoint.cmake index 3a4db3120e..d869fcc98f 100644 --- a/npoint/npoint.cmake +++ b/npoint/npoint.cmake @@ -1,5 +1,5 @@ add_definitions(-DWITH_POSTGIS) - +#[[ set(SRCNPOINT npoint/src/tnpoint.c npoint/src/tnpoint_aggfuncs.c @@ -17,4 +17,5 @@ npoint/src/tnpoint_tempspatialrels.c ) target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${SRCNPOINT}) +]] set(CONTROLIN "${CONTROLIN};npoint/control.in") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef312aace8..4ce2b71247 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(general) add_subdirectory(point) +add_subdirectory(npoint) From 1e117f97edada906e43e833575a38daa4037b236 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:37:21 -0500 Subject: [PATCH 17/22] [build] removing unused code --- CMakeLists.txt | 52 ++++----------------------------------------- npoint/npoint.cmake | 19 ----------------- point/point.cmake | 27 ----------------------- 3 files changed, 4 insertions(+), 94 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4a50cce8a..1d996a0207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,50 +13,6 @@ string(TOLOWER ${CMAKE_PROJECT_NAME} MOBILITYDB_LOWERCASE_NAME) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckSymbolExists) -#[[ -set(SRCS -src/geo_constructors.c -src/doublen.c -src/lifting.c -src/period.c -src/periodset.c -src/rangetypes_ext.c -src/skiplist.c -src/tbool_boolops.c -src/tbox.c -src/tempcache.c -src/temporal.c -src/tinstant.c -src/tinstantset.c -src/tsequence.c -src/tsequenceset.c -src/temporal_aggfuncs.c -src/temporal_analyze.c -src/temporal_boxops.c -src/temporal_compops.c -src/temporal_gist.c -src/tnumber_mathfuncs.c -src/temporal_parser.c -src/temporal_posops.c -src/temporal_selfuncs.c -src/temporal_spgist.c -src/temporal_tile.c -src/temporal_util.c -src/temporal_waggfuncs.c -src/timeops.c -src/timestampset.c -src/time_aggfuncs.c -src/time_analyze.c -src/time_gist.c -src/time_selfuncs.c -src/time_spgist.c -src/tnumber_distance.c -src/tnumber_gist.c -src/tnumber_selfuncs.c -src/tnumber_spgist.c -src/ttext_textfuncs.c -) -]] include(CTest) enable_testing() @@ -64,10 +20,10 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckCCompilerFlag) if(NOT WIN32) - CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC) - if(C_COMPILER_SUPPORTS_FPIC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ") - endif() + CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC) + if(C_COMPILER_SUPPORTS_FPIC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ") + endif() endif() #------------------------------------- diff --git a/npoint/npoint.cmake b/npoint/npoint.cmake index d869fcc98f..9426d3e5d9 100644 --- a/npoint/npoint.cmake +++ b/npoint/npoint.cmake @@ -1,21 +1,2 @@ add_definitions(-DWITH_POSTGIS) -#[[ -set(SRCNPOINT -npoint/src/tnpoint.c -npoint/src/tnpoint_aggfuncs.c -npoint/src/tnpoint_analyze.c -npoint/src/tnpoint_boxops.c -npoint/src/tnpoint_distance.c -npoint/src/tnpoint_indexes.c -npoint/src/tnpoint_parser.c -npoint/src/tnpoint_posops.c -npoint/src/tnpoint_selfuncs.c -npoint/src/tnpoint_spatialfuncs.c -npoint/src/tnpoint_spatialrels.c -npoint/src/tnpoint_static.c -npoint/src/tnpoint_tempspatialrels.c -) - -target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${SRCNPOINT}) -]] set(CONTROLIN "${CONTROLIN};npoint/control.in") diff --git a/point/point.cmake b/point/point.cmake index 2aad615cee..e22fbb849a 100644 --- a/point/point.cmake +++ b/point/point.cmake @@ -1,30 +1,3 @@ add_definitions(-DWITH_POSTGIS) -#[[ -set(SRCPOINT -point/src/stbox.c -point/src/tpoint_aggfuncs.c -point/src/tpoint_boxops.c -point/src/tpoint_datagen.c -point/src/tpoint_parser.c -point/src/tpoint_posops.c -point/src/tpoint_gist.c -point/src/tpoint_spgist.c -point/src/tpoint_tile.c -point/src/projection_gk.c -point/src/geography_functions.c -point/src/tpoint_spatialfuncs.c -point/src/tpoint_distance.c -point/src/tpoint_spatialrels.c -point/src/tpoint.c -point/src/tpoint_in.c -point/src/tpoint_out.c -point/src/tpoint_analyze.c -point/src/tpoint_selfuncs.c -point/src/tpoint_tempspatialrels.c -point/src/tpoint_analytics.c -) -target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${SRCPOINT}) -]] - set(CONTROLIN "${CONTROLIN};point/control.in") From 7a0ee0bfb0c7a5ea1292b86fb6f148ae1a9649ba Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 21:38:24 -0500 Subject: [PATCH 18/22] [build] removing unused definition --- npoint/npoint.cmake | 1 - point/point.cmake | 1 - 2 files changed, 2 deletions(-) diff --git a/npoint/npoint.cmake b/npoint/npoint.cmake index 9426d3e5d9..84f5034db4 100644 --- a/npoint/npoint.cmake +++ b/npoint/npoint.cmake @@ -1,2 +1 @@ -add_definitions(-DWITH_POSTGIS) set(CONTROLIN "${CONTROLIN};npoint/control.in") diff --git a/point/point.cmake b/point/point.cmake index e22fbb849a..80a5380c7e 100644 --- a/point/point.cmake +++ b/point/point.cmake @@ -1,3 +1,2 @@ -add_definitions(-DWITH_POSTGIS) set(CONTROLIN "${CONTROLIN};point/control.in") From 42d7772ab2b1a611a3a43b4f79c59d04bc308c21 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 22:35:10 -0500 Subject: [PATCH 19/22] [build] fixing some issues about library version --- CMakeLists.txt | 38 ++++++++++++++++++++++---------------- include/general/temporal.h | 1 - sql/CMakeLists.txt | 5 +++++ src/general/temporal.c | 4 ++-- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d996a0207..3b46678aa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,13 @@ if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} ) You may need to remove 'CMakeCache.txt' and 'CMakeFiles/'.") endif() -project(MobilityDB VERSION 1.0) -set(MOBILITYDB_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +project(MobilityDB VERSION 1.0.0) +set(MOBILITYDB_VERSION "${MobilityDB_VERSION}") +set(MOBILITYDB_LIB_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +set(MOBILITYDB_LIB_NAME "${CMAKE_PROJECT_NAME}-${MOBILITYDB_LIB_VERSION}") +set(PROJECT_VERSION_DEV "Beta 3") +set(MOBILITYDB_VERSION_STR "MobilityDB ${MOBILITYDB_VERSION} ${PROJECT_VERSION_DEV}") +add_definitions(-DMOBILITYDB_VERSION_STR="${MOBILITYDB_VERSION_STR}") string(TOLOWER ${CMAKE_PROJECT_NAME} MOBILITYDB_LOWERCASE_NAME) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -94,26 +99,26 @@ add_subdirectory("src") set(PROJECT_OBJECTS "$") set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") -add_library(${CMAKE_PROJECT_NAME} MODULE ${PROJECT_OBJECTS}) +add_library(${MOBILITYDB_LIB_NAME} MODULE ${PROJECT_OBJECTS}) #-------------------------------- find_package(JSON-C REQUIRED) include_directories(${JSON-C_INCLUDE_DIRS}) -target_link_libraries(${CMAKE_PROJECT_NAME} ${JSON-C_LIBRARIES}) +target_link_libraries(${MOBILITYDB_LIB_NAME} ${JSON-C_LIBRARIES}) find_package(PROJ REQUIRED) -target_link_libraries(${CMAKE_PROJECT_NAME} ${PROJ_LIBRARIES}) +target_link_libraries(${MOBILITYDB_LIB_NAME} ${PROJ_LIBRARIES}) include_directories(${PROJ_INCLUDE_DIRS}) find_package(LWGEOM REQUIRED) -target_link_libraries(${CMAKE_PROJECT_NAME} ${LWGEOM_LIBRARIES}) +target_link_libraries(${MOBILITYDB_LIB_NAME} ${LWGEOM_LIBRARIES}) include_directories(${LWGEOM_INCLUDE_DIRS}) find_package(GSL REQUIRED) -target_link_libraries(${CMAKE_PROJECT_NAME} ${GSL_LIBRARY}) -target_link_libraries(${CMAKE_PROJECT_NAME} ${GSL_CLBAS_LIBRARY}) +target_link_libraries(${MOBILITYDB_LIB_NAME} ${GSL_LIBRARY}) +target_link_libraries(${MOBILITYDB_LIB_NAME} ${GSL_CLBAS_LIBRARY}) check_symbol_exists(ffsl "string.h" HAS_FFSL) if(NOT HAS_FFSL) @@ -132,12 +137,13 @@ add_subdirectory(test) add_subdirectory(sql) -add_custom_command( - OUTPUT ${CONTROLOUT} - COMMAND cat ${CONTROLIN} | sed -e's/LIBNAME/${CMAKE_PROJECT_NAME}/' -e's/VERSION/${MOBILITYDB_VERSION}/' > ${CMAKE_BINARY_DIR}/${CONTROLOUT} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - DEPENDS ${CONTROLIN}) +#add_custom_command( +# OUTPUT ${CONTROLOUT} +# COMMAND cat ${CONTROLIN} | sed -e's/LIBNAME/${CMAKE_PROJECT_NAME}/' -e's/VERSION/${MOBILITYDB_VERSION}/' > ${CMAKE_BINARY_DIR}/${CONTROLOUT} +# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} +# DEPENDS ${CONTROLIN}) -install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION "${POSTGRESQL_DYNLIB_DIR}") -install(FILES "${CMAKE_BINARY_DIR}/${CONTROLOUT}" DESTINATION "${POSTGRESQL_SHARE_DIR}/extension") -install(FILES "${CMAKE_BINARY_DIR}/${MOBILITYDB_EXTENSION_FILE}" DESTINATION "${POSTGRESQL_SHARE_DIR}/extension") +install(TARGETS ${MOBILITYDB_LIB_NAME} DESTINATION "${POSTGRESQL_DYNLIB_DIR}") +install( + FILES "${CMAKE_BINARY_DIR}/mobilitydb.control" "${CMAKE_BINARY_DIR}/${MOBILITYDB_EXTENSION_FILE}" + DESTINATION "${POSTGRESQL_SHARE_DIR}/extension") diff --git a/include/general/temporal.h b/include/general/temporal.h index 62b48584e4..7ed3b9b11d 100644 --- a/include/general/temporal.h +++ b/include/general/temporal.h @@ -143,7 +143,6 @@ typedef enum * Compatibility with older versions of PostgreSQL *****************************************************************************/ -#define MOBDB_VERSION_STR "MobilityDB 1.0 beta 3" /***************************************************************************** diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index dbe507414d..f2b9450b01 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -1,3 +1,8 @@ +set(MOBILITYDB_MODULE_PATHNAME "$libdir/lib${MOBILITYDB_LIB_NAME}") +configure_file(mobilitydb.control ${CMAKE_BINARY_DIR}/mobilitydb.control) + + + # one word definitions if (${POSTGRESQL_VERSION_NUMBER} GREATER_EQUAL 110000) set(JOIN_LE "scalarlejoinsel") diff --git a/src/general/temporal.c b/src/general/temporal.c index fb5c978c37..50025aa08c 100644 --- a/src/general/temporal.c +++ b/src/general/temporal.c @@ -563,7 +563,7 @@ PG_FUNCTION_INFO_V1(mobilitydb_version); PGDLLEXPORT Datum mobilitydb_version(PG_FUNCTION_ARGS) { - char *ver = MOBDB_VERSION_STR; + char *ver = MOBILITYDB_VERSION_STR; text *result = cstring_to_text(ver); PG_RETURN_TEXT_P(result); } @@ -578,7 +578,7 @@ mobilitydb_full_version(PG_FUNCTION_ARGS) char ver[128]; text *result; - snprintf(ver, 128, "%s, %s, %s", MOBDB_VERSION_STR, + snprintf(ver, 128, "%s, %s, %s", MOBILITYDB_VERSION_STR, POSTGRESQL_VERSION_STRING, POSTGIS_VERSION_STR); ver[127] = '\0'; From ea7cd74bf4d5280c17a4748abacba1b1fa92ede6 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Mon, 26 Jul 2021 22:36:01 -0500 Subject: [PATCH 20/22] [build] adding the control file --- sql/mobilitydb.control | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/mobilitydb.control diff --git a/sql/mobilitydb.control b/sql/mobilitydb.control new file mode 100644 index 0000000000..ebb4c613a0 --- /dev/null +++ b/sql/mobilitydb.control @@ -0,0 +1,4 @@ +comment = 'MobilityDB Extension' +default_version = '${MOBILITYDB_VERSION}' +module_pathname = '${MOBILITYDB_MODULE_PATHNAME}' +requires = 'postgis' From a90a0db7711190beea207d339e4ce5b815277612 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Tue, 27 Jul 2021 09:51:34 -0500 Subject: [PATCH 21/22] [build] Doing some cleanup --- CMakeLists.txt | 61 +++++++++++++++++++-------------------------- npoint/README.md | 4 --- npoint/control.in | 1 - npoint/npoint.cmake | 1 - point/control.in | 1 - point/point.cmake | 2 -- 6 files changed, 25 insertions(+), 45 deletions(-) delete mode 100644 npoint/README.md delete mode 100644 npoint/control.in delete mode 100644 npoint/npoint.cmake delete mode 100644 point/control.in delete mode 100644 point/point.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b46678aa9..cdff2d0e59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,11 @@ set(MOBILITYDB_VERSION "${MobilityDB_VERSION}") set(MOBILITYDB_LIB_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") set(MOBILITYDB_LIB_NAME "${CMAKE_PROJECT_NAME}-${MOBILITYDB_LIB_VERSION}") set(PROJECT_VERSION_DEV "Beta 3") -set(MOBILITYDB_VERSION_STR "MobilityDB ${MOBILITYDB_VERSION} ${PROJECT_VERSION_DEV}") -add_definitions(-DMOBILITYDB_VERSION_STR="${MOBILITYDB_VERSION_STR}") +set(MOBILITYDB_VERSION_STR "${PROJECT_NAME} ${MOBILITYDB_VERSION} ${PROJECT_VERSION_DEV}") string(TOLOWER ${CMAKE_PROJECT_NAME} MOBILITYDB_LOWERCASE_NAME) +set(MOBILITYDB_EXTENSION_FILE "${MOBILITYDB_LOWERCASE_NAME}--${MOBILITYDB_VERSION}.sql") + +add_definitions(-DMOBILITYDB_VERSION_STR="${MOBILITYDB_VERSION_STR}") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckSymbolExists) @@ -23,20 +25,30 @@ enable_testing() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +#------------------------------------- +# special cases of compiler flags +#------------------------------------- + include(CheckCCompilerFlag) if(NOT WIN32) CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC) if(C_COMPILER_SUPPORTS_FPIC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC ") + add_definitions("-fPIC") endif() endif() +check_symbol_exists(ffsl "string.h" HAS_FFSL) +if(NOT HAS_FFSL) + add_definitions(-D NO_FFSL) +endif() + #------------------------------------- # Verify PostgreSQL Version #------------------------------------- set(PG_MIN_MAJOR_VERSION "10") set(PG_MAX_MAJOR_VERSION "14") +#-------------------------------- find_package(POSTGRESQL ${PG_MIN_MAJOR_VERSION} REQUIRED) if (NOT POSTGRES_VERSION VERSION_LESS PG_MAX_MAJOR_VERSION) message(FATAL_ERROR "Not supporting PostgreSQL ${POSTGRESQL_VERSION}") @@ -56,6 +68,7 @@ if(WIN32) link_directories(${POSTGRESQL_LIBRARIES}) link_libraries(postgres) endif() + #-------------------------------- @@ -70,26 +83,10 @@ endif () set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0") -set(CONTROLIN "control.in") -set(CONTROLOUT "${MOBILITYDB_LOWERCASE_NAME}.control") -set(SQLPP "${MOBILITYDB_LOWERCASE_NAME}--${MOBILITYDB_VERSION}.sql.c") -set(MOBILITYDB_EXTENSION_FILE "${MOBILITYDB_LOWERCASE_NAME}--${MOBILITYDB_VERSION}.sql") - - -add_custom_target(sqlscript ALL DEPENDS ${CMAKE_BINARY_DIR}/${MOBILITYDB_EXTENSION_FILE}) -add_custom_target(control ALL DEPENDS ${CMAKE_BINARY_DIR}/${CONTROLOUT}) - - if (APPLE) SET_TARGET_PROPERTIES(${CMAKE_PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup -bundle_loader /usr/local/bin/postgres") endif () -# Currently does not work with other versions of PostGIS -find_package(POSTGIS 2.5 EXACT REQUIRED) -add_definitions(-DPOSTGIS_VERSION_STR="${POSTGIS_VERSION_STR}") -add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) - - #-------------------------------- # Belongs to MobilityDB # Must go before target_link_libraries @@ -101,8 +98,14 @@ set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") set(PROJECT_OBJECTS ${PROJECT_OBJECTS} "$") add_library(${MOBILITYDB_LIB_NAME} MODULE ${PROJECT_OBJECTS}) - #-------------------------------- +# other requirements +#-------------------------------- + +# Currently does not work with other versions of PostGIS +find_package(POSTGIS 2.5 EXACT REQUIRED) +add_definitions(-DPOSTGIS_VERSION_STR="${POSTGIS_VERSION_STR}") +add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) find_package(JSON-C REQUIRED) include_directories(${JSON-C_INCLUDE_DIRS}) @@ -120,28 +123,14 @@ find_package(GSL REQUIRED) target_link_libraries(${MOBILITYDB_LIB_NAME} ${GSL_LIBRARY}) target_link_libraries(${MOBILITYDB_LIB_NAME} ${GSL_CLBAS_LIBRARY}) -check_symbol_exists(ffsl "string.h" HAS_FFSL) -if(NOT HAS_FFSL) - add_definitions(-D NO_FFSL) -endif() - #-------------------------------- # Belongs to MobilityDB -include("point/point.cmake") -include("npoint/npoint.cmake") - - add_subdirectory(test) - - add_subdirectory(sql) -#add_custom_command( -# OUTPUT ${CONTROLOUT} -# COMMAND cat ${CONTROLIN} | sed -e's/LIBNAME/${CMAKE_PROJECT_NAME}/' -e's/VERSION/${MOBILITYDB_VERSION}/' > ${CMAKE_BINARY_DIR}/${CONTROLOUT} -# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} -# DEPENDS ${CONTROLIN}) +add_custom_target(sqlscript ALL DEPENDS ${CMAKE_BINARY_DIR}/${MOBILITYDB_EXTENSION_FILE}) +add_custom_target(control ALL DEPENDS ${CMAKE_BINARY_DIR}/mobilitydb.control) install(TARGETS ${MOBILITYDB_LIB_NAME} DESTINATION "${POSTGRESQL_DYNLIB_DIR}") install( diff --git a/npoint/README.md b/npoint/README.md deleted file mode 100644 index e3c5efa979..0000000000 --- a/npoint/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The route table should be named 'ways' with at least three columns: - gid: the unique route identifier - length: route length - the_geom: route geometry diff --git a/npoint/control.in b/npoint/control.in deleted file mode 100644 index b81744498f..0000000000 --- a/npoint/control.in +++ /dev/null @@ -1 +0,0 @@ -requires = 'postgis' diff --git a/npoint/npoint.cmake b/npoint/npoint.cmake deleted file mode 100644 index 84f5034db4..0000000000 --- a/npoint/npoint.cmake +++ /dev/null @@ -1 +0,0 @@ -set(CONTROLIN "${CONTROLIN};npoint/control.in") diff --git a/point/control.in b/point/control.in deleted file mode 100644 index b81744498f..0000000000 --- a/point/control.in +++ /dev/null @@ -1 +0,0 @@ -requires = 'postgis' diff --git a/point/point.cmake b/point/point.cmake deleted file mode 100644 index 80a5380c7e..0000000000 --- a/point/point.cmake +++ /dev/null @@ -1,2 +0,0 @@ -set(CONTROLIN "${CONTROLIN};point/control.in") - From fa97b72792ed33670c05fd9a7a353ee14fa0523a Mon Sep 17 00:00:00 2001 From: cvvergara Date: Tue, 27 Jul 2021 09:59:36 -0500 Subject: [PATCH 22/22] [build] organizing main build --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdff2d0e59..a56f877e39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,13 +33,13 @@ include(CheckCCompilerFlag) if(NOT WIN32) CHECK_C_COMPILER_FLAG("-fPIC" C_COMPILER_SUPPORTS_FPIC) if(C_COMPILER_SUPPORTS_FPIC) - add_definitions("-fPIC") + add_definitions(-fPIC) endif() endif() check_symbol_exists(ffsl "string.h" HAS_FFSL) if(NOT HAS_FFSL) - add_definitions(-D NO_FFSL) + add_definitions(-DNO_FFSL) endif() #------------------------------------- @@ -69,6 +69,11 @@ if(WIN32) link_libraries(postgres) endif() +# Currently does not work with other versions of PostGIS +find_package(POSTGIS 2.5 EXACT REQUIRED) +add_definitions(-DPOSTGIS_VERSION_STR="${POSTGIS_VERSION_STR}") +add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) + #-------------------------------- @@ -102,11 +107,6 @@ add_library(${MOBILITYDB_LIB_NAME} MODULE ${PROJECT_OBJECTS}) # other requirements #-------------------------------- -# Currently does not work with other versions of PostGIS -find_package(POSTGIS 2.5 EXACT REQUIRED) -add_definitions(-DPOSTGIS_VERSION_STR="${POSTGIS_VERSION_STR}") -add_definitions(-DPOSTGIS_VERSION_NUMBER=${POSTGIS_VERSION_NUMBER}) - find_package(JSON-C REQUIRED) include_directories(${JSON-C_INCLUDE_DIRS}) target_link_libraries(${MOBILITYDB_LIB_NAME} ${JSON-C_LIBRARIES})