34#ifndef __MEOS_POSE_H__
35#define __MEOS_POSE_H__
62 #define VALIDATE_POSESET(set, ret) \
64 if (! ensure_not_null((void *) set) || \
65 ! ensure_set_isof_type((set), T_POSESET) ) \
69 #define VALIDATE_POSESET(set, ret) \
72 assert((set)->settype == T_POSESET); \
83 #define VALIDATE_TPOSE(temp, ret) \
85 if (! ensure_not_null((void *) (temp)) || \
86 ! ensure_temporal_isof_type((Temporal *) (temp), T_TPOSE) ) \
90 #define VALIDATE_TPOSE(temp, ret) \
93 assert(((Temporal *) (temp))->temptype == T_TPOSE); \
106extern uint8_t *
pose_as_wkb(
const Pose *pose, uint8_t variant,
size_t *size_out);
116extern Pose *
pose_make_3d(
double x,
double y,
double z,
double W,
double X,
double Y,
double Z, int32_t
srid);
double nad_tpose_stbox(const Temporal *temp, const STBox *box)
Return the nearest approach distance of a temporal pose and a spatiotemporal box.
Definition: tpose_distance.c:225
GSERIALIZED * tpose_trajectory(const Temporal *temp)
Return the trajectory of a temporal pose.
Definition: tpose_spatialfuncs.c:61
Set * tpose_points(const Temporal *temp)
Return the array of points of a temporal pose @csqlfn Tpose_points()
Definition: tpose.c:610
Temporal * tpose_rotation(const Temporal *temp)
Return a the rotation of a temporal pose as a temporal float.
Definition: tpose.c:460
Pose * tpose_start_value(const Temporal *temp)
Return a copy of the start value of a temporal pose.
Definition: tpose.c:488
Pose ** tpose_values(const Temporal *temp, int *count)
Return the array of copies of base values of a temporal pose.
Definition: tpose.c:538
bool tpose_value_n(const Temporal *temp, int n, Pose **result)
Return a copy of the n-th value of a temporal pose.
Definition: tpose.c:519
Pose * tpose_end_value(const Temporal *temp)
Return a copy of the end value of a temporal pose.
Definition: tpose.c:503
bool tpose_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, Pose **value)
Return the value of a temporal pose at a timestamptz.
Definition: tpose.c:639
uint32 pose_hash(const Pose *pose)
Return the 32-bit hash value of a pose.
Definition: pose.c:1426
double pose_rotation(const Pose *pose)
Return the rotation of a 2D pose.
Definition: pose.c:890
uint64 pose_hash_extended(const Pose *pose, uint64 seed)
Return the 64-bit hash value of a pose using a seed.
Definition: pose.c:1463
double * pose_orientation(const Pose *pose)
Return the orientation of a 3D pose.
Definition: pose.c:916
STBox * pose_tstzspan_to_stbox(const Pose *pose, const Span *s)
Return a spatiotemporal box constructed from a pose and a timestamptz.
Definition: tpose_boxops.c:249
STBox * pose_timestamptz_to_stbox(const Pose *pose, TimestampTz t)
Return a spatiotemporal box constructed from a pose and a timestamptz.
Definition: tpose_boxops.c:212
bool pose_eq(const Pose *pose1, const Pose *pose2)
Return true if the first pose is equal to the second one.
Definition: pose.c:1256
int pose_cmp(const Pose *pose1, const Pose *pose2)
Return -1, 0, or 1 depending on whether the first pose is less than, equal to, or greater than the se...
Definition: pose.c:1337
bool pose_ge(const Pose *pose1, const Pose *pose2)
Return true if the first pose is greater than or equal to the second one.
Definition: pose.c:1402
bool pose_nsame(const Pose *pose1, const Pose *pose2)
Return true if the first pose is not equal to the second one.
Definition: pose.c:1325
bool pose_le(const Pose *pose1, const Pose *pose2)
Return true if the first pose is less than or equal to the second one.
Definition: pose.c:1379
bool pose_lt(const Pose *pose1, const Pose *pose2)
Return true if the first pose is less than the second one.
Definition: pose.c:1368
bool pose_ne(const Pose *pose1, const Pose *pose2)
Return true if the first pose is not equal to the second one.
Definition: pose.c:1285
bool pose_gt(const Pose *pose1, const Pose *pose2)
Return true if the first pose is greater than the second one.
Definition: pose.c:1390
bool pose_same(const Pose *pose1, const Pose *pose2)
Return true if the first pose is equal to the second one.
Definition: pose.c:1296
Pose * pose_copy(const Pose *pose)
Copy a pose value.
Definition: pose.c:802
Pose * pose_make_2d(double x, double y, double theta, int32_t srid)
Construct a 2D pose value from the arguments.
Definition: pose.c:660
Pose * pose_make_point2d(const GSERIALIZED *gs, double theta)
Construct a 2D pose value from a 2D point and a rotation angle.
Definition: pose.c:688
Pose * pose_make_3d(double x, double y, double z, double W, double X, double Y, double Z, int32_t srid)
Construct a 3D pose value from the arguments.
Definition: pose.c:722
Pose * pose_make_point3d(const GSERIALIZED *gs, double W, double X, double Y, double Z)
Construct a 3D pose value from the arguments.
Definition: pose.c:760
GSERIALIZED * pose_to_point(const Pose *pose)
Convert a pose into a geometry point.
Definition: pose.c:821
STBox * pose_to_stbox(const Pose *pose)
Convert a pose into a spatiotemporal box.
Definition: tpose_boxops.c:102
char * pose_as_ewkt(const Pose *pose, int maxdd)
Return the Extended Well-Known Text (EWKT) representation of a pose.
Definition: pose.c:571
Pose * pose_from_hexwkb(const char *hexwkb)
Return a pose from its ASCII hex-encoded Well-Known Binary (WKB) representation.
Definition: pose.c:604
char * pose_as_hexwkb(const Pose *pose, uint8_t variant, size_t *size)
Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a pose.
Definition: pose.c:640
char * pose_out(const Pose *pose, int maxdd)
Return the string representation of a pose.
Definition: pose.c:460
char * pose_as_text(const Pose *pose, int maxdd)
Return the Well-Known Text (WKT) representation of a pose.
Definition: pose.c:558
uint8_t * pose_as_wkb(const Pose *pose, uint8_t variant, size_t *size_out)
Return the Well-Known Binary (WKB) representation of a pose.
Definition: pose.c:623
Pose * pose_from_wkb(const uint8_t *wkb, size_t size)
Return a pose from its Well-Known Binary (WKB) representation.
Definition: pose.c:589
Pose * pose_in(const char *str)
Return a pose from its string representation.
Definition: pose.c:444
Pose * pose_transform(const Pose *pose, int32_t srid)
Return a pose transformed to another SRID.
Definition: pose.c:1104
int32_t pose_srid(const Pose *pose)
Return the SRID.
Definition: pose.c:1019
Pose * pose_transform_pipeline(const Pose *pose, const char *pipelinestr, int32_t srid, bool is_forward)
Return a pose transformed to another SRID using a pipeline.
Definition: pose.c:1136
void pose_set_srid(Pose *pose, int32_t srid)
Set the SRID.
Definition: pose.c:1046
Pose ** posearr_round(const Pose **posearr, int count, int maxdd)
Return an array of poses with the precision of the vales set to a number of decimal places.
Definition: pose.c:996
Pose * pose_round(const Pose *pose, int maxdd)
Return a pose with the precision of the values set to a number of decimal places.
Definition: pose.c:944
int always_eq_tpose_pose(const Temporal *temp, const Pose *pose)
Return true if a temporal pose is always equal to a pose.
Definition: tpose_compops.c:169
int ever_eq_tpose_pose(const Temporal *temp, const Pose *pose)
Return true if a temporal pose is ever equal to a circular buffer.
Definition: tpose_compops.c:115
int ever_ne_pose_tpose(const Pose *pose, const Temporal *temp)
Return true if a pose is ever different from a temporal pose.
Definition: tpose_compops.c:128
int ever_eq_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal poses are ever equal.
Definition: tpose_compops.c:210
int always_eq_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal poses are always equal.
Definition: tpose_compops.c:234
int always_ne_tpose_pose(const Temporal *temp, const Pose *pose)
Return true if a temporal pose is always different from a pose.
Definition: tpose_compops.c:196
int always_ne_pose_tpose(const Pose *pose, const Temporal *temp)
Return true if a pose is always different from a temporal pose.
Definition: tpose_compops.c:182
int always_eq_pose_tpose(const Pose *pose, const Temporal *temp)
Return true if a pose is always equal to a temporal pose.
Definition: tpose_compops.c:155
int ever_eq_pose_tpose(const Pose *pose, const Temporal *temp)
Return true if a pose is ever equal to a temporal circular buffer.
Definition: tpose_compops.c:101
int always_ne_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal poses are always different.
Definition: tpose_compops.c:246
int ever_ne_tpose_pose(const Temporal *temp, const Pose *pose)
Return true if a temporal pose is ever different from a pose.
Definition: tpose_compops.c:142
int ever_ne_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal poses are ever different.
Definition: tpose_compops.c:222
Temporal * tne_tpose_pose(const Temporal *temp, const Pose *pose)
Return the temporal inequality of a temporal pose and a pose.
Definition: tpose_compops.c:345
Temporal * teq_tpose_pose(const Temporal *temp, const Pose *pose)
Return the temporal equality of a temporal pose and a pose.
Definition: tpose_compops.c:331
Temporal * tne_pose_tpose(const Pose *pose, const Temporal *temp)
Return the temporal inequality of a pose and a temporal pose.
Definition: tpose_compops.c:315
Temporal * teq_pose_tpose(const Pose *pose, const Temporal *temp)
Return the temporal equality of a pose and a temporal pose.
Definition: tpose_compops.c:302
Temporal * tpoint_tfloat_to_tpose(const Temporal *tpoint, const Temporal *tradius)
Return a temporal pose from a temporal point and a temporal float.
Definition: tpose.c:390
Temporal * tpose_to_tpoint(const Temporal *temp)
Return a geometry point from a temporal pose.
Definition: tpose.c:435
GSERIALIZED * shortestline_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return the line connecting the nearest approach point between two temporal networks.
Definition: tpose_distance.c:334
GSERIALIZED * shortestline_tpose_pose(const Temporal *temp, const Pose *pose)
Return the line connecting the nearest approach point between a pose and a temporal pose.
Definition: tpose_distance.c:313
double nad_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach distance of two temporal poses.
Definition: tpose_distance.c:267
Temporal * distance_tpose_point(const Temporal *temp, const GSERIALIZED *gs)
Return the temporal distance between a geometry and a temporal pose.
Definition: tpose_distance.c:57
double nad_tpose_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach distance of two temporal pose and a geometry.
Definition: tpose_distance.c:204
TInstant * nai_tpose_pose(const Temporal *temp, const Pose *pose)
Return the nearest approach instant of a pose and a temporal pose.
Definition: tpose_distance.c:148
Temporal * distance_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return the temporal distance between two temporal poses.
Definition: tpose_distance.c:97
Temporal * distance_tpose_pose(const Temporal *temp, const Pose *pose)
Return the temporal distance between a temporal pose and a pose.
Definition: tpose_distance.c:77
GSERIALIZED * shortestline_tpose_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the line connecting the nearest approach point between a geometry and a temporal pose.
Definition: tpose_distance.c:292
TInstant * nai_tpose_tpose(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach instant of two temporal poses.
Definition: tpose_distance.c:173
TInstant * nai_tpose_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach instant of the temporal pose and a geometry.
Definition: tpose_distance.c:123
double nad_tpose_pose(const Temporal *temp, const Pose *pose)
Return the nearest approach distance of a temporal pose and a pose.
Definition: tpose_distance.c:247
Temporal * tpose_in(const char *str)
Return a temporal pose from its Well-Known Text (WKT) representation.
Definition: tpose.c:211
Temporal * tpose_minus_pose(const Temporal *temp, const Pose *pose)
Return a temporal pose restricted to the complement of a pose.
Definition: tpose.c:681
Temporal * tpose_minus_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
Return a temporal point restricted to (the complement of) a geometry.
Definition: tpose_spatialfuncs.c:131
Temporal * tpose_at_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal pose restricted to a geometry.
Definition: tpose_spatialfuncs.c:183
Temporal * tpose_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal point restricted to (the complement of) a geometry.
Definition: tpose_spatialfuncs.c:197
Temporal * tpose_at_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
Return a temporal pose restricted to a geometry.
Definition: tpose_spatialfuncs.c:116
Temporal * tpose_at_pose(const Temporal *temp, const Pose *pose)
Return a temporal pose restricted to a pose.
Definition: tpose.c:665
Pose * poseset_start_value(const Set *s)
Return a copy of the start value of a pose set.
Definition: poseset_meos.c:152
Pose * poseset_end_value(const Set *s)
Return a copy of the end value of a pose set.
Definition: poseset_meos.c:167
Pose ** poseset_values(const Set *s)
Return the array of copies of the values of a pose set.
Definition: poseset_meos.c:203
bool poseset_value_n(const Set *s, int n, Pose **result)
Return in the last argument a copy of the n-th value of a circular buffer set.
Definition: poseset_meos.c:185
Set * poseset_make(const Pose **values, int count)
Return a pose set from an array of values.
Definition: poseset_meos.c:108
Set * pose_to_set(const Pose *pose)
Convert a pose into a pose set.
Definition: poseset_meos.c:132
char * poseset_out(const Set *s, int maxdd)
Return the string representation of a pose set.
Definition: poseset_meos.c:89
Set * poseset_in(const char *str)
Return a set from its Well-Known Text (WKT) representation.
Definition: poseset_meos.c:74
Set * pose_union_transfn(Set *state, const Pose *pose)
Transition function for set union aggregate of poses.
Definition: poseset_meos.c:364
Set * minus_set_pose(const Set *s, const Pose *pose)
Return the difference of a set and a pose.
Definition: poseset_meos.c:345
Set * union_set_pose(const Set *s, const Pose *pose)
Return the union of a set and a pose.
Definition: poseset_meos.c:271
Set * union_pose_set(const Pose *pose, const Set *s)
Return the union of a pose and a set.
Definition: poseset_meos.c:287
Set * minus_pose_set(const Pose *pose, const Set *s)
Return the difference of a pose and a set.
Definition: poseset_meos.c:329
Set * intersection_set_pose(const Set *s, const Pose *pose)
Return the intersection of a set and a pose.
Definition: poseset_meos.c:300
bool contains_set_pose(const Set *s, Pose *pose)
Return true if a set contains a pose.
Definition: poseset_meos.c:239
bool contained_pose_set(const Pose *pose, const Set *s)
Return true if a pose is contained in a set.
Definition: poseset_meos.c:255
Set * intersection_pose_set(const Pose *pose, const Set *s)
Return the intersection of a pose and a set.
Definition: poseset_meos.c:316
External API of the Mobility Engine Open Source (MEOS) library.
double distance_pose_pose(const Pose *pose1, const Pose *pose2)
Return the distance between two poses.
Definition: pose.c:1181
double distance_pose_stbox(const Pose *pose, const STBox *box)
Return the distance between a pose and a spatiotemporal box.
Definition: pose.c:1232
double distance_pose_geo(const Pose *pose, const GSERIALIZED *gs)
Return the distance between a pose and a geometry.
Definition: pose.c:1212
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
unsigned int uint32
Definition: postgres_ext_defs.in.h:16
unsigned long int uint64
Definition: postgres_ext_defs.in.h:17
Definition: postgis_ext_defs.in.h:170
uint8_t srid[3]
srid
Definition: pose.h:59
Basic functions for static pose objects.
Definition: pose.h:56
Structure to represent spatiotemporal boxes.
Definition: meos.h:134
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173
int const GSERIALIZED * gs
Definition: trgeo_spatialrels.h:52