MobilityDB  1.0
Data Structures | Functions
tpoint_in.c File Reference

Input of temporal points in WKT, EWKT and MF-JSON format. More...

#include "point/tpoint_in.h"
#include <assert.h>
#include <float.h>
#include <json-c/json.h>
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/temporal_util.h"
#include "point/postgis.h"
#include "point/tpoint.h"
#include "point/tpoint_parser.h"
#include "point/tpoint_spatialfuncs.h"
Include dependency graph for tpoint_in.c:

Data Structures

struct  wkb_parse_state
 Structure used for passing the parse state between the parsing functions. More...
 

Functions

static json_object * findMemberByName (json_object *poObj, const char *pszName)
 Returns the JSON member corresponding to the name. More...
 
static Datum parse_mfjson_coord (json_object *poObj, int srid, bool geodetic)
 Returns a single point from its MF-JSON coordinates. More...
 
static Datum * parse_mfjson_points (json_object *mfjson, int srid, bool geodetic, int *count)
 Returns an array of points from its MF-JSON coordinates. More...
 
static TimestampTz * parse_mfjson_datetimes (json_object *mfjson, int *count)
 Returns an array of timestamps from its MF-JSON datetimes values. More...
 
static TInstanttpointinst_from_mfjson (json_object *mfjson, int srid, Oid basetypid)
 Returns a temporal instant point from its MF-JSON representation. More...
 
static TInstant ** tpointinstarr_from_mfjson (json_object *mfjson, int srid, Oid basetypid, int *count)
 Returns array of temporal instant points from its MF-JSON representation. More...
 
static TInstantSettpointinstset_from_mfjson (json_object *mfjson, int srid, Oid basetypid)
 Returns a temporal instant set point from its MF-JSON representation. More...
 
static TSequencetpointseq_from_mfjson (json_object *mfjson, int srid, Oid basetypid, bool linear)
 Returns a temporal sequence point from its MF-JSON representation. More...
 
static TSequenceSettpointseqset_from_mfjson (json_object *mfjson, int srid, Oid basetypid, bool linear)
 Returns a temporal sequence set point from its MF-JSON representation. More...
 
Temporaltpoint_from_mfjson_internal (FunctionCallInfo fcinfo, text *mfjson_input, Oid basetypid)
 Returns a temporal point from its MF-JSON representation. More...
 
PGDLLEXPORT Datum tpoint_from_mfjson (PG_FUNCTION_ARGS)
 Returns a temporal point from its MF-JSON representation. More...
 
static void wkb_parse_state_check (wkb_parse_state *s, size_t next)
 Check that we are not about to read off the end of the WKB array. More...
 
static char byte_from_wkb_state (wkb_parse_state *s)
 Read a byte and advance the parse state forward. More...
 
static uint32_t integer_from_wkb_state (wkb_parse_state *s)
 Read 4-byte integer and advance the parse state forward. More...
 
static double double_from_wkb_state (wkb_parse_state *s)
 Read an 8-byte double and advance the parse state forward. More...
 
static TimestampTz timestamp_from_wkb_state (wkb_parse_state *s)
 Read an 8-byte timestamp and advance the parse state forward. More...
 
static void tpoint_type_from_wkb_state (wkb_parse_state *s, uint8_t wkb_type)
 Take in an unknown kind of WKB type number and ensure it comes out as an extended WKB type number (with Z/GEOD/SRID/LINEAR_INTERP flags masked onto the high bits). More...
 
Datum point_from_wkb_state (wkb_parse_state *s)
 Returns a point from its WKB representation. More...
 
static TInstanttpointinst_from_wkb_state (wkb_parse_state *s)
 Returns a temporal instant point from its WKB representation. More...
 
static TInstant ** tpointinstarr_from_wkb_state (wkb_parse_state *s, int count)
 Returns a temporal instant array from its WKB representation. More...
 
static TInstantSettpointinstset_from_wkb_state (wkb_parse_state *s)
 Returns a temporal instant set point from its WKB representation. More...
 
static void tpoint_bounds_from_wkb_state (uint8_t wkb_bounds, bool *lower_inc, bool *upper_inc)
 Set the bound flags from their WKB representation. More...
 
static TSequencetpointseq_from_wkb_state (wkb_parse_state *s)
 Returns a temporal sequence point from its WKB representation. More...
 
static TSequenceSettpointseqset_from_wkb_state (wkb_parse_state *s)
 Returns a temporal sequence set point from its WKB representation. More...
 
Temporaltpoint_from_wkb_state (wkb_parse_state *s)
 Returns a temporal point from its WKB representation. More...
 
static Temporaltpoint_from_ewkb_internal (uint8_t *wkb, int size)
 
PGDLLEXPORT Datum tpoint_from_ewkb (PG_FUNCTION_ARGS)
 Returns a temporal point from its EWKB representation. More...
 
PGDLLEXPORT Datum tpoint_from_hexewkb (PG_FUNCTION_ARGS)
 Returns a temporal point from its HEXEWKB representation. More...
 
Datum tpoint_from_ewkt (PG_FUNCTION_ARGS)
 This just does the same thing as the _in function, except it has to handle a 'text' input. More...
 

Detailed Description

Input of temporal points in WKT, EWKT and MF-JSON format.