MobilityDB  1.0
Data Structures | Macros | Typedefs | Functions
postgis.h File Reference

PostGIS definitions that are needed in MobilityDB but are not exported in PostGIS headers. More...

#include <postgres.h>
#include <fmgr.h>
#include <liblwgeom.h>
#include "general/temporal.h"
Include dependency graph for postgis.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GEOGRAPHIC_POINT
 Point in spherical coordinates on the world. More...
 
struct  GEOGRAPHIC_EDGE
 Two-point great circle segment from a to b. More...
 
struct  DISTPTS
 
struct  DISTPTS3D
 
struct  VECTOR3D
 
struct  circ_node
 
struct  gridspec_t
 Snap-to-grid Support. More...
 

Macros

#define deg2rad(d)   (M_PI * (d) / 180.0)
 Conversion functions. More...
 
#define rad2deg(r)   (180.0 * (r) / M_PI)
 
#define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori)
 
#define DIST_MAX   -1
 
#define DIST_MIN   1
 
#define DOT(u, v)   ((u).x * (v).x + (u).y * (v).y + (u).z * (v).z)
 
#define VECTORLENGTH(v)   sqrt(((v).x * (v).x) + ((v).y * (v).y) + ((v).z * (v).z))
 
#define PIR_NO_INTERACT   0x00
 Bitmask elements for edge_intersects() return value. More...
 
#define PIR_INTERSECTS   0x01
 
#define PIR_COLINEAR   0x02
 
#define PIR_A_TOUCH_RIGHT   0x04
 
#define PIR_A_TOUCH_LEFT   0x08
 
#define PIR_B_TOUCH_RIGHT   0x10
 
#define PIR_B_TOUCH_LEFT   0x20
 
#define FP_TOLERANCE   1e-12
 Floating point comparators. More...
 
#define FP_IS_ZERO(A)   (fabs(A) <= FP_TOLERANCE)
 
#define FP_MAX(A, B)   (((A) > (B)) ? (A) : (B))
 
#define FP_MIN(A, B)   (((A) < (B)) ? (A) : (B))
 
#define FP_ABS(a)   ((a) < (0) ? -(a) : (a))
 
#define FP_EQUALS(A, B)   (fabs((A)-(B)) <= FP_TOLERANCE)
 
#define FP_NEQUALS(A, B)   (fabs((A)-(B)) > FP_TOLERANCE)
 
#define FP_LT(A, B)   (((A) + FP_TOLERANCE) < (B))
 
#define FP_LTEQ(A, B)   (((A) - FP_TOLERANCE) <= (B))
 
#define FP_GT(A, B)   (((A) - FP_TOLERANCE) > (B))
 
#define FP_GTEQ(A, B)   (((A) + FP_TOLERANCE) >= (B))
 
#define FP_CONTAINS_TOP(A, X, B)   (FP_LT(A, X) && FP_LTEQ(X, B))
 
#define FP_CONTAINS_BOTTOM(A, X, B)   (FP_LTEQ(A, X) && FP_LT(X, B))
 
#define FP_CONTAINS_INCL(A, X, B)   (FP_LTEQ(A, X) && FP_LTEQ(X, B))
 
#define FP_CONTAINS_EXCL(A, X, B)   (FP_LT(A, X) && FP_LT(X, B))
 
#define FP_CONTAINS(A, X, B)   FP_CONTAINS_EXCL(A, X, B)
 
#define PG_GETARG_GSERIALIZED_P(varno)   ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
 
#define PG_GETARG_GSERIALIZED_P_COPY(varno)   ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
 

Typedefs

typedef struct circ_node CIRC_NODE
 
typedef struct gridspec_t gridspec
 Snap-to-grid Support. More...
 

Functions

int spheroid_init_from_srid (FunctionCallInfo fcinfo, int srid, SPHEROID *s)
 
double ptarray_length_spheroid (const POINTARRAY *pa, const SPHEROID *s)
 
int lwline_is_empty (const LWLINE *line)
 
void geographic_point_init (double lon, double lat, GEOGRAPHIC_POINT *g)
 
double sphere_distance (const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
 
void geog2cart (const GEOGRAPHIC_POINT *g, POINT3D *p)
 
void cart2geog (const POINT3D *p, GEOGRAPHIC_POINT *g)
 
void normalize (POINT3D *p)
 
int edge_contains_coplanar_point (const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p)
 
double edge_distance_to_point (const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
 
uint32_t edge_intersects (const POINT3D *A1, const POINT3D *A2, const POINT3D *B1, const POINT3D *B2)
 
int edge_intersection (const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *g)
 
double edge_distance_to_edge (const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2)
 
int lw_dist2d_recursive (const LWGEOM *lw1, const LWGEOM *lw2, DISTPTS *dl)
 
int lw_dist2d_seg_seg (const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl)
 
int lw_dist3d_pt_pt (POINT3DZ *p1, POINT3DZ *p2, DISTPTS3D *dl)
 
int lw_dist3d_pt_seg (POINT3DZ *p, POINT3DZ *A, POINT3DZ *B, DISTPTS3D *dl)
 
int lw_dist3d_recursive (const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl)
 
int lw_dist3d_seg_seg (POINT3DZ *s1p1, POINT3DZ *s1p2, POINT3DZ *s2p1, POINT3DZ *s2p2, DISTPTS3D *dl)
 
double spheroid_distance (const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid)
 
int geographic_point_equals (const GEOGRAPHIC_POINT *g1, const GEOGRAPHIC_POINT *g2)
 
CIRC_NODElwgeom_calculate_circ_tree (const LWGEOM *lwgeom)
 
void circ_tree_free (CIRC_NODE *node)
 
int p4d_same (const POINT4D *p1, const POINT4D *p2)
 
int p3d_same (const POINT3D *p1, const POINT3D *p2)
 
int p2d_same (const POINT2D *p1, const POINT2D *p2)
 
void srid_is_latlong (FunctionCallInfo fcinfo, int srid)
 
int clamp_srid (int srid)
 
int getSRIDbySRS (FunctionCallInfo fcinfo, const char *srs)
 
char * getSRSbySRID (FunctionCallInfo fcinfo, int32_t srid, bool short_crs)
 
int lwprint_double (double d, int maxdd, char *buf, size_t bufsize)
 
char getMachineEndian (void)
 
char lwpoint_same (const LWPOINT *p1, const LWPOINT *p2)
 
LWPOINT * lwpoint_clone (const LWPOINT *lwgeom)
 
Datum transform (PG_FUNCTION_ARGS)
 
Datum buffer (PG_FUNCTION_ARGS)
 
Datum centroid (PG_FUNCTION_ARGS)
 
Datum geography_from_geometry (PG_FUNCTION_ARGS)
 
Datum geometry_from_geography (PG_FUNCTION_ARGS)
 
Datum boundary (PG_FUNCTION_ARGS)
 
Datum contains (PG_FUNCTION_ARGS)
 
Datum containsproperly (PG_FUNCTION_ARGS)
 
Datum covers (PG_FUNCTION_ARGS)
 
Datum coveredby (PG_FUNCTION_ARGS)
 
Datum crosses (PG_FUNCTION_ARGS)
 
Datum disjoint (PG_FUNCTION_ARGS)
 
Datum issimple (PG_FUNCTION_ARGS)
 
Datum overlaps (PG_FUNCTION_ARGS)
 
Datum pgis_union_geometry_array (PG_FUNCTION_ARGS)
 
Datum relate_full (PG_FUNCTION_ARGS)
 
Datum relate_pattern (PG_FUNCTION_ARGS)
 
Datum touches (PG_FUNCTION_ARGS)
 
Datum within (PG_FUNCTION_ARGS)
 
Datum ST_Equals (PG_FUNCTION_ARGS)
 
Datum distance (PG_FUNCTION_ARGS)
 
Datum distance3d (PG_FUNCTION_ARGS)
 
Datum intersection (PG_FUNCTION_ARGS)
 
Datum intersects (PG_FUNCTION_ARGS)
 
Datum intersects3d (PG_FUNCTION_ARGS)
 
Datum BOX2D_to_LWGEOM (PG_FUNCTION_ARGS)
 
Datum BOX3D_to_LWGEOM (PG_FUNCTION_ARGS)
 
Datum LWGEOM_addpoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_azimuth (PG_FUNCTION_ARGS)
 
Datum LWGEOM_closestpoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_closestpoint3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_collect_garray (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dwithin (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dwithin3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_geometryn_collection (PG_FUNCTION_ARGS)
 
Datum LWGEOM_get_srid (PG_FUNCTION_ARGS)
 
Datum LWGEOM_set_srid (PG_FUNCTION_ARGS)
 
Datum LWGEOM_isempty (PG_FUNCTION_ARGS)
 
Datum LWGEOM_length_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_line_locate_point (PG_FUNCTION_ARGS)
 
Datum LWGEOM_line_interpolate_point (PG_FUNCTION_ARGS)
 
Datum LWGEOM_line_substring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makepoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_numgeometries_collection (PG_FUNCTION_ARGS)
 
Datum LWGEOM_numpoints_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_pointn_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_reverse (PG_FUNCTION_ARGS)
 
Datum LWGEOM_setpoint_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_shortestline2d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_shortestline3d (PG_FUNCTION_ARGS)
 
Datum lwgeom_eq (PG_FUNCTION_ARGS)
 
Datum lwgeom_lt (PG_FUNCTION_ARGS)
 
Datum lwgeom_hash (PG_FUNCTION_ARGS)
 
Datum geography_covers (PG_FUNCTION_ARGS)
 
Datum geography_length (PG_FUNCTION_ARGS)
 
Datum geography_dwithin (PG_FUNCTION_ARGS)
 
Datum geography_distance (PG_FUNCTION_ARGS)
 
Datum geography_azimuth (PG_FUNCTION_ARGS)
 
Datum geography_bestsrid (PG_FUNCTION_ARGS)
 
Datum geography_eq (PG_FUNCTION_ARGS)
 
Datum geography_lt (PG_FUNCTION_ARGS)
 

Detailed Description

PostGIS definitions that are needed in MobilityDB but are not exported in PostGIS headers.