]> granicus.if.org Git - postgis/commitdiff
Add GEOS entry points in liblwgeom.h (public API) [RT-SIGTA]
authorSandro Santilli <strk@keybit.net>
Tue, 9 Aug 2011 16:05:30 +0000 (16:05 +0000)
committerSandro Santilli <strk@keybit.net>
Tue, 9 Aug 2011 16:05:30 +0000 (16:05 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7719 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/liblwgeom.h
liblwgeom/lwgeom_geos.c
liblwgeom/lwgeom_geos.h
postgis/lwgeom_geos.c
postgis/lwgeom_geos.h

index 8e1d950538d303f806e39f8cf193134623df7d40..6db31a5bfa651bd6d75627d5e78ed9b373eaa595 100644 (file)
@@ -2164,5 +2164,35 @@ double lwcircle_center(const POINT4D *p1, const POINT4D *p2, const POINT4D *p3,
 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  */
 
index ad35019539b4ce7b6de6f19e1e81cc093897ae26..37d60711187f9efca12fca59655572d5bebf35ff 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <stdlib.h>
 
-
+#define LWGEOM_GEOS_ERRMSG_MAXSIZE 256
 char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE];
 
 extern void
@@ -397,6 +397,12 @@ LWGEOM2GEOS(const LWGEOM *lwgeom)
        return g;
 }
 
+const char*
+lwgeom_geos_version()
+{
+       const char *ver = GEOSversion();
+       return ver;
+}
 
 
 
index 34a655d0fbe6c8b8164733e2b3dd3bf49298a5b5..edab8eed7271a4013ae27bf7526f76fee361c993 100644 (file)
 #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.
 */
@@ -50,7 +31,6 @@ GEOSGeometry * LWGEOM_GEOS_buildArea(const GEOSGeometry* geom_in);
 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, ...);
 
index 94640686998acbc643a0b7a2f0830cb15615d66c..73ff8543acf4771f4667792dd023e1540394b335 100644 (file)
  **********************************************************************/
 
 #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>
@@ -82,7 +81,7 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS);
 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);
 }
index f03b19f2847501a4c8263542587e32351c18425e..604197fb936650cb9172711b1a87b3aaf76e1ed9 100644 (file)
@@ -31,6 +31,7 @@
 #include "lwgeom_pg.h"
 #include "liblwgeom.h"
 #include "profile.h"
+#include "../liblwgeom/liblwgeom.h"
 #include "../liblwgeom/lwgeom_geos.h"
 
 #include <string.h>