[mapserver-commits] r9569 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Nov 27 16:16:02 EST 2009


Author: dmorissette
Date: 2009-11-27 16:16:01 -0500 (Fri, 27 Nov 2009)
New Revision: 9569

Modified:
   trunk/mapserver/configure
   trunk/mapserver/configure.in
   trunk/mapserver/mapgeos.c
Log:
Avoid build error with GEOS 2.2.x caused by missing GEOSSimplify() (#2753)

Modified: trunk/mapserver/configure
===================================================================
--- trunk/mapserver/configure	2009-11-27 20:40:09 UTC (rev 9568)
+++ trunk/mapserver/configure	2009-11-27 21:16:01 UTC (rev 9569)
@@ -10919,6 +10919,12 @@
 
   GEOS_ENABLED=-DUSE_GEOS
 
+    if test 300000 -le $ac_geos_version  ; then
+    echo "$as_me:$LINENO: result: GEOS >= 3.0.0 found. Adding -DGEOS_HAS_SIMPLIFY" >&5
+echo "${ECHO_T}GEOS >= 3.0.0 found. Adding -DGEOS_HAS_SIMPLIFY" >&6
+    GEOS_ENABLED="$GEOS_ENABLED -DGEOS_HAS_SIMPLIFY"
+  fi
+
   GEOS_INCDIR=`$GEOS_CONFIG --includes`
   GEOS_INC="-I$GEOS_INCDIR"
   GEOS_LIB="`$GEOS_CONFIG --libs`_c"

Modified: trunk/mapserver/configure.in
===================================================================
--- trunk/mapserver/configure.in	2009-11-27 20:40:09 UTC (rev 9568)
+++ trunk/mapserver/configure.in	2009-11-27 21:16:01 UTC (rev 9569)
@@ -1319,6 +1319,12 @@
 
   GEOS_ENABLED=-DUSE_GEOS
 
+  dnl GEOS 3.0+ required for GEOSSimplify
+  if test 300000 -le $ac_geos_version  ; then
+    AC_MSG_RESULT([GEOS >= 3.0.0 found. Adding -DGEOS_HAS_SIMPLIFY])
+    GEOS_ENABLED="$GEOS_ENABLED -DGEOS_HAS_SIMPLIFY"
+  fi
+
   GEOS_INCDIR=`$GEOS_CONFIG --includes`
   GEOS_INC="-I$GEOS_INCDIR"
   GEOS_LIB="`$GEOS_CONFIG --libs`_c"

Modified: trunk/mapserver/mapgeos.c
===================================================================
--- trunk/mapserver/mapgeos.c	2009-11-27 20:40:09 UTC (rev 9568)
+++ trunk/mapserver/mapgeos.c	2009-11-27 21:16:01 UTC (rev 9569)
@@ -669,7 +669,7 @@
 
 shapeObj *msGEOSSimplify(shapeObj *shape, double tolerance)
 {
-#ifdef USE_GEOS
+#if defined(USE_GEOS) && defined(GEOS_HAS_SIMPLIFY)
   GEOSGeom g1, g2; 
 
   if(!shape) 
@@ -684,14 +684,14 @@
   g2 = GEOSSimplify(g1, tolerance);
   return msGEOSGeometry2Shape(g2);
 #else
-  msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSTopologyPreservingSimplifier()");
+  msSetError(MS_GEOSERR, "GEOS Simplify support is not available.", "msGEOSTopologyPreservingSimplifier()");
   return NULL;
 #endif
 }
 
 shapeObj *msGEOSTopologyPreservingSimplify(shapeObj *shape, double tolerance)
 {
-#ifdef USE_GEOS
+#if defined(USE_GEOS) && defined(GEOS_HAS_SIMPLIFY)
   GEOSGeom g1, g2; 
 
   if(!shape) 
@@ -706,7 +706,7 @@
   g2 = GEOSTopologyPreserveSimplify(g1, tolerance);
   return msGEOSGeometry2Shape(g2);
 #else
-  msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSTopologyPreservingSimplifier()");
+  msSetError(MS_GEOSERR, "GEOS Simplify support is not available.", "msGEOSTopologyPreservingSimplifier()");
   return NULL;
 #endif
 }



More information about the mapserver-commits mailing list