]> granicus.if.org Git - postgis/commitdiff
#1898, #2322 move geos functions in lwtin.c to lwgeom_geos.c to prevent unhealthy...
authorRegina Obe <lr@pcorp.us>
Sun, 12 May 2013 02:27:58 +0000 (02:27 +0000)
committerRegina Obe <lr@pcorp.us>
Sun, 12 May 2013 02:27:58 +0000 (02:27 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11438 b70326c6-7e19-0410-871a-916f4a2858ee

Version.config
extensions/upgradeable_versions.mk
liblwgeom/lwgeom_geos.c
liblwgeom/lwtin.c
loader/cunit/Makefile.in

index f54903211c8e2b1f1f3f76a03d8dbb897762ab98..3ca74384d5234937ed3a9fc7261a8fde5ed0d2c3 100644 (file)
@@ -5,5 +5,5 @@
 
 POSTGIS_MAJOR_VERSION=2
 POSTGIS_MINOR_VERSION=1
-POSTGIS_MICRO_VERSION=0beta1
+POSTGIS_MICRO_VERSION=0beta2dev
 
index 49c34ed57a5179022d87027090b6e30e0ebf1b7e..8c0d4cd916435daac9720f923837d9d6a4ff4b83 100644 (file)
@@ -3,4 +3,5 @@ UPGRADEABLE_VERSIONS = \
     2.0.1 \
     2.0.2 \
     2.0.3 \
-    2.1.0SVN
+    2.1.0SVN \
+       2.1.0beta1
index 50bdba9c5499f584e957184fefe74135e2fc9e15..f627fa08b2d842f1ca9ccf6b4b4950ccd3c58eee 100644 (file)
@@ -1300,6 +1300,68 @@ lwgeom_offsetcurve(const LWLINE *lwline, double size, int quadsegs, int joinStyl
 #endif /* POSTGIS_GEOS_VERSION < 32 */
 }
 
+LWTIN *lwtin_from_geos(const GEOSGeometry *geom, int want3d) {
+       int type = GEOSGeomTypeId(geom);
+       int hasZ;
+       int SRID = GEOSGetSRID(geom);
+
+       /* GEOS's 0 is equivalent to our unknown as for SRID values */
+       if ( SRID == 0 ) SRID = SRID_UNKNOWN;
+
+       if ( want3d ) {
+               hasZ = GEOSHasZ(geom);
+               if ( ! hasZ ) {
+                       LWDEBUG(3, "Geometry has no Z, won't provide one");
+                       want3d = 0;
+               }
+       }
+
+       switch (type) {
+               LWTRIANGLE **geoms;
+               uint32_t i, ngeoms;
+       case GEOS_GEOMETRYCOLLECTION:
+               LWDEBUG(4, "lwgeom_from_geometry: it's a Collection or Multi");
+
+               ngeoms = GEOSGetNumGeometries(geom);
+               geoms = NULL;
+               if ( ngeoms ) {
+                       geoms = lwalloc(ngeoms * sizeof *geoms);
+                       if (!geoms) {
+                               lwerror("lwtin_from_geos: can't allocate geoms");
+                               return NULL;
+                       }
+                       for (i=0; i<ngeoms; i++) {
+                               const GEOSGeometry *poly, *ring;
+                               const GEOSCoordSequence *cs;
+                               POINTARRAY *pa;
+
+                               poly = GEOSGetGeometryN(geom, i);
+                               ring = GEOSGetExteriorRing(poly);
+                               cs = GEOSGeom_getCoordSeq(ring);
+                               pa = ptarray_from_GEOSCoordSeq(cs, want3d);
+
+                               geoms[i] = lwtriangle_construct(SRID, NULL, pa);
+                       }
+               }
+               return (LWTIN *)lwcollection_construct(TINTYPE, SRID, NULL, ngeoms, (LWGEOM **)geoms);
+       case GEOS_POLYGON:
+       case GEOS_MULTIPOINT:
+       case GEOS_MULTILINESTRING:
+       case GEOS_MULTIPOLYGON:
+       case GEOS_LINESTRING:
+       case GEOS_LINEARRING:
+       case GEOS_POINT:
+               lwerror("lwtin_from_geos: invalid geometry type for tin: %d", type);
+               break;
+
+       default:
+               lwerror("GEOS2LWGEOM: unknown geometry type: %d", type);
+               return NULL;
+       }
+
+       /* shouldn't get here */
+       return NULL;
+}
 /*
  * output = 1 for edges, 2 for TIN, 0 for polygons
  */
index daf001204a27bd6c76c835de85f5d680c4b577ed..b55ccc2144d1b76c6c8340b5b45f66035b3648b0 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "lwgeom_geos.h"
 #include "liblwgeom_internal.h"
 #include "lwgeom_log.h"
 
-LWTIN *lwtin_from_geos(const GEOSGeometry *geom, int want3d);
-
 
 LWTIN* lwtin_add_lwtriangle(LWTIN *mobj, const LWTRIANGLE *obj)
 {
        return (LWTIN*)lwcollection_add_lwgeom((LWCOLLECTION*)mobj, (LWGEOM*)obj);
 }
 
-LWTIN *lwtin_from_geos(const GEOSGeometry *geom, int want3d) {
-       int type = GEOSGeomTypeId(geom);
-       int hasZ;
-       int SRID = GEOSGetSRID(geom);
-
-       /* GEOS's 0 is equivalent to our unknown as for SRID values */
-       if ( SRID == 0 ) SRID = SRID_UNKNOWN;
-
-       if ( want3d ) {
-               hasZ = GEOSHasZ(geom);
-               if ( ! hasZ ) {
-                       LWDEBUG(3, "Geometry has no Z, won't provide one");
-                       want3d = 0;
-               }
-       }
-
-       switch (type) {
-               LWTRIANGLE **geoms;
-               uint32_t i, ngeoms;
-       case GEOS_GEOMETRYCOLLECTION:
-               LWDEBUG(4, "lwgeom_from_geometry: it's a Collection or Multi");
-
-               ngeoms = GEOSGetNumGeometries(geom);
-               geoms = NULL;
-               if ( ngeoms ) {
-                       geoms = lwalloc(ngeoms * sizeof *geoms);
-                       if (!geoms) {
-                               lwerror("lwtin_from_geos: can't allocate geoms");
-                               return NULL;
-                       }
-                       for (i=0; i<ngeoms; i++) {
-                               const GEOSGeometry *poly, *ring;
-                               const GEOSCoordSequence *cs;
-                               POINTARRAY *pa;
-
-                               poly = GEOSGetGeometryN(geom, i);
-                               ring = GEOSGetExteriorRing(poly);
-                               cs = GEOSGeom_getCoordSeq(ring);
-                               pa = ptarray_from_GEOSCoordSeq(cs, want3d);
-
-                               geoms[i] = lwtriangle_construct(SRID, NULL, pa);
-                       }
-               }
-               return (LWTIN *)lwcollection_construct(TINTYPE, SRID, NULL, ngeoms, (LWGEOM **)geoms);
-       case GEOS_POLYGON:
-       case GEOS_MULTIPOINT:
-       case GEOS_MULTILINESTRING:
-       case GEOS_MULTIPOLYGON:
-       case GEOS_LINESTRING:
-       case GEOS_LINEARRING:
-       case GEOS_POINT:
-               lwerror("lwtin_from_geos: invalid geometry type for tin: %d", type);
-               break;
-
-       default:
-               lwerror("GEOS2LWGEOM: unknown geometry type: %d", type);
-               return NULL;
-       }
-
-       /* shouldn't get here */
-       return NULL;
-}
-
 void lwtin_free(LWTIN *tin)
 {
        int i;
index 017a48aae16182aa8b3a6a319c77400c721da536..ece86faeee0d40f1150e8d45b54ee2fd338c1e29 100644 (file)
 # **********************************************************************
 
 CC=@CC@
-GEOS_CFLAGS=@GEOS_CPPFLAGS@
-GEOS_LDFLAGS=@GEOS_LDFLAGS@ -lgeos_c
-
-CFLAGS=@CFLAGS@ @WARNFLAGS@ $(GEOS_CFLAGS)
+CFLAGS=@CFLAGS@ @WARNFLAGS@
 
 CUNIT_LDFLAGS=@CUNIT_LDFLAGS@
 CUNIT_CPPFLAGS=@CUNIT_CPPFLAGS@ -I..