34#ifndef __TPOINT_SPATIALFUNCS_H__
35#define __TPOINT_SPATIALFUNCS_H__
42#include "general/temporal.h"
46#define GEOM_TO_GEOG true
47#define GEOG_TO_GEOM false
124 bool geodetic,
int32 srid);
142 double ratio,
bool hasz,
bool geodetic);
Temporal * tpoint_minus_stbox(const Temporal *temp, const STBox *box)
Restrict a temporal point to the complement of a spatiotemporal box.
Definition: tpoint_spatialfuncs.c:4492
Temporal * tpoint_get_coord(const Temporal *temp, int coord)
Get one of the coordinates of a temporal point as a temporal float.
Definition: tpoint_spatialfuncs.c:2115
Temporal * tpoint_round(const Temporal *temp, int prec)
Set the precision of the coordinates of a temporal point to a number of decimal places.
Definition: tpoint_spatialfuncs.c:740
signed short int16
Functions for building a cache of temporal types and operators.
Definition: meos_catalog.h:41
Datum(* datum_func2)(Datum, Datum)
Definition: temporal.h:367
const POINT2D * datum_point2d_p(Datum value)
Return a pointer to a 2D point from the datum.
Definition: tpoint_spatialfuncs.c:137
Datum geom_distance2d(Datum geom1, Datum geom2)
Return the 2D distance between the two geometries.
Definition: tpoint_spatialfuncs.c:273
void ensure_has_not_Z(int16 flags)
Ensure that a temporal point has not Z dimension.
Definition: tpoint_spatialfuncs.c:517
long double closest_point_on_segment_sphere(const POINT4D *p, const POINT4D *A, const POINT4D *B, POINT4D *closest, double *dist)
Return a float between 0 and 1 representing the location of the closest point on the geography segmen...
Definition: tpoint_spatialfuncs.c:1060
void ensure_same_srid_tpoint_stbox(const Temporal *temp, const STBox *box)
Ensure that a temporal point and a spatiotemporal boxes have the same SRID.
Definition: tpoint_spatialfuncs.c:402
void ensure_same_srid(int32_t srid1, int32_t srid2)
Ensure that the two spatial "objects" have the same SRID.
Definition: tpoint_spatialfuncs.c:378
void interpolate_point4d_sphere(const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p)
Find interpolation point p between geography points p1 and p2 so that the len(p1,p) == len(p1,...
Definition: tpoint_spatialfuncs.c:1108
void ensure_has_Z_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not Z dimension.
Definition: tpoint_spatialfuncs.c:528
Temporal * tpoint_transform(const Temporal *temp, int srid)
Transform a temporal point into another spatial reference system.
Definition: tpoint_spatialfuncs.c:322
Datum geom_intersection2d(Datum geom1, Datum geom2)
Return the 2D intersection between the two geometries.
Definition: tpoint_spatialfuncs.c:325
TSequence ** tpointseq_at_geometry(const TSequence *seq, const GSERIALIZED *gs, int *count)
Restrict a temporal point to (the complement of) a geometry.
Definition: tpoint_spatialfuncs.c:4015
Span ** tpointseq_interperiods(const TSequence *seq, GSERIALIZED *gsinter, int *count)
Get the periods at which a temporal sequence point with linear interpolation intersects a geometry.
Definition: tpoint_spatialfuncs.c:3799
long double geosegm_locate_point(Datum start, Datum end, Datum point, double *dist)
Return a float between 0 and 1 representing the location of the closest point on the geometry segment...
Definition: tpoint_spatialfuncs.c:1201
bool tgeogpointsegm_intersection(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
Return true if two segments of twp temporal geographic points intersect at a timestamp.
Definition: tpoint_spatialfuncs.c:1419
TInstant * tpointinst_transform(const TInstant *inst, int srid)
Transform a temporal point into another spatial reference system.
Definition: tpoint_spatialfuncs.c:197
Datum datum_round_geo(Datum value, Datum prec)
Set the precision of the coordinates to the number of decimal places.
Definition: tpoint_spatialfuncs.c:688
void ensure_same_geodetic(int16 flags1, int16 flags2)
Ensure that the spatiotemporal argument have the same type of coordinates, either planar or geodetic.
Definition: tpoint_spatialfuncs.c:366
datum_func2 pt_distance_fn(int16 flags)
Select the appropriate distance function.
Definition: tpoint_spatialfuncs.c:257
void ensure_has_Z(int16 flags)
Ensure that a temporal point has Z dimension.
Definition: tpoint_spatialfuncs.c:506
Temporal * tpoint_at_stbox1(const Temporal *temp, const STBox *box, bool upper_inc)
Restrict a temporal point to a spatiotemporal box.
Definition: tpoint_spatialfuncs.c:4336
void ensure_same_spatial_dimensionality_temp_box(int16 flags1, int16 flags2)
Ensure that a temporal point and a spatiotemporal box have the same spatial dimensionality as given b...
Definition: tpoint_spatialfuncs.c:454
void ensure_same_spatial_dimensionality_stbox_gs(const STBox *box1, const GSERIALIZED *gs)
Ensure that the spatiotemporal boxes have the same spatial dimensionality.
Definition: tpoint_spatialfuncs.c:492
TSequence * tpointdiscseq_transform(const TSequence *is, int srid)
void ensure_same_spatial_dimensionality(int16 flags1, int16 flags2)
Ensure that two temporal points have the same spatial dimensionality as given by their flags.
Definition: tpoint_spatialfuncs.c:441
Datum datum2_point_ne(Datum geopoint1, Datum geopoint2)
Return true if the points are equal.
Definition: tpoint_spatialfuncs.c:214
void ensure_same_srid_stbox_gs(const STBox *box, const GSERIALIZED *gs)
Ensure that a temporal point and a geometry/geography have the same SRID.
Definition: tpoint_spatialfuncs.c:415
Datum datum_transform(Datum value, Datum srid)
Call the PostGIS transform function.
Definition: tpoint_spatialfuncs.c:187
void ensure_same_dimensionality_tpoint_gs(const Temporal *temp, const GSERIALIZED *gs)
Ensure that a temporal point and a geometry/geography have the same dimensionality.
Definition: tpoint_spatialfuncs.c:480
long double closest_point2d_on_segment_ratio(const POINT2D *p, const POINT2D *A, const POINT2D *B, POINT2D *closest)
Return a long double between 0 and 1 representing the location of the closest point on the segment to...
Definition: tpoint_spatialfuncs.c:967
Datum pt_distance2d(Datum geom1, Datum geom2)
Return the 2D distance between the two geometric points.
Definition: tpoint_spatialfuncs.c:303
void ensure_point_type(const GSERIALIZED *gs)
Ensure that the geometry/geography is a point.
Definition: tpoint_spatialfuncs.c:572
bool datum_point_eq(Datum geopoint1, Datum geopoint2)
Return true if the points are equal.
Definition: tpoint_spatialfuncs.c:175
POINT3DZ datum_point3dz(Datum value)
Return a 3DZ point from the datum.
Definition: tpoint_spatialfuncs.c:99
void ensure_has_M_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has M dimension.
Definition: tpoint_spatialfuncs.c:550
TSequence * tpointcontseq_transform(const TSequence *seq, int srid)
LWGEOM ** lwpointarr_remove_duplicates(LWGEOM **points, int count, int *newcount)
Remove duplicates from an array of LWGEOM points.
Definition: tpoint_spatialfuncs.c:1561
void ensure_not_geodetic(int16 flags)
Ensure that the spatiotemporal argument has planar coordinates.
Definition: tpoint_spatialfuncs.c:354
void datum_point4d(Datum value, POINT4D *p)
Return a 4D point from the datum.
Definition: tpoint_spatialfuncs.c:111
void ensure_same_dimensionality_gs(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Ensure that two geometries/geographies have the same dimensionality.
Definition: tpoint_spatialfuncs.c:468
const POINT2D * gserialized_point2d_p(const GSERIALIZED *gs)
Return a 2D point from the serialized geometry.
Definition: tpoint_spatialfuncs.c:147
Datum geom_distance3d(Datum geom1, Datum geom2)
Return the 3D distance between the two geometries.
Definition: tpoint_spatialfuncs.c:283
GSERIALIZED * geo_serialize(const LWGEOM *geom)
Serialize a geometry/geography.
Definition: tpoint_spatialfuncs.c:226
GSERIALIZED * gspoint_make(double x, double y, double z, bool hasz, bool geodetic, int32 srid)
Create a point.
Definition: tpoint_spatialfuncs.c:1136
const POINT3DZ * datum_point3dz_p(Datum value)
Return a pointer to a 3DZ point from the datum.
Definition: tpoint_spatialfuncs.c:156
void ensure_has_not_Z_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not Z dimension.
Definition: tpoint_spatialfuncs.c:539
bool tpointsegm_intersection_value(const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
Return true if a segment of a temporal point value intersects a point at the timestamp.
Definition: tpoint_spatialfuncs.c:1278
Datum geosegm_interpolate_point(Datum start, Datum end, long double ratio)
Return a point interpolated from the geometry/geography segment with respect to the fraction of its t...
Definition: tpoint_spatialfuncs.c:1156
void ensure_same_srid_stbox(const STBox *box1, const STBox *box2)
Ensure that the spatiotemporal boxes have the same SRID.
Definition: tpoint_spatialfuncs.c:389
bool tgeompointsegm_intersection(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
Return true if two segments of a temporal geometric points intersect at a timestamp.
Definition: tpoint_spatialfuncs.c:1311
LWLINE * lwline_make(Datum value1, Datum value2)
Compute the trajectory from two geometry points.
Definition: tpoint_spatialfuncs.c:1609
void ensure_has_not_M_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not M dimension.
Definition: tpoint_spatialfuncs.c:561
Datum datum2_point_eq(Datum geopoint1, Datum geopoint2)
Return true if the points are equal.
Definition: tpoint_spatialfuncs.c:205
void ensure_spatial_validity(const Temporal *temp1, const Temporal *temp2)
Ensure that the spatial constraints required for operating on two temporal geometries are satisfied.
Definition: tpoint_spatialfuncs.c:340
Datum geog_distance(Datum geog1, Datum geog2)
Return the distance between the two geographies.
Definition: tpoint_spatialfuncs.c:293
void ensure_same_dimensionality(int16 flags1, int16 flags2)
Ensure that two temporal points have the same dimensionality as given by their flags.
Definition: tpoint_spatialfuncs.c:427
bool geopoint_collinear(Datum value1, Datum value2, Datum value3, double ratio, bool hasz, bool geodetic)
Return true if the three values are collinear.
Definition: tpoint_spatialfuncs.c:1472
POINT2D datum_point2d(Datum value)
Return a 2D point from the datum.
Definition: tpoint_spatialfuncs.c:88
LWGEOM * lwpointarr_make_trajectory(LWGEOM **lwpoints, int count, interpType interp)
Compute a trajectory from a set of points.
Definition: tpoint_spatialfuncs.c:1589
long double closest_point3dz_on_segment_ratio(const POINT3DZ *p, const POINT3DZ *A, const POINT3DZ *B, POINT3DZ *closest)
Return a float between 0 and 1 representing the location of the closest point on the segment to the g...
Definition: tpoint_spatialfuncs.c:1016
void ensure_non_empty(const GSERIALIZED *gs)
Ensure that the geometry/geography is not empty.
Definition: tpoint_spatialfuncs.c:583
TSequenceSet * tpointseqset_transform(const TSequenceSet *ss, int srid)
Transform a temporal point into another spatial reference system.
Definition: tpoint_spatialfuncs.c:253
Datum pt_distance3d(Datum geom1, Datum geom2)
Return the 3D distance between the two geometric points.
Definition: tpoint_spatialfuncs.c:314
const POINT3DZ * gserialized_point3dz_p(const GSERIALIZED *gs)
Return a 3DZ point from the serialized geometry.
Definition: tpoint_spatialfuncs.c:166
datum_func2 distance_fn(int16 flags)
Select the appropriate distance function.
Definition: tpoint_spatialfuncs.c:242
interpType
Enumeration that defines the interpolation types used in MobilityDB.
Definition: meos.h:124
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
signed int int32
Definition: pg_ext_defs.in.h:8
Definition: postgis_ext_defs.in.h:139
Definition: postgis_ext_defs.in.h:153
Definition: postgis_ext_defs.in.h:177
Definition: postgis_ext_defs.in.h:85
Definition: postgis_ext_defs.in.h:91
Definition: postgis_ext_defs.in.h:97
Definition: postgis_ext_defs.in.h:109
Structure to represent spatiotemporal boxes.
Definition: meos.h:107
Structure to represent spans (a.k.a.
Definition: meos.h:70
Structure to represent temporal values of instant subtype.
Definition: meos.h:148
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:186
Structure to represent temporal values of instant set or sequence subtype.
Definition: meos.h:165
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136