diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index c7898a627cc..9ec210ac0f1 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -35,7 +35,7 @@ /* Define to enable pre-version 2.2 geodesic functions for geography types (e.g. Vincenty for ST_Distance); otherwise use GeographicLib */ #define USE_PRE22GEODESIC -#undef USE_PRE22GEODESIC +/* #undef USE_PRE22GEODESIC */ /** * Floating point comparators. diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index b538892a24e..6391a9918d9 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -1244,8 +1244,12 @@ Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS) lwgeoms = palloc(sizeof(LWGEOM*) * nelems); count = 0; outtype = 0; - + +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { @@ -1432,7 +1436,11 @@ Datum LWGEOM_makeline_garray(PG_FUNCTION_ARGS) geoms = palloc(sizeof(LWGEOM *) * nelems); ngeoms = 0; +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 0ab16b4163d..44888fa65c2 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -283,7 +283,11 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) if ( nelems == 0 ) PG_RETURN_NULL(); /* Quick scan for nulls */ +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { /* Skip null array items */ @@ -316,7 +320,11 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) ** We need to convert the array of GSERIALIZED into a GEOS collection. ** First make an array of GEOS geometries. */ +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { GSERIALIZED *gser_in; @@ -464,7 +472,11 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) ** If they are, we can use UnionCascaded for faster results. */ count = 0; +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { GSERIALIZED *pggeom; @@ -523,7 +535,11 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) ** We need to convert the array of GSERIALIZED into a GEOS MultiPolygon. ** First make an array of GEOS Polygons. */ +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { GEOSGeometry* g; @@ -620,7 +636,11 @@ Datum pgis_union_geometry_array(PG_FUNCTION_ARGS) ** Heterogeneous result, let's slog through this one union at a time. */ +#if POSTGIS_PGSQL_VERSION >= 95 + iterator = array_create_iterator(array, 0, NULL); +#else iterator = array_create_iterator(array, 0); +#endif while( array_iterate(iterator, &value, &isnull) ) { GSERIALIZED *geom; diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c index f9898d1b346..d3111eff2f8 100644 --- a/postgis/lwgeom_inout.c +++ b/postgis/lwgeom_inout.c @@ -535,8 +535,14 @@ Datum TWKBFromLWGEOMArray(PG_FUNCTION_ARGS) /* Loop through array and build a collection of geometry and */ /* a simple array of ids. If either side is NULL, skip it */ + +#if POSTGIS_PGSQL_VERSION >= 95 + iter_geoms = array_create_iterator(arr_geoms, 0, NULL); + iter_ids = array_create_iterator(arr_ids, 0, NULL); +#else iter_geoms = array_create_iterator(arr_geoms, 0); iter_ids = array_create_iterator(arr_ids, 0); +#endif while( array_iterate(iter_geoms, &val_geom, &null_geom) && array_iterate(iter_ids, &val_id, &null_id) )