MobilityDB 1.1
Macros | Functions
pgis_call.c File Reference
#include "point/pgis_call.h"
#include <assert.h>
#include <float.h>
#include <geos_c.h>
#include <liblwgeom.h>
#include <lwgeom_log.h>
#include <lwgeom_geos.h>
#include "general/temporal.h"
#include "point/tpoint_spatialfuncs.h"
Include dependency graph for pgis_call.c:

Macros

#define PG_PARSER_ERROR(lwg_parser_result)
 
#define PGIS_FP_TOLERANCE   1e-12
 

Functions

LWGEOMbox2d_to_lwgeom (GBOX *box, int srid)
 Create a geometry from a BOX2D. More...
 
LWGEOMbox3d_to_lwgeom (BOX3D *box)
 Create a geometry from a BOX3D. More...
 
void geography_valid_type (uint8_t type)
 The geography type only support POINT, LINESTRING, POLYGON, MULTI* variants of same, and GEOMETRYCOLLECTION. More...
 
GSERIALIZEDGEOS2POSTGIS (GEOSGeom geom, char want3d)
 
double gserialized_3Ddistance (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return the distance between two geometries. More...
 
bool gserialized_3Dintersects (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return true if the 3D geometries intersect. More...
 
GSERIALIZEDgserialized_array_union (GSERIALIZED **gsarr, int nelems)
 This is the final function for GeomUnion aggregate. More...
 
byteagserialized_as_ewkb (const GSERIALIZED *geom, char *type)
 Return the EWKB representation of a geometry. More...
 
char * gserialized_as_ewkt (const GSERIALIZED *geom, int precision)
 Return the EWKT representation (and optionally a SRID) of a geometry. More...
 
char * gserialized_as_geojson (const GSERIALIZED *geom, int option, int precision, char *srs)
 Output a geometry in GeoJSON format. More...
 
char * gserialized_as_hexewkb (const GSERIALIZED *geom, const char *type)
 Return the WKB representation of a geometry in hex-encoded ASCII. More...
 
char * gserialized_as_text (const GSERIALIZED *geom, int precision)
 Return the WKT representation (and optionally a SRID) of a geometry. More...
 
bool gserialized_azimuth (GSERIALIZED *geom1, GSERIALIZED *geom2, double *result)
 Compute the azimuth of segment defined by the two given Point geometries. More...
 
GSERIALIZEDgserialized_boundary (const GSERIALIZED *geom1)
 Return the boundary of a geometry. More...
 
double gserialized_distance (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return the distance between two geometries. More...
 
bool gserialized_dwithin (const GSERIALIZED *geom1, const GSERIALIZED *geom2, double tolerance)
 Return true if the geometries are within the given distance. More...
 
bool gserialized_dwithin3d (const GSERIALIZED *geom1, const GSERIALIZED *geom2, double tolerance)
 Return true if the geometries are within the given distance. More...
 
GSERIALIZEDgserialized_from_ewkb (const bytea *bytea_wkb, int32 srid)
 Return a geometry from its EWKB representation. More...
 
GSERIALIZEDgserialized_from_geojson (const char *geojson)
 Input a geometry from GeoJSON format. More...
 
GSERIALIZEDgserialized_from_hexewkb (const char *wkt)
 Return a geometry from its WKT representation. More...
 
GSERIALIZEDgserialized_from_text (char *wkt, int srid)
 Return a geometry from its WKT representation (and optionally a SRID) More...
 
double gserialized_geog_distance (const GSERIALIZED *g1, const GSERIALIZED *g2)
 Return the distance between two geographies. More...
 
bool gserialized_geog_dwithin (GSERIALIZED *g1, GSERIALIZED *g2, double tolerance, bool use_spheroid)
 Return true if the geographies are within the given distance. More...
 
GSERIALIZEDgserialized_geog_from_geom (GSERIALIZED *geom)
 Get a geography from a geometry. More...
 
GSERIALIZEDgserialized_geog_in (char *str, int32 geog_typmod)
 Get a geography from in string. More...
 
double gserialized_geog_length (GSERIALIZED *g, bool use_spheroid)
 Return double length in meters. More...
 
char * gserialized_geog_out (GSERIALIZED *g)
 Output a geography in string format. More...
 
GSERIALIZEDgserialized_geography_from_lwgeom (LWGEOM *lwgeom, int32 geog_typmod)
 
GSERIALIZEDgserialized_geom_from_geog (GSERIALIZED *geom)
 Get a geometry from a geography. More...
 
GSERIALIZEDgserialized_in (char *input, int32 geom_typmod)
 Input function for geometries. More...
 
bool gserialized_inter_contains (const GSERIALIZED *geom1, const GSERIALIZED *geom2, bool inter)
 Return true if the geometries intersect or the first contains the other. More...
 
GSERIALIZEDgserialized_intersection (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return true if the 3D geometries intersect. More...
 
static char gserialized_is_point (const GSERIALIZED *g)
 
static char gserialized_is_poly (const GSERIALIZED *g)
 
GSERIALIZEDgserialized_line_interpolate_point (GSERIALIZED *gser, double distance_fraction, int repeat)
 Interpolate a point from a line. More...
 
double gserialized_line_locate_point (GSERIALIZED *geom1, GSERIALIZED *geom2)
 
GSERIALIZEDgserialized_line_substring (GSERIALIZED *geom, double from, double to)
 Get a subline from a line. More...
 
int gserialized_numpoints_linestring (const GSERIALIZED *geom)
 numpoints(LINESTRING) – return the number of points in the linestring, or NULL if it is not a linestring More...
 
char * gserialized_out (const GSERIALIZED *geom)
 Output function for geometries. More...
 
GSERIALIZEDgserialized_pointn_linestring (const GSERIALIZED *geom, int where)
 PointN(GEOMETRY,INTEGER) – find the first linestring in GEOMETRY,. More...
 
bool gserialized_relate_pattern (const GSERIALIZED *geom1, const GSERIALIZED *geom2, char *patt)
 Return true if the 3D geometries intersect. More...
 
GSERIALIZEDgserialized_reverse (const GSERIALIZED *geom)
 Reverse vertex order of geometry. More...
 
GSERIALIZEDgserialized_shortestline2d (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return the shortest 2d line between two geometries. More...
 
GSERIALIZEDgserialized_shortestline3d (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return the shortest line between two geometries in 3D. More...
 
bool gserialized_touches (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return true if the geometries touch. More...
 
LWGEOMlwgeom_line_interpolate_point (LWGEOM *lwgeom, double fraction, int32_t srid, int repeat)
 Get a geometry from a geography. More...
 
static char MOBDB_call_geos (const GSERIALIZED *geom1, const GSERIALIZED *geom2, char(*func)(const GEOSGeometry *g1, const GEOSGeometry *g2))
 Transform the GSERIALIZED geometries into GEOSGeometry and call the GEOS function passed as argument. More...
 
static int MOBDB_point_in_polygon (const GSERIALIZED *geom1, const GSERIALIZED *geom2, bool inter)
 Return -1, 0, or 1 depending on whether a (multi)point is completely outside, on the boundary, or completely inside a (multi)polygon. More...
 
GSERIALIZEDpgis_geography_from_binary (const char *wkb_bytea)
 
bool pgis_gserialized_same (const GSERIALIZED *geom1, const GSERIALIZED *geom2)
 Return true if the geometries are the same. More...
 
LWGEOMpgis_lwgeom_boundary (LWGEOM *lwgeom)
 
int point_in_multipolygon (LWMPOLY *mpolygon, LWPOINT *point)
 
int point_in_polygon (LWPOLY *polygon, LWPOINT *point)
 MobilityDB functions gserialized_func(...) corresponding to external PostGIS functions xxx_func(PG_FUNCTION_ARGS). More...
 
GEOSGeometry * POSTGIS2GEOS (const GSERIALIZED *pglwgeom)
 
GSERIALIZEDpostgis_valid_typmod (GSERIALIZED *gser, int32_t typmod)
 Check the consistency of the metadata we want to enforce in the typmod: srid, type and dimensionality. More...
 
void srid_check_latlong (int32_t srid)