34#ifndef __MEOS_NPOINT_H__
35#define __MEOS_NPOINT_H__
75 #define VALIDATE_NPOINTSET(set, ret) \
77 if (! ensure_not_null((void *) (set)) || \
78 ! ensure_set_isof_type((set), T_NPOINTSET) ) \
82 #define VALIDATE_NPOINTSET(set, ret) \
85 assert(set->settype == T_NPOINTSET); \
96 #define VALIDATE_TNPOINT(temp, ret) \
98 if (! ensure_not_null((void *) (temp)) || \
99 ! ensure_temporal_isof_type((Temporal *) (temp), T_TNPOINT) ) \
103 #define VALIDATE_TNPOINT(temp, ret) \
106 assert(((Temporal *) (temp))->temptype == T_TNPOINT); \
double tnpoint_length(const Temporal *temp)
Length traversed by a temporal network point.
Definition: tnpoint_spatialfuncs.c:322
Nsegment ** tnpoint_positions(const Temporal *temp, int *count)
Return the network segments covered by the temporal network point @csqlfn Tnpoint_positions()
Definition: tnpoint.c:569
Set * tnpoint_routes(const Temporal *temp)
Return the array of routes of a temporal network point @csqlfn Tnpoint_routes()
Definition: tnpoint.c:684
GSERIALIZED * tnpoint_twcentroid(const Temporal *temp)
Return the time-weighed centroid of a temporal network point.
Definition: tnpoint_spatialfuncs.c:512
Temporal * tnpoint_speed(const Temporal *temp)
Speed of a temporal network point.
Definition: tnpoint_spatialfuncs.c:482
Temporal * tnpoint_cumulative_length(const Temporal *temp)
Cumulative length traversed by a temporal network point.
Definition: tnpoint_spatialfuncs.c:399
GSERIALIZED * tnpoint_trajectory(const Temporal *temp)
Return the geometry covered by a temporal network point.
Definition: tnpoint_spatialfuncs.c:229
int64 tnpoint_route(const Temporal *temp)
Return the single route of a temporal network point.
Definition: tnpoint.c:606
SkipList * tnpoint_tcentroid_transfn(SkipList *state, Temporal *temp)
Transition function for temporal centroid aggregation of temporal network points.
Definition: tnpoint_aggfuncs.c:59
uint32 npoint_hash(const Npoint *np)
Return the 32-bit hash value of a network point.
Definition: npoint.c:1907
double npoint_position(const Npoint *np)
Return the position of a network point.
Definition: npoint.c:1596
int64 nsegment_route(const Nsegment *ns)
Return the route of a network segment.
Definition: npoint.c:1610
double nsegment_end_position(const Nsegment *ns)
Return the end position of a network segment.
Definition: npoint.c:1638
uint64 npoint_hash_extended(const Npoint *np, uint64 seed)
Return the 64-bit hash value of a network point using a seed.
Definition: npoint.c:1930
double nsegment_start_position(const Nsegment *ns)
Return the start position of a network segment.
Definition: npoint.c:1624
int64 npoint_route(const Npoint *np)
Return the route of a network point.
Definition: npoint.c:1581
bool nsegment_ne(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is not equal to the second one.
Definition: npoint.c:1809
int npoint_cmp(const Npoint *np1, const Npoint *np2)
Return -1, 0, or 1 depending on whether the first network point is less than, equal to,...
Definition: npoint.c:1717
bool nsegment_gt(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is greater than the second one.
Definition: npoint.c:1877
bool npoint_lt(const Npoint *np1, const Npoint *np2)
Return true if the first network point is less than the second one.
Definition: npoint.c:1741
bool npoint_ge(const Npoint *np1, const Npoint *np2)
Return true if the first network point is greater than or equal to the second one.
Definition: npoint.c:1779
bool nsegment_le(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is less than or equal to the second one.
Definition: npoint.c:1864
bool npoint_same(const Npoint *np1, const Npoint *np2)
Return true if two network points are approximately equal with respect to an epsilon value.
Definition: tnpoint_spatialfuncs.c:259
bool nsegment_eq(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is equal to the second one.
Definition: npoint.c:1793
bool npoint_le(const Npoint *np1, const Npoint *np2)
Return true if the first network point is less than or equal to the second one.
Definition: npoint.c:1754
bool npoint_gt(const Npoint *np1, const Npoint *np2)
Return true if the first network point is greater than the second one.
Definition: npoint.c:1766
bool npoint_eq(const Npoint *np1, const Npoint *np2)
Return true if the first network point is equal to the second one.
Definition: npoint.c:1690
int nsegment_cmp(const Nsegment *ns1, const Nsegment *ns2)
Return -1, 0, or 1 depending on whether the first network segment is less than, equal to,...
Definition: npoint.c:1822
bool npoint_ne(const Npoint *np1, const Npoint *np2)
Return true if the first network point is not equal to the second one.
Definition: npoint.c:1704
bool nsegment_lt(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is less than the second one.
Definition: npoint.c:1851
bool nsegment_ge(const Nsegment *ns1, const Nsegment *ns2)
Return true if the first network segment is greater than or equal to the second one.
Definition: npoint.c:1890
Npoint * npoint_make(int64 rid, double pos)
Return a network point from a route identifier and a position.
Definition: npoint.c:1112
Nsegment * nsegment_make(int64 rid, double pos1, double pos2)
Return a network segment from a route identifier and two positions.
Definition: npoint.c:1148
Nsegment * geom_to_nsegment(const GSERIALIZED *gs)
Transform a geometry into a network segment.
Definition: npoint.c:1401
GSERIALIZED * nsegment_to_geom(const Nsegment *ns)
Transform a network segment into a geometry.
Definition: npoint.c:1379
Npoint * geom_to_npoint(const GSERIALIZED *gs)
Transform a geometry into a network point.
Definition: npoint.c:527
Nsegment * npoint_to_nsegment(const Npoint *np)
Convert a network point into a network segment.
Definition: npoint.c:1188
STBox * nsegment_to_stbox(const Nsegment *np)
Convert a network segment into a spatiotemporal box.
Definition: npoint.c:1272
STBox * npoint_to_stbox(const Npoint *np)
Convert a network point into a spatiotemporal box.
Definition: npoint.c:1221
GSERIALIZED * npoint_to_geom(const Npoint *np)
Transform a network point into a geometry.
Definition: npoint.c:1362
char * npoint_as_text(const Npoint *np, int maxdd)
Return the Well-Known Text (WKT) representation of a network point.
Definition: npoint.c:984
Nsegment * nsegment_in(const char *str)
Return a network point from its string representation.
Definition: npoint.c:922
char * npoint_out(const Npoint *np, int maxdd)
Return the string representation of a network point.
Definition: npoint.c:833
Npoint * npoint_from_wkb(const uint8_t *wkb, size_t size)
Return a network point from its Well-Known Binary (WKB) representation.
Definition: npoint.c:1038
uint8_t * npoint_as_wkb(const Npoint *np, uint8_t variant, size_t *size_out)
Return the Well-Known Binary (WKB) representation of a circular buffer.
Definition: npoint.c:1074
Npoint * npoint_from_hexwkb(const char *hexwkb)
Return a network point from its ASCII hex-encoded Well-Known Binary (WKB) representation.
Definition: npoint.c:1053
char * npoint_as_ewkt(const Npoint *np, int maxdd)
Return the Extended Well-Known Text (EWKT) representation of a network point.
Definition: npoint.c:1003
Npoint * npoint_in(const char *str)
Return a network point from its string representation.
Definition: npoint.c:818
char * nsegment_out(const Nsegment *ns, int maxdd)
Return the string representation of a network segment.
Definition: npoint.c:937
char * npoint_as_hexwkb(const Npoint *np, uint8_t variant, size_t *size_out)
Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a network point.
Definition: npoint.c:1091
double route_length(int64 rid)
Access the edge table to return the route length from the corresponding route identifier.
Definition: npoint.c:317
bool route_exists(int64 rid)
Return true if the edge table contains a route with the route identifier.
Definition: npoint.c:234
GSERIALIZED * route_geom(int64 rid)
Access the edge table to get the route geometry from corresponding route identifier.
Definition: npoint.c:413
int32_t get_srid_ways(void)
Return the SRID of the routes in the ways table.
Definition: npoint.c:124
Nsegment * nsegment_round(const Nsegment *ns, int maxdd)
Return a network segment with the precision of the positions set to a number of decimal places.
Definition: npoint.c:1561
Npoint * npoint_round(const Npoint *np, int maxdd)
Return a network point with the precision of the position set to a number of decimal places.
Definition: npoint.c:1533
int always_eq_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return true if a temporal network point is always equal to a network point.
Definition: tnpoint_compops.c:165
int ever_eq_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return true if a temporal network point is ever equal to a network point.
Definition: tnpoint_compops.c:109
int always_ne_npoint_tnpoint(const Npoint *np, const Temporal *temp)
Return true if a network point is always different from a temporal network point.
Definition: tnpoint_compops.c:179
int ever_eq_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal network points are ever equal.
Definition: tnpoint_compops.c:207
int ever_eq_npoint_tnpoint(const Npoint *np, const Temporal *temp)
Return true if a network point is ever equal to a temporal network point.
Definition: tnpoint_compops.c:95
int always_ne_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal network points are always different.
Definition: tnpoint_compops.c:243
int ever_ne_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return true if a temporal network point is ever different from a network point.
Definition: tnpoint_compops.c:137
int always_eq_npoint_tnpoint(const Npoint *np, const Temporal *temp)
Return true if a network point is always equal to a temporal network point.
Definition: tnpoint_compops.c:151
int always_eq_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal network points are always equal.
Definition: tnpoint_compops.c:231
int ever_ne_npoint_tnpoint(const Npoint *np, const Temporal *temp)
Return true if a network point is ever different from a temporal network point.
Definition: tnpoint_compops.c:123
int always_ne_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return true if a temporal network point is always different from a network point.
Definition: tnpoint_compops.c:193
int ever_ne_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal network points are ever different.
Definition: tnpoint_compops.c:219
Temporal * tne_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the temporal inequality of a temporal network point and a network point.
Definition: tnpoint_compops.c:295
Temporal * teq_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the temporal equality of a temporal network point and a network point.
Definition: tnpoint_compops.c:281
Temporal * tgeompoint_to_tnpoint(const Temporal *temp)
Convert a temporal geometry point into a temporal network point.
Definition: tnpoint.c:422
Temporal * tnpoint_to_tgeompoint(const Temporal *temp)
Convert a temporal network point into a temporal geometry point.
Definition: tnpoint.c:338
Temporal * distance_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the temporal distance between a temporal network point and a network point.
Definition: tnpoint_distance.c:95
double nad_tnpoint_stbox(const Temporal *temp, const STBox *box)
Return the nearest approach distance of a temporal network point and a spatiotemporal box.
Definition: tnpoint_distance.c:244
GSERIALIZED * shortestline_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the line connecting the nearest approach point between a network point and a temporal network ...
Definition: tnpoint_distance.c:333
GSERIALIZED * shortestline_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return the line connecting the nearest approach point between two temporal networks.
Definition: tnpoint_distance.c:354
double nad_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach distance of a temporal network point and a geometry.
Definition: tnpoint_distance.c:223
double nad_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the nearest approach distance of a temporal network point and a network point.
Definition: tnpoint_distance.c:267
Temporal * distance_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return the temporal distance between two temporal network points.
Definition: tnpoint_distance.c:115
GSERIALIZED * shortestline_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the line connecting the nearest approach point between a geometry and a temporal network point...
Definition: tnpoint_distance.c:312
double nad_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach distance of two temporal network points.
Definition: tnpoint_distance.c:287
Temporal * distance_tnpoint_point(const Temporal *temp, const GSERIALIZED *gs)
Return the temporal distance between a geometry point and a temporal network point @csqlfn Distance_t...
Definition: tnpoint_distance.c:73
TInstant * nai_tnpoint_npoint(const Temporal *temp, const Npoint *np)
Return the nearest approach instant of the network point and a temporal network point.
Definition: tnpoint_distance.c:167
TInstant * nai_tnpoint_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach instant of the temporal network point and a geometry.
Definition: tnpoint_distance.c:141
TInstant * nai_tnpoint_tnpoint(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach instant of two temporal network points.
Definition: tnpoint_distance.c:192
Temporal * tnpoint_in(const char *str)
Return a temporal network point from its Well-Known Text (WKT) representation.
Definition: tnpoint.c:189
char * tnpoint_out(const Temporal *temp, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal network point.
Definition: tnpoint.c:204
Temporal * tnpoint_at_npoint(const Temporal *temp, const Npoint *np)
Restrict a temporal network point to a network point.
Definition: tnpoint.c:763
Temporal * tnpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs)
Return a temporal point restricted to (the complement of) a geometry.
Definition: tnpoint_spatialfuncs.c:582
Temporal * tnpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs)
Return a temporal network point restricted to a geometry.
Definition: tnpoint_spatialfuncs.c:569
Temporal * tnpoint_at_npointset(const Temporal *temp, const Set *s)
Restrict a temporal network point to a set of network points.
Definition: tnpoint.c:813
Temporal * tnpoint_at_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal network point restricted to a geometry.
Definition: tnpoint_spatialfuncs.c:626
Temporal * tnpoint_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal point restricted to (the complement of) a geometry.
Definition: tnpoint_spatialfuncs.c:640
Temporal * tnpoint_minus_npoint(const Temporal *temp, const Npoint *np)
Restrict a temporal network point to the complement of a network point.
Definition: tnpoint.c:776
Temporal * tnpoint_minus_npointset(const Temporal *temp, const Set *s)
Restrict a temporal network point to the complement of a set of network points.
Definition: tnpoint.c:827
Npoint * npointset_end_value(const Set *s)
Return a copy of the end value of a network point set.
Definition: npointset_meos.c:154
Npoint ** npointset_values(const Set *s)
Return the array of copies of the values of a network point set.
Definition: npointset_meos.c:190
Npoint * npointset_start_value(const Set *s)
Return a copy of the start value of a network point set.
Definition: npointset_meos.c:139
Set * npointset_routes(const Set *s)
Return the routes of a network point set.
Definition: tnpoint.c:712
bool npointset_value_n(const Set *s, int n, Npoint **result)
Return in the last argument a copy of the n-th value of a circular buffer set.
Definition: npointset_meos.c:172
Set * npointset_make(const Npoint **values, int count)
Return a network point set from an array of values.
Definition: npointset_meos.c:95
Set * npoint_to_set(const Npoint *np)
Convert a network point into a network point set.
Definition: npointset_meos.c:119
Set * npointset_in(const char *str)
Return a set from its Well-Known Text (WKT) representation.
Definition: npointset_meos.c:61
char * npointset_out(const Set *s, int maxdd)
Return the string representation of a network point set.
Definition: npointset_meos.c:76
Set * intersection_set_npoint(const Set *s, const Npoint *np)
Return the intersection of a set and a network point.
Definition: npointset_meos.c:287
Set * npoint_union_transfn(Set *state, const Npoint *np)
Transition function for set union aggregate of network points.
Definition: npointset_meos.c:351
Set * union_npoint_set(const Npoint *np, const Set *s)
Return the union of a network point and a set.
Definition: npointset_meos.c:274
Set * union_set_npoint(const Set *s, const Npoint *np)
Return the union of a set and a network point.
Definition: npointset_meos.c:258
Set * minus_npoint_set(const Npoint *np, const Set *s)
Return the difference of a network point and a set.
Definition: npointset_meos.c:316
bool contains_set_npoint(const Set *s, Npoint *np)
Return true if a set contains a network point.
Definition: npointset_meos.c:226
Set * intersection_npoint_set(const Npoint *np, const Set *s)
Return the intersection of a network point and a set.
Definition: npointset_meos.c:303
Set * minus_set_npoint(const Set *s, const Npoint *np)
Return the difference of a set and a network point.
Definition: npointset_meos.c:332
bool contained_npoint_set(const Npoint *np, const Set *s)
Return true if a network point is contained in a set.
Definition: npointset_meos.c:242
External API of the Mobility Engine Open Source (MEOS) library.
int32_t nsegment_srid(const Nsegment *ns)
STBox * npoint_tstzspan_to_stbox(const Npoint *np, const Span *s)
Return a spatiotemporal box constructed from a network point and a timestamptz.
Definition: npoint.c:1342
int32_t npoint_srid(const Npoint *np)
STBox * npoint_timestamptz_to_stbox(const Npoint *np, TimestampTz t)
Return a spatiotemporal box constructed from a network point and a timestamptz.
Definition: npoint.c:1308
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
long int int64
Definition: postgres_ext_defs.in.h:12
Definition: postgis_ext_defs.in.h:170
int64 rid
route identifier
Definition: meos_npoint.h:53
double pos
position
Definition: meos_npoint.h:54
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos_npoint.h:52
double pos2
position2
Definition: meos_npoint.h:63
double pos1
position1
Definition: meos_npoint.h:62
int64 rid
route identifier
Definition: meos_npoint.h:61
Definition: meos_npoint.h:60
Structure to represent spatiotemporal boxes.
Definition: meos.h:134
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent skiplists that keep the current state of an aggregation.
Definition: meos.h:272
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