MobilityDB 1.3
Loading...
Searching...
No Matches
postgis_funcs.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
36#ifndef __POSTGIS_FUNCS_H__
37#define __POSTGIS_FUNCS_H__
38
39/*****************************************************************************/
40
41/* GEOS */
42#include <geos_c.h>
43/* PostgreSQL */
44#include <postgres.h>
45/* PostGIS */
46#include <liblwgeom.h>
47/* MEOS */
48#include <meos.h>
49#include <meos_geo.h>
50
51/* Functions borrowed from lwgeom_pg.c */
52
53extern GSERIALIZED* geom_serialize(LWGEOM *lwgeom);
54extern GSERIALIZED* geog_serialize(LWGEOM *lwgeom);
55
56/* Functions adapted from gserialized_typmod.c */
57
58extern GSERIALIZED *postgis_valid_typmod(GSERIALIZED *gs, int32_t typmod);
59
60extern char *geo_as_wkt(const GSERIALIZED *gs, int precision, bool extended);
61
62/* Functions adapted from lwgeom_box.c */
63
64extern LWGEOM *box2d_to_lwgeom(GBOX *box, int32_t srid);
65
66/* Functions adapted from lwgeom_box3d.c */
67
68extern LWGEOM *box3d_to_lwgeom(BOX3D *box);
69
70/* Functions adapted from lwgeom_geos.c */
71
72extern GEOSGeometry *POSTGIS2GEOS(const GSERIALIZED *pglwgeom);
73extern GSERIALIZED *GEOS2POSTGIS(GEOSGeom geom, char want3d);
74
75extern bool geom_spatialrel(const GSERIALIZED *gs1, const GSERIALIZED *gs2,
76 spatialRel rel);
77
78/* Functions adapted from lwgeom_lrs.c */
79
80extern LWGEOM *lwgeom_line_interpolate_point(LWGEOM *geom, double fraction,
81 int32_t srid, char repeat);
82
83/*****************************************************************************/
84
85#endif /* __POSTGIS_FUNCS_H__ */
External API of the Mobility Engine Open Source (MEOS) library.
spatialRel
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos_geo.h:55
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)
Tranform a GEOS geometry to a PostGIS one.
Definition: postgis_funcs.c:1078
char * geo_as_wkt(const GSERIALIZED *gs, int precision, bool extended)
Return the (Extended) Well-Known Text (EWKT or WKT) representation of a geometry/geography.
Definition: postgis_funcs.c:2991
GSERIALIZED * geom_serialize(LWGEOM *lwgeom)
Utility method to call the serialization and then set the PgSQL varsize header appropriately with the...
Definition: postgis_funcs.c:1946
LWGEOM * box3d_to_lwgeom(BOX3D *box)
Create a geometry from a BOX3D.
Definition: postgis_funcs.c:282
bool geom_spatialrel(const GSERIALIZED *gs1, const GSERIALIZED *gs2, spatialRel rel)
Return true if two geometries satisfy a given spatial relationship, where the function called depend ...
Definition: postgis_funcs.c:1142
GEOSGeometry * POSTGIS2GEOS(const GSERIALIZED *pglwgeom)
Tranform a PostGIS geometry to a GEOS one.
Definition: postgis_funcs.c:1059
GSERIALIZED * geog_serialize(LWGEOM *lwgeom)
Utility method to call the serialization and then set the PgSQL varsize header appropriately with the...
Definition: postgis_funcs.c:1959
LWGEOM * lwgeom_line_interpolate_point(LWGEOM *geom, double fraction, int32_t srid, char repeat)
Interpolate a point from a line.
Definition: postgis_funcs.c:3509
GSERIALIZED * postgis_valid_typmod(GSERIALIZED *gs, int32_t typmod)
Check the consistency of the metadata to enforce in the typmod: SRID, type, and dimensionality.
Definition: postgis_funcs.c:2694
LWGEOM * box2d_to_lwgeom(GBOX *box, int32_t srid)
Create a geometry from a BOX2D.
Definition: postgis_funcs.c:206
Definition: postgis_ext_defs.in.h:65
Definition: postgis_ext_defs.in.h:79
Definition: postgis_ext_defs.in.h:170
Definition: postgis_ext_defs.in.h:184
int const GSERIALIZED * gs
Definition: trgeo_spatialrels.h:52