]> granicus.if.org Git - postgis/commitdiff
Make GEOS 3.1 the mandatory minimum (#385)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 15 Jan 2010 17:54:52 +0000 (17:54 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 15 Jan 2010 17:54:52 +0000 (17:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5129 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
postgis/lwgeom_geos.c
postgis/lwgeom_geos_prepared.h
postgis/postgis.sql.in.c
postgis/uninstall_postgis.sql.in.c
regress/Makefile.in

index f5826308e728d8d06fb1dabbcf375b1d2c6cd0fe..7ccabdf6e36cdd5cc81f0a43ff8edcc162a9846b 100644 (file)
@@ -293,8 +293,10 @@ dnl Note: we extract the major & minor separately, ensure they are numeric, and
 dnl the final version. This is to guard against user error... 
 PGSQL_MAJOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f1 | sed 's/[[^0-9]]//g'` 
 PGSQL_MINOR_VERSION=`$PGCONFIG --version | sed 's/[[A-Za-z ]]*//' | cut -d. -f2 | sed 's/[[^0-9]]//g'` 
+PGSQL_FULL_VERSION=`$PGCONFIG --version`
 POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
 
+AC_MSG_RESULT([checking PostgreSQL version... $PGSQL_FULL_VERSION])
 dnl Ensure that we are using PostgreSQL >= 8.3
 if test ! "$PGSQL_MAJOR_VERSION" -ge 8; then
        AC_MSG_ERROR([PostGIS requires PostgreSQL >= 8.3])
@@ -449,11 +451,13 @@ dnl and then combine to give the final version.
 dnl This is to guard against user error... 
 GEOS_MAJOR_VERSION=`$GEOSCONFIG --version | cut -d. -f1 | sed 's/[[^0-9]]//g'`
 GEOS_MINOR_VERSION=`$GEOSCONFIG --version | cut -d. -f2 | sed 's/[[^0-9]]//g'`
+GEOS_FULL_VERSION=`$GEOSCONFIG --version`
 POSTGIS_GEOS_VERSION="$GEOS_MAJOR_VERSION$GEOS_MINOR_VERSION"
 
-dnl Ensure that we are using GEOS >= 3.0.0
-if test ! "$GEOS_MAJOR_VERSION" -ge 3; then
-       AC_MSG_ERROR([PostGIS requires GEOS >= 3.0])
+dnl Ensure that we are using GEOS >= 3.1.0
+AC_MSG_RESULT([checking GEOS version... $GEOS_FULL_VERSION])
+if test ! "$POSTGIS_GEOS_VERSION" -ge 31; then
+       AC_MSG_ERROR([PostGIS requires GEOS >= 3.1])
 fi
 
 dnl Extract the linker and include flags 
@@ -657,9 +661,9 @@ AC_MSG_RESULT([  C++ compiler:         ${CXX} ${CXXFLAGS}])
 AC_MSG_RESULT()
 AC_MSG_RESULT([ -------------- Dependencies -------------- ])
 AC_MSG_RESULT([  GEOS config:          ${GEOSCONFIG}])
-AC_MSG_RESULT([  GEOS version:         ${GEOS_MAJOR_VERSION}.${GEOS_MINOR_VERSION}])
+AC_MSG_RESULT([  GEOS version:         ${GEOS_FULL_VERSION}])
 AC_MSG_RESULT([  PostgreSQL config:    ${PGCONFIG}])
-AC_MSG_RESULT([  PostgreSQL version:   ${PGSQL_MAJOR_VERSION}.${PGSQL_MINOR_VERSION}])
+AC_MSG_RESULT([  PostgreSQL version:   ${PGSQL_FULL_VERSION}])
 AC_MSG_RESULT([  PROJ4 version:        ${POSTGIS_PROJ_VERSION}])
 AC_MSG_RESULT([  Libxml2 config:       ${XML2CONFIG}])
 AC_MSG_RESULT([  Libxml2 version:      ${POSTGIS_LIBXML2_VERSION}])
index e6652f6783fae0dccabcc75a58fe3350bb75b5b4..8d9640351a35790175732a58ba4680bc7a023bf1 100644 (file)
@@ -209,10 +209,8 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
 #if POSTGIS_DEBUG_LEVEL > 0
        static int call=1;
 #endif
-#if POSTGIS_GEOS_VERSION >= 31
        int gotsrid = 0;
        int allpolys=1;
-#endif
 
 #if POSTGIS_DEBUG_LEVEL > 0
        call++;
@@ -247,8 +245,6 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
        /* Ok, we really need geos now ;) */
        initGEOS(lwnotice, lwnotice);
 
-#if POSTGIS_GEOS_VERSION >= 31
-
        /*
        ** First, see if all our elements are POLYGON/MULTIPOLYGON
        ** If they are, we can use UnionCascaded for faster results.
@@ -388,7 +384,6 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
        }
        else
        {
-#endif /* POSTGIS_GEOS_VERSION >= 31 */
                /*
                ** Heterogeneous result, let's slog through this one union at a time.
                */
@@ -465,9 +460,7 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
                        PG_RETURN_NULL();
                }
 
-#if POSTGIS_GEOS_VERSION >= 31
        }
-#endif
 
        if ( result == NULL )
        {
@@ -787,8 +780,6 @@ Datum convexhull(PG_FUNCTION_ARGS)
 
 }
 
-#if POSTGIS_GEOS_VERSION >= 30
-
 PG_FUNCTION_INFO_V1(topologypreservesimplify);
 Datum topologypreservesimplify(PG_FUNCTION_ARGS)
 {
@@ -832,7 +823,6 @@ Datum topologypreservesimplify(PG_FUNCTION_ARGS)
        PG_FREE_IF_COPY(geom1, 0);
        PG_RETURN_POINTER(result);
 }
-#endif /* POSTGIS_GEOS_VERSION >= 30 */
 
 PG_FUNCTION_INFO_V1(buffer);
 Datum buffer(PG_FUNCTION_ARGS)
@@ -1413,7 +1403,6 @@ Datum isvalid(PG_FUNCTION_ARGS)
        PG_RETURN_BOOL(result);
 }
 
-#if POSTGIS_GEOS_VERSION >= 31
 /*
 ** IsValidReason is only available in the GEOS
 ** C API > version 3.0
@@ -1455,7 +1444,6 @@ Datum isvalidreason(PG_FUNCTION_ARGS)
        PG_RETURN_POINTER(result);
 
 }
-#endif
 
 /**
  * overlaps(PG_LWGEOM g1,PG_LWGEOM g2)
index 8b8dbd5e1694f67f9d26cb1ac2e140327b2271a3..7107ce9e364db109428b3cd323266fb118c13609 100644 (file)
@@ -33,9 +33,7 @@
 /*
 ** GEOS prepared geometry is only available from GEOS 3.1 onwards
 */
-#if POSTGIS_GEOS_VERSION >= 31
 #define PREPARED_GEOM
-#endif
 
 /*
 ** Cache structure. We use PG_LWGEOM as keys so no transformations
index f2595c3bf58dc47038f3ac3913ec4b1c511f8348..ebc99ddb106f497a642499647572046ace021558 100644 (file)
@@ -3901,7 +3901,6 @@ CREATE OR REPLACE FUNCTION ST_LocateBetweenElevations(geometry, float8, float8)
        AS 'MODULE_PATHNAME', 'ST_LocateBetweenElevations'
        LANGUAGE 'C' IMMUTABLE STRICT;
 
-#if POSTGIS_GEOS_VERSION >= 30
 -- Requires GEOS >= 3.0.0
 -- Availability: 1.3.3
 CREATE OR REPLACE FUNCTION ST_SimplifyPreserveTopology(geometry, float8)
@@ -3909,9 +3908,7 @@ CREATE OR REPLACE FUNCTION ST_SimplifyPreserveTopology(geometry, float8)
        AS 'MODULE_PATHNAME','topologypreservesimplify'
        LANGUAGE 'C' IMMUTABLE STRICT
        COST 100;
-#endif
 
-#if POSTGIS_GEOS_VERSION >= 31
 -- Requires GEOS >= 3.1.0
 -- Availability: 1.4.0
 CREATE OR REPLACE FUNCTION ST_IsValidReason(geometry)
@@ -3919,7 +3916,6 @@ CREATE OR REPLACE FUNCTION ST_IsValidReason(geometry)
        AS 'MODULE_PATHNAME', 'isvalidreason'
        LANGUAGE 'C' IMMUTABLE STRICT
        COST 100;
-#endif
 
 #if POSTGIS_GEOS_VERSION >= 32
 -- Requires GEOS >= 3.2.0
@@ -4352,7 +4348,6 @@ CREATE OR REPLACE FUNCTION ST_Contains(geometry,geometry)
        AS 'SELECT $1 && $2 AND _ST_Contains($1,$2)'
        LANGUAGE 'SQL' IMMUTABLE;
 
-#if POSTGIS_GEOS_VERSION >= 30
 -- Availability: 1.2.2
 CREATE OR REPLACE FUNCTION _ST_CoveredBy(geometry,geometry)
        RETURNS boolean
@@ -4379,9 +4374,7 @@ CREATE OR REPLACE FUNCTION ST_Covers(geometry,geometry)
        RETURNS boolean
        AS 'SELECT $1 && $2 AND _ST_Covers($1,$2)'
        LANGUAGE 'SQL' IMMUTABLE;
-#endif
 
-#if POSTGIS_GEOS_VERSION >= 31
 -- Availability: 1.4.0
 CREATE OR REPLACE FUNCTION _ST_ContainsProperly(geometry,geometry)
        RETURNS boolean
@@ -4395,7 +4388,6 @@ CREATE OR REPLACE FUNCTION ST_ContainsProperly(geometry,geometry)
        RETURNS boolean
        AS 'SELECT $1 && $2 AND _ST_ContainsProperly($1,$2)'
        LANGUAGE 'SQL' IMMUTABLE;
-#endif
 
 -- Deprecation in 1.2.3
 CREATE OR REPLACE FUNCTION overlaps(geometry,geometry)
index a71c3d662e7c3ca1d674fb1aa8e725e4373bbf04..dd5404e91816fcfed51fdbee0de37110963a1e32 100644 (file)
@@ -281,18 +281,12 @@ DROP FUNCTION IsValid(geometry);
 DROP FUNCTION ST_Overlaps(geometry,geometry);
 DROP FUNCTION _ST_Overlaps(geometry,geometry);
 DROP FUNCTION overlaps(geometry,geometry);
-
-#if POSTGIS_GEOS_VERSION >= 31
 DROP FUNCTION ST_ContainsProperly(geometry,geometry);
 DROP FUNCTION _ST_ContainsProperly(geometry,geometry);
-#endif
-
-#if POSTGIS_GEOS_VERSION >= 30
 DROP FUNCTION ST_Covers(geometry,geometry);
 DROP FUNCTION _ST_Covers(geometry,geometry);
 DROP FUNCTION ST_CoveredBy(geometry,geometry);
 DROP FUNCTION _ST_CoveredBy(geometry,geometry);
-#endif
 
 DROP FUNCTION ST_Contains(geometry,geometry);
 DROP FUNCTION _ST_Contains(geometry,geometry);
@@ -369,15 +363,8 @@ DROP FUNCTION ST_Boundary(geometry);
 DROP FUNCTION boundary(geometry);
 DROP FUNCTION ST_Difference(geometry,geometry);
 DROP FUNCTION difference(geometry,geometry);
-
-#if POSTGIS_GEOS_VERSION >= 31
 DROP FUNCTION ST_IsValidReason(geometry);
-#endif
-
-#if POSTGIS_GEOS_VERSION >= 30
 DROP FUNCTION ST_SimplifyPreserveTopology(geometry, float8);
-#endif
-
 DROP FUNCTION ST_LocateBetweenElevations(geometry, float8, float8);
 DROP FUNCTION ST_LineCrossingDirection(geometry, geometry);
 DROP FUNCTION _ST_LineCrossingDirection(geometry, geometry);
@@ -393,8 +380,6 @@ DROP FUNCTION ST_Intersection(geometry,geometry);
 DROP FUNCTION intersection(geometry,geometry);
 #if POSTGIS_GEOS_VERSION >= 32
 DROP FUNCTION ST_HausdorffDistance(geometry, geometry);
-#endif
-#if POSTGIS_GEOS_VERSION >= 32
 DROP FUNCTION ST_HausdorffDistance(geometry, geometry, float8);
 #endif
 
index 4e5a5e3b804cd0887c8c7b5282e1ac4555d25cc5..94b9fdb0e0bf932ba8dea61773d7dcd6dcc8a1b9 100644 (file)
@@ -63,22 +63,14 @@ TESTS = \
        in_gml \
        in_kml \
        regress_ogc \
+       regress_ogc_cover \
+       regress_ogc_prep \
        regress_bdpoly \
        regress_proj \
        dumppoints \
        wmsservers \
        tickets
 
-# Covers/CoveredBy only if GEOS >= 3.0
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 30),1)
-       TESTS += regress_ogc_cover 
-endif
-
-# PreparedGeometry only if GEOS >= 3.1
-ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 31),1)
-       TESTS += regress_ogc_prep
-endif
-
 # Styled buffer only if GEOS >= 3.2
 ifeq ($(shell expr $(POSTGIS_GEOS_VERSION) ">=" 32),1)
        TESTS += regress_buffer_params