MobilityDB  1.0
Macros | Functions
tnpoint_static.c File Reference

Network-based static point and segment types. More...

#include "npoint/tnpoint_static.h"
#include <assert.h>
#include <libpq/pqformat.h>
#include <executor/spi.h>
#include <liblwgeom.h>
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/temporal_util.h"
#include "general/tnumber_mathfuncs.h"
#include "point/tpoint_out.h"
#include "point/tpoint_spatialfuncs.h"
#include "npoint/tnpoint.h"
#include "npoint/tnpoint_parser.h"
Include dependency graph for tnpoint_static.c:

Macros

#define MAXNPOINTLEN   128
 Buffer size for input and output of npoint values. More...
 

Functions

ArrayType * int64arr_to_array (const int64 *int64arr, int count)
 Convert a C array of int64 values into a PostgreSQL array. More...
 
ArrayType * nsegmentarr_to_array (nsegment **nsegmentarr, int count)
 Convert a C array of network segment values into a PostgreSQL array. More...
 
int32_t get_srid_ways ()
 Return the SRID of the routes in the ways table. More...
 
Datum npointarr_to_geom_internal (npoint **points, int count)
 Convert a network point array into a geometry. More...
 
Datum nsegmentarr_to_geom_internal (nsegment **segments, int count)
 Convert a network segment array into a geometry. More...
 
static int nsegment_sort_cmp (nsegment **l, nsegment **r)
 Comparator function for network segments. More...
 
static void nsegmentarr_sort (nsegment **segments, int count)
 Sort function for network segments. More...
 
nsegment ** nsegmentarr_normalize (nsegment **segments, int *count)
 Normalize the array of temporal segments. More...
 
PGDLLEXPORT Datum npoint_in (PG_FUNCTION_ARGS)
 Input function for network points Example of input: (1, 0.5) More...
 
PGDLLEXPORT Datum npoint_out (PG_FUNCTION_ARGS)
 Output function for network points. More...
 
PGDLLEXPORT Datum npoint_recv (PG_FUNCTION_ARGS)
 Receive function for network points. More...
 
PGDLLEXPORT Datum npoint_send (PG_FUNCTION_ARGS)
 Send function for network points. More...
 
PGDLLEXPORT Datum nsegment_in (PG_FUNCTION_ARGS)
 Input function for network segments Example of input: (1, 0.5, 0.6) More...
 
PGDLLEXPORT Datum nsegment_out (PG_FUNCTION_ARGS)
 Output function for network segments. More...
 
PGDLLEXPORT Datum nsegment_recv (PG_FUNCTION_ARGS)
 Receive function for network segments. More...
 
PGDLLEXPORT Datum nsegment_send (PG_FUNCTION_ARGS)
 Send function for network segments. More...
 
npointnpoint_make (int64 rid, double pos)
 Construct an network point value from the arguments. More...
 
PGDLLEXPORT Datum npoint_constructor (PG_FUNCTION_ARGS)
 Construct an network point value from the arguments. More...
 
nsegmentnsegment_make (int64 rid, double pos1, double pos2)
 Construct an network segment value from the arguments. More...
 
PGDLLEXPORT Datum nsegment_constructor (PG_FUNCTION_ARGS)
 Construct an network segment value from the arguments. More...
 
PGDLLEXPORT Datum nsegment_from_npoint (PG_FUNCTION_ARGS)
 Construct an network segment value from the network point. More...
 
PGDLLEXPORT Datum npoint_route (PG_FUNCTION_ARGS)
 Returns the route of the network point. More...
 
PGDLLEXPORT Datum npoint_position (PG_FUNCTION_ARGS)
 Returns the position of the network point. More...
 
PGDLLEXPORT Datum nsegment_route (PG_FUNCTION_ARGS)
 Returns the route of the network segment. More...
 
PGDLLEXPORT Datum nsegment_start_position (PG_FUNCTION_ARGS)
 Returns the start position of the network segment. More...
 
PGDLLEXPORT Datum nsegment_end_position (PG_FUNCTION_ARGS)
 Returns the end position of the network segment. More...
 
Datum npoint_set_precision_internal (Datum npt, Datum size)
 Set the precision of the position of a network point to the number of decimal places. More...
 
PGDLLEXPORT Datum npoint_set_precision (PG_FUNCTION_ARGS)
 Set the precision of the position of a network point to the number of decimal places. More...
 
PGDLLEXPORT Datum nsegment_set_precision (PG_FUNCTION_ARGS)
 Set the precision of the position of a network point to the number of decimal places. More...
 
bool npoint_eq_internal (const npoint *np1, const npoint *np2)
 Returns true if the first network point is equal to the second one. More...
 
PGDLLEXPORT Datum npoint_eq (PG_FUNCTION_ARGS)
 Returns true if the first network point is equal to the second one. More...
 
bool npoint_ne_internal (const npoint *np1, const npoint *np2)
 Returns true if the first network point is not equal to the second one. More...
 
PGDLLEXPORT Datum npoint_ne (PG_FUNCTION_ARGS)
 Returns true if the first network point is not equal to the second one. More...
 
int npoint_cmp_internal (const npoint *np1, const npoint *np2)
 Returns -1, 0, or 1 depending on whether the first network point is less than, equal, or greater than the second one. More...
 
PGDLLEXPORT Datum npoint_cmp (PG_FUNCTION_ARGS)
 Returns -1, 0, or 1 depending on whether the first network point is less than, equal, or greater than the second one. More...
 
bool npoint_lt_internal (const npoint *np1, const npoint *np2)
 Returns true if the first network point is less than the second one. More...
 
PGDLLEXPORT Datum npoint_lt (PG_FUNCTION_ARGS)
 Returns true if the first network point is less than the second one. More...
 
PGDLLEXPORT Datum npoint_le (PG_FUNCTION_ARGS)
 Returns true if the first network point is less than or equal to the second one. More...
 
PGDLLEXPORT Datum npoint_ge (PG_FUNCTION_ARGS)
 Returns true if the first network point is greater than or equal to the second one. More...
 
PGDLLEXPORT Datum npoint_gt (PG_FUNCTION_ARGS)
 Returns true if the first network point is greater than the second one. More...
 
bool nsegment_eq_internal (const nsegment *ns1, const nsegment *ns2)
 Returns true if the first network segment is equal to the second one. More...
 
PGDLLEXPORT Datum nsegment_eq (PG_FUNCTION_ARGS)
 Returns true if the first network segment is equal to the second one. More...
 
bool nsegment_ne_internal (const nsegment *ns1, const nsegment *ns2)
 Returns true if the first network segment is not equal to the second one. More...
 
PGDLLEXPORT Datum nsegment_ne (PG_FUNCTION_ARGS)
 Returns true if the first network segment is not equal to the second one. More...
 
int nsegment_cmp_internal (const nsegment *ns1, const nsegment *ns2)
 Returns -1, 0, or 1 depending on whether the first network segment is less than, equal, or greater than the second one. More...
 
PGDLLEXPORT Datum nsegment_cmp (PG_FUNCTION_ARGS)
 Returns -1, 0, or 1 depending on whether the first network segment is less than, equal, or greater than the second one. More...
 
PGDLLEXPORT Datum nsegment_lt (PG_FUNCTION_ARGS)
 Returns true if the first network segment is less than the second one. More...
 
PGDLLEXPORT Datum nsegment_le (PG_FUNCTION_ARGS)
 Returns true if the first network segment is less than or equal to the second one. More...
 
PGDLLEXPORT Datum nsegment_ge (PG_FUNCTION_ARGS)
 Returns true if the first network segment is greater than or equal to the second one. More...
 
PGDLLEXPORT Datum nsegment_gt (PG_FUNCTION_ARGS)
 Returns true if the first network segment is greater than the second one. More...
 
bool route_exists (int64 rid)
 Returns true if the edge table contains a route with the route identifier. More...
 
double route_length (int64 rid)
 Access the edge table to return the route length from the corresponding route identifier. More...
 
Datum route_geom (int64 rid)
 Access the edge table to get the route geometry from corresponding route identifier. More...
 
int npoint_srid_internal (const npoint *np)
 Returns the SRID of the network point. More...
 
PGDLLEXPORT Datum npoint_srid (PG_FUNCTION_ARGS)
 Returns the SRID of the network point. More...
 
Datum npoint_as_geom_internal (const npoint *np)
 Transforms the network point into a geometry. More...
 
PGDLLEXPORT Datum npoint_as_geom (PG_FUNCTION_ARGS)
 Transforms the network point into a geometry. More...
 
npointgeom_as_npoint_internal (Datum geom)
 Transforms the geometry into a network point. More...
 
PGDLLEXPORT Datum geom_as_npoint (PG_FUNCTION_ARGS)
 Transforms the geometry into a network point. More...
 
int nsegment_srid_internal (const nsegment *ns)
 Returns the SRID of the network segment. More...
 
PGDLLEXPORT Datum nsegment_srid (PG_FUNCTION_ARGS)
 Returns the SRID of the network segment. More...
 
Datum nsegment_as_geom_internal (const nsegment *ns)
 Transforms the network segment into a geometry. More...
 
PGDLLEXPORT Datum nsegment_as_geom (PG_FUNCTION_ARGS)
 Transforms the network segment into a geometry. More...
 
nsegmentgeom_as_nsegment_internal (Datum geom)
 Transforms the geometry into a network segment. More...
 
PGDLLEXPORT Datum geom_as_nsegment (PG_FUNCTION_ARGS)
 Transforms the geometry into a network segment. More...
 

Detailed Description

Network-based static point and segment types.

Several functions are commented out since they are not currently used. They are kept if needed in the future.