MobilityDB 1.3
Loading...
Searching...
No Matches
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-2025, 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-2025, 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/* MEOS */
45#include "temporal/temporal.h"
46
47/*****************************************************************************
48 * fmgr macros
49 *****************************************************************************/
50
51#define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
52#define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
53#define PG_RETURN_GSERIALIZED_P(x) return PointerGetDatum(x)
54
55/*****************************************************************************/
56
57/*****************************************************************************
58 * fmgr macros
59 *****************************************************************************/
60
61#define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
62#define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
63#define PG_RETURN_GSERIALIZED_P(x) return PointerGetDatum(x)
64
65/*****************************************************************************/
66
67int32_t getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs);
68char *getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs);
69
70/* PostGIS functions called by MobilityDB */
71
72extern Datum transform(PG_FUNCTION_ARGS);
73extern Datum buffer(PG_FUNCTION_ARGS);
74extern Datum centroid(PG_FUNCTION_ARGS);
75
76extern Datum geography_from_geometry(PG_FUNCTION_ARGS);
77extern Datum geometry_from_geography(PG_FUNCTION_ARGS);
78
79extern Datum boundary(PG_FUNCTION_ARGS);
80extern Datum contains(PG_FUNCTION_ARGS);
81extern Datum containsproperly(PG_FUNCTION_ARGS);
82extern Datum covers(PG_FUNCTION_ARGS);
83extern Datum coveredby(PG_FUNCTION_ARGS);
84extern Datum crosses(PG_FUNCTION_ARGS);
85extern Datum disjoint(PG_FUNCTION_ARGS);
86extern Datum issimple(PG_FUNCTION_ARGS);
87extern Datum overlaps(PG_FUNCTION_ARGS);
88extern Datum pgis_union_geometry_array(PG_FUNCTION_ARGS);
89extern Datum relate_full(PG_FUNCTION_ARGS);
90extern Datum relate_pattern(PG_FUNCTION_ARGS);
91extern Datum touches(PG_FUNCTION_ARGS);
92extern Datum within(PG_FUNCTION_ARGS);
93
94extern Datum ST_Equals(PG_FUNCTION_ARGS);
95extern Datum ST_Distance(PG_FUNCTION_ARGS); /* For 2D */
96extern Datum ST_3DDistance(PG_FUNCTION_ARGS); /* For 3D */
97extern Datum ST_Intersects(PG_FUNCTION_ARGS);
98extern Datum ST_Intersection(PG_FUNCTION_ARGS);
99extern Datum ST_Intersects(PG_FUNCTION_ARGS); /* For 2D */
100extern Datum ST_3DIntersects(PG_FUNCTION_ARGS); /* For 2D */
101extern Datum geography_intersects(PG_FUNCTION_ARGS); /* For geography */
102
103extern Datum BOX2D_to_LWGEOM(PG_FUNCTION_ARGS);
104extern Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS);
105
106extern Datum LWGEOM_in(PG_FUNCTION_ARGS);
107extern Datum LWGEOM_out(PG_FUNCTION_ARGS);
108extern Datum LWGEOM_addpoint(PG_FUNCTION_ARGS);
109extern Datum LWGEOM_azimuth(PG_FUNCTION_ARGS);
110extern Datum LWGEOM_closestpoint(PG_FUNCTION_ARGS); /* For 2D */
111extern Datum LWGEOM_closestpoint3d(PG_FUNCTION_ARGS); /* For 3D */
112extern Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS);
113extern Datum LWGEOM_dwithin(PG_FUNCTION_ARGS); /* For 2D */
114extern Datum LWGEOM_dwithin3d(PG_FUNCTION_ARGS); /* For 3D */
115extern Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS);
116extern Datum LWGEOM_get_srid(PG_FUNCTION_ARGS); /* also for geography */
117extern Datum LWGEOM_set_srid(PG_FUNCTION_ARGS);
118extern Datum LWGEOM_isempty(PG_FUNCTION_ARGS);
119extern Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS);
120extern Datum LWGEOM_line_locate_point(PG_FUNCTION_ARGS);
121extern Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS);
122extern Datum LWGEOM_line_substring(PG_FUNCTION_ARGS);
123extern Datum LWGEOM_makepoint(PG_FUNCTION_ARGS);
124extern Datum LWGEOM_numgeometries_collection(PG_FUNCTION_ARGS);
125extern Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS);
126extern Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS);
127extern Datum LWGEOM_reverse(PG_FUNCTION_ARGS);
128extern Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS);
129extern Datum LWGEOM_shortestline2d(PG_FUNCTION_ARGS); /* For 2D */
130extern Datum LWGEOM_shortestline3d(PG_FUNCTION_ARGS); /* For 3D */
131
132extern Datum lwgeom_eq(PG_FUNCTION_ARGS);
133extern Datum lwgeom_lt(PG_FUNCTION_ARGS);
134extern Datum lwgeom_hash(PG_FUNCTION_ARGS);
135
136extern Datum geography_in(PG_FUNCTION_ARGS);
137extern Datum geography_out(PG_FUNCTION_ARGS);
138extern Datum geography_covers(PG_FUNCTION_ARGS);
139extern Datum geography_length(PG_FUNCTION_ARGS);
140extern Datum geography_dwithin(PG_FUNCTION_ARGS);
141extern Datum geography_distance(PG_FUNCTION_ARGS);
142extern Datum geography_azimuth(PG_FUNCTION_ARGS);
143extern Datum geography_bestsrid(PG_FUNCTION_ARGS);
144
145extern Datum geography_eq(PG_FUNCTION_ARGS);
146extern Datum geography_lt(PG_FUNCTION_ARGS);
147
148/*****************************************************************************/
149
150#endif /* __POSTGIS_H__ */
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)
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)
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7