MobilityDB 1.1
postgis.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2023, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
27 *
28 *****************************************************************************/
29
35#ifndef __POSTGIS_H__
36#define __POSTGIS_H__
37
38/* PostgreSQL */
39#include <postgres.h>
40#include <fmgr.h>
41/* PostGIS */
42#include <liblwgeom.h>
43#include <lwgeodetic_tree.h>
44
45int32_t getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs);
46char *getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs);
47
48/* PostGIS functions called by MobilityDB */
49
50extern Datum transform(PG_FUNCTION_ARGS);
51extern Datum buffer(PG_FUNCTION_ARGS);
52extern Datum centroid(PG_FUNCTION_ARGS);
53
54extern Datum geography_from_geometry(PG_FUNCTION_ARGS);
55extern Datum geometry_from_geography(PG_FUNCTION_ARGS);
56
57extern Datum boundary(PG_FUNCTION_ARGS);
58extern Datum contains(PG_FUNCTION_ARGS);
59extern Datum containsproperly(PG_FUNCTION_ARGS);
60extern Datum covers(PG_FUNCTION_ARGS);
61extern Datum coveredby(PG_FUNCTION_ARGS);
62extern Datum crosses(PG_FUNCTION_ARGS);
63extern Datum disjoint(PG_FUNCTION_ARGS);
64extern Datum issimple(PG_FUNCTION_ARGS);
65extern Datum overlaps(PG_FUNCTION_ARGS);
66extern Datum pgis_union_geometry_array(PG_FUNCTION_ARGS);
67extern Datum relate_full(PG_FUNCTION_ARGS);
68extern Datum relate_pattern(PG_FUNCTION_ARGS);
69extern Datum touches(PG_FUNCTION_ARGS);
70extern Datum within(PG_FUNCTION_ARGS);
71
72extern Datum ST_Equals(PG_FUNCTION_ARGS);
73extern Datum ST_Distance(PG_FUNCTION_ARGS); /* For 2D */
74extern Datum ST_3DDistance(PG_FUNCTION_ARGS); /* For 3D */
75extern Datum ST_Intersection(PG_FUNCTION_ARGS);
76extern Datum ST_Intersects(PG_FUNCTION_ARGS); /* For 2D */
77extern Datum ST_3DIntersects(PG_FUNCTION_ARGS); /* For 2D */
78extern Datum geography_intersects(PG_FUNCTION_ARGS); /* For geography */
79
80extern Datum BOX2D_to_LWGEOM(PG_FUNCTION_ARGS);
81extern Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS);
82
83extern Datum LWGEOM_in(PG_FUNCTION_ARGS);
84extern Datum LWGEOM_out(PG_FUNCTION_ARGS);
85extern Datum LWGEOM_addpoint(PG_FUNCTION_ARGS);
86extern Datum LWGEOM_azimuth(PG_FUNCTION_ARGS);
87extern Datum LWGEOM_closestpoint(PG_FUNCTION_ARGS); /* For 2D */
88extern Datum LWGEOM_closestpoint3d(PG_FUNCTION_ARGS); /* For 3D */
89extern Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS);
90extern Datum LWGEOM_dwithin(PG_FUNCTION_ARGS); /* For 2D */
91extern Datum LWGEOM_dwithin3d(PG_FUNCTION_ARGS); /* For 3D */
92extern Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS);
93extern Datum LWGEOM_get_srid(PG_FUNCTION_ARGS); /* also for geography */
94extern Datum LWGEOM_set_srid(PG_FUNCTION_ARGS);
95extern Datum LWGEOM_isempty(PG_FUNCTION_ARGS);
96extern Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS);
97extern Datum LWGEOM_line_locate_point(PG_FUNCTION_ARGS);
98extern Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS);
99extern Datum LWGEOM_line_substring(PG_FUNCTION_ARGS);
100extern Datum LWGEOM_makepoint(PG_FUNCTION_ARGS);
101extern Datum LWGEOM_numgeometries_collection(PG_FUNCTION_ARGS);
102extern Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS);
103extern Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS);
104extern Datum LWGEOM_reverse(PG_FUNCTION_ARGS);
105extern Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS);
106extern Datum LWGEOM_shortestline2d(PG_FUNCTION_ARGS); /* For 2D */
107extern Datum LWGEOM_shortestline3d(PG_FUNCTION_ARGS); /* For 3D */
108
109extern Datum lwgeom_eq(PG_FUNCTION_ARGS);
110extern Datum lwgeom_lt(PG_FUNCTION_ARGS);
111extern Datum lwgeom_hash(PG_FUNCTION_ARGS);
112
113extern Datum geography_in(PG_FUNCTION_ARGS);
114extern Datum geography_out(PG_FUNCTION_ARGS);
115extern Datum geography_covers(PG_FUNCTION_ARGS);
116extern Datum geography_length(PG_FUNCTION_ARGS);
117extern Datum geography_dwithin(PG_FUNCTION_ARGS);
118extern Datum geography_distance(PG_FUNCTION_ARGS);
119extern Datum geography_azimuth(PG_FUNCTION_ARGS);
120extern Datum geography_bestsrid(PG_FUNCTION_ARGS);
121
122extern Datum geography_eq(PG_FUNCTION_ARGS);
123extern Datum geography_lt(PG_FUNCTION_ARGS);
124
125#define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
126#define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
127
128#include "general/temporal.h"
129#include <liblwgeom.h>
130
131/*****************************************************************************/
132
133#endif /* __POSTGIS_H__ */
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
Datum LWGEOM_isempty(PG_FUNCTION_ARGS)
Datum geography_from_geometry(PG_FUNCTION_ARGS)
Datum geography_length(PG_FUNCTION_ARGS)
Datum contains(PG_FUNCTION_ARGS)
int32_t getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs)
PostGIS definitions that are needed in MobilityDB but are not exported in PostGIS headers.
Datum coveredby(PG_FUNCTION_ARGS)
Datum ST_Intersection(PG_FUNCTION_ARGS)
Datum LWGEOM_makepoint(PG_FUNCTION_ARGS)
Datum ST_3DIntersects(PG_FUNCTION_ARGS)
Datum geography_lt(PG_FUNCTION_ARGS)
Datum lwgeom_lt(PG_FUNCTION_ARGS)
Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS)
Datum geography_azimuth(PG_FUNCTION_ARGS)
Datum covers(PG_FUNCTION_ARGS)
Datum LWGEOM_shortestline3d(PG_FUNCTION_ARGS)
Datum geometry_from_geography(PG_FUNCTION_ARGS)
Datum centroid(PG_FUNCTION_ARGS)
Datum LWGEOM_get_srid(PG_FUNCTION_ARGS)
Datum geography_in(PG_FUNCTION_ARGS)
Datum touches(PG_FUNCTION_ARGS)
Datum disjoint(PG_FUNCTION_ARGS)
Datum LWGEOM_in(PG_FUNCTION_ARGS)
Datum LWGEOM_out(PG_FUNCTION_ARGS)
Datum ST_Intersects(PG_FUNCTION_ARGS)
Datum buffer(PG_FUNCTION_ARGS)
Datum crosses(PG_FUNCTION_ARGS)
Datum relate_full(PG_FUNCTION_ARGS)
Datum relate_pattern(PG_FUNCTION_ARGS)
Datum ST_3DDistance(PG_FUNCTION_ARGS)
Datum transform(PG_FUNCTION_ARGS)
char * getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs)
Datum issimple(PG_FUNCTION_ARGS)
Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS)
Datum LWGEOM_dwithin3d(PG_FUNCTION_ARGS)
Datum LWGEOM_shortestline2d(PG_FUNCTION_ARGS)
Datum geography_distance(PG_FUNCTION_ARGS)
Datum geography_out(PG_FUNCTION_ARGS)
Datum geography_covers(PG_FUNCTION_ARGS)
Datum LWGEOM_azimuth(PG_FUNCTION_ARGS)
Datum geography_intersects(PG_FUNCTION_ARGS)
Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS)
Datum boundary(PG_FUNCTION_ARGS)
Datum geography_dwithin(PG_FUNCTION_ARGS)
Datum LWGEOM_line_locate_point(PG_FUNCTION_ARGS)
Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS)
Datum overlaps(PG_FUNCTION_ARGS)
Datum geography_eq(PG_FUNCTION_ARGS)
Datum LWGEOM_reverse(PG_FUNCTION_ARGS)
Datum ST_Equals(PG_FUNCTION_ARGS)
Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
Datum within(PG_FUNCTION_ARGS)
Datum LWGEOM_addpoint(PG_FUNCTION_ARGS)
Datum BOX2D_to_LWGEOM(PG_FUNCTION_ARGS)
Datum LWGEOM_line_substring(PG_FUNCTION_ARGS)
Datum LWGEOM_closestpoint(PG_FUNCTION_ARGS)
Datum geography_bestsrid(PG_FUNCTION_ARGS)
Datum lwgeom_eq(PG_FUNCTION_ARGS)
Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
Datum ST_Distance(PG_FUNCTION_ARGS)
Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS)
Datum LWGEOM_numgeometries_collection(PG_FUNCTION_ARGS)
Datum lwgeom_hash(PG_FUNCTION_ARGS)
Datum LWGEOM_set_srid(PG_FUNCTION_ARGS)
Datum LWGEOM_dwithin(PG_FUNCTION_ARGS)
Datum containsproperly(PG_FUNCTION_ARGS)
Datum LWGEOM_closestpoint3d(PG_FUNCTION_ARGS)