PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches
postgis/lwgeom_geos.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * PostGIS - Spatial Types for PostgreSQL
4 * http://postgis.net
5 *
6 * PostGIS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PostGIS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PostGIS. If not, see <http://www.gnu.org/licenses/>.
18 *
19 **********************************************************************
20 *
21 * Copyright 2008 Paul Ramsey <pramsey@cleverelephant.ca>
22 *
23 **********************************************************************/
24
25
26#ifndef LWGEOM_GEOS_H_
27#define LWGEOM_GEOS_H_ 1
28
29#include "../liblwgeom/lwgeom_geos.h" /* for GEOSGeom */
30#include "liblwgeom.h" /* for GSERIALIZED */
31#include "utils/array.h" /* for ArrayType */
32
33/*
34** Public prototypes for GEOS utility functions.
35*/
36
37GSERIALIZED *GEOS2POSTGIS(GEOSGeom geom, char want3d);
38GEOSGeometry *POSTGIS2GEOS(const GSERIALIZED *g);
39GEOSGeometry** ARRAY2GEOS(ArrayType* array, uint32_t nelems, int* is3d, int* srid);
40LWGEOM** ARRAY2LWGEOM(ArrayType* array, uint32_t nelems, int* is3d, int* srid);
41
42Datum geos_intersects(PG_FUNCTION_ARGS);
43Datum geos_intersection(PG_FUNCTION_ARGS);
44Datum geos_difference(PG_FUNCTION_ARGS);
45Datum geos_geomunion(PG_FUNCTION_ARGS);
46Datum LWGEOM_area_polygon(PG_FUNCTION_ARGS);
47Datum LWGEOM_mindistance2d(PG_FUNCTION_ARGS);
48Datum ST_3DDistance(PG_FUNCTION_ARGS);
49
50
51/* Return NULL on GEOS error
52 *
53 * Prints error message only if it was not for interruption, in which
54 * case we let PostgreSQL deal with the error.
55 */
56#define HANDLE_GEOS_ERROR(label) \
57 { \
58 if (!strstr(lwgeom_geos_errmsg, "InterruptedException")) \
59 lwpgerror("%s: %s", (label), lwgeom_geos_errmsg); \
60 PG_RETURN_NULL(); \
61 }
62
63#endif /* LWGEOM_GEOS_H_ */
This library is the generic geometry handling section of PostGIS.
GSERIALIZED * GEOS2POSTGIS(GEOSGeom geom, char want3d)
Datum geos_geomunion(PG_FUNCTION_ARGS)
Datum geos_intersects(PG_FUNCTION_ARGS)
LWGEOM ** ARRAY2LWGEOM(ArrayType *array, uint32_t nelems, int *is3d, int *srid)
GEOSGeometry * POSTGIS2GEOS(const GSERIALIZED *g)
Datum ST_3DDistance(PG_FUNCTION_ARGS)
Datum geos_difference(PG_FUNCTION_ARGS)
Datum geos_intersection(PG_FUNCTION_ARGS)
Datum LWGEOM_mindistance2d(PG_FUNCTION_ARGS)
GEOSGeometry ** ARRAY2GEOS(ArrayType *array, uint32_t nelems, int *is3d, int *srid)
Datum LWGEOM_area_polygon(PG_FUNCTION_ARGS)