LWGEOM *lwgeom_segmentize(LWGEOM *geom, uint32 perQuad);
LWGEOM *lwgeom_desegmentize(LWGEOM *geom);
+/*******************************************************************************
+ * GEOS proxy functions on LWGEOM
+ ******************************************************************************/
+
+/** Return GEOS version string (not to be freed) */
+const char* lwgeom_geos_version();
+
+/** Convert an LWGEOM to a GEOS Geometry and convert back -- for debug only */
+LWGEOM* lwgeom_geos_noop(const LWGEOM *geom) ;
+
+LWGEOM *lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2);
+LWGEOM *lwgeom_difference(const LWGEOM *geom1, const LWGEOM *geom2);
+LWGEOM *lwgeom_symdifference(const LWGEOM* geom1, const LWGEOM* geom2);
+LWGEOM *lwgeom_union(const LWGEOM *geom1, const LWGEOM *geom2);
+
+/*******************************************************************************
+ * GEOS-dependent extra functions on LWGEOM
+ ******************************************************************************/
+
+/**
+ * Take a geometry and return an areal geometry
+ * (Polygon or MultiPolygon).
+ * Actually a wrapper around GEOSpolygonize,
+ * transforming the resulting collection into
+ * a valid polygon Geometry.
+ */
+LWGEOM* lwgeom_buildarea(const LWGEOM *geom) ;
+
+
+
#endif /* !defined _LIBLWGEOM_H */
#include <stdlib.h>
-
+#define LWGEOM_GEOS_ERRMSG_MAXSIZE 256
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE];
extern void
return g;
}
+const char*
+lwgeom_geos_version()
+{
+ const char *ver = GEOSversion();
+ return ver;
+}
#include "liblwgeom.h"
-LWGEOM *lwgeom_intersection(const LWGEOM *geom1, const LWGEOM *geom2) ;
-LWGEOM *lwgeom_difference(const LWGEOM *geom1, const LWGEOM *geom2) ;
-LWGEOM *lwgeom_symdifference(const LWGEOM* geom1, const LWGEOM* geom2) ;
-LWGEOM* lwgeom_union(const LWGEOM *geom1, const LWGEOM *geom2) ;
-
-/**
- * Take a geometry and return an areal geometry
- * (Polygon or MultiPolygon).
- * Actually a wrapper around GEOSpolygonize,
- * transforming the resulting collection into
- * a valid polygon Geometry.
- */
-LWGEOM* lwgeom_buildarea(const LWGEOM *geom) ;
-
-/** Convert an LWGEOM to a GEOS Geometry and convert back -- for debug only */
-LWGEOM* lwgeom_geos_noop(const LWGEOM *geom) ;
-
-
-
/*
** Public prototypes for GEOS utility functions.
*/
POINTARRAY *ptarray_from_GEOSCoordSeq(const GEOSCoordSequence *cs, char want3d);
-#define LWGEOM_GEOS_ERRMSG_MAXSIZE 256
extern char lwgeom_geos_errmsg[];
extern void lwgeom_geos_error(const char *fmt, ...);
**********************************************************************/
#include "lwgeom_geos.h"
+#include "liblwgeom_internal.h"
#include "lwgeom_rtree.h"
-#include "lwgeom_geos_prepared.h"
+#include "lwgeom_functions_analytic.h" /* for point_in_polygon */
#include "funcapi.h"
-#include "lwgeom_functions_analytic.h"
-#include "liblwgeom_internal.h"
#include <string.h>
#include <assert.h>
PG_FUNCTION_INFO_V1(postgis_geos_version);
Datum postgis_geos_version(PG_FUNCTION_ARGS)
{
- const char *ver = GEOSversion();
+ const char *ver = lwgeom_geos_version();
text *result = cstring2text(ver);
PG_RETURN_POINTER(result);
}
#include "lwgeom_pg.h"
#include "liblwgeom.h"
#include "profile.h"
+#include "../liblwgeom/liblwgeom.h"
#include "../liblwgeom/lwgeom_geos.h"
#include <string.h>