[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-417-gfce2bbce5
git at osgeo.org
git at osgeo.org
Wed Dec 21 07:35:51 PST 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via fce2bbce55002b0bde1d59939bbf700ac020b4bf (commit)
from 88a9ee6eb2e200a0189ea38c9e426e38e8467995 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fce2bbce55002b0bde1d59939bbf700ac020b4bf
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Dec 21 15:43:18 2022 +0100
Print version of compiled-against geos upon lack of requirements
References #5306
diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in
index aad9398d7..646bb1da0 100644
--- a/liblwgeom/liblwgeom.h.in
+++ b/liblwgeom/liblwgeom.h.in
@@ -2369,6 +2369,7 @@ extern LWGEOM* lwcurve_linearize(const LWGEOM *geom, double tol, LW_LINEARIZE_TO
/** Return GEOS version string (not to be freed) */
const char* lwgeom_geos_version(void);
+const char* lwgeom_geos_compiled_version(void);
/** Convert an LWGEOM to a GEOS Geometry and convert back -- for debug only */
LWGEOM* lwgeom_geos_noop(const LWGEOM *geom) ;
diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index afdad095a..3b926cc65 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -39,6 +39,20 @@ LWTIN* lwtin_from_geos(const GEOSGeometry* geom, uint8_t want3d);
#define LWGEOM_GEOS_ERRMSG_MAXSIZE 256
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE];
+const char *
+lwgeom_geos_compiled_version()
+{
+ static char ver[64];
+ sprintf(
+ ver,
+ "%d.%d.%d",
+ (POSTGIS_GEOS_VERSION/10000),
+ ((POSTGIS_GEOS_VERSION%10000)/100),
+ ((POSTGIS_GEOS_VERSION)%100)
+ );
+ return ver;
+}
+
extern void
lwgeom_geos_error(const char* fmt, ...)
{
@@ -52,6 +66,16 @@ lwgeom_geos_error(const char* fmt, ...)
va_end(ap);
}
+void
+lwgeom_geos_error_minversion(const char *functionality, const char *minver)
+{
+ lwerror(
+ "%s requires a build against GEOS-%s or higher,"
+ " this version of PostGIS was built against version %s",
+ functionality, minver, lwgeom_geos_compiled_version()
+ );
+}
+
/* Destroy any non-null GEOSGeometry* pointers passed as arguments */
#define GEOS_FREE(...) \
do { \
@@ -726,7 +750,7 @@ lwgeom_intersection_prec(const LWGEOM* geom1, const LWGEOM* geom2, double prec)
if ( prec >= 0) {
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Fixed-precision intersection requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Fixed-precision intersection", "3.9");
GEOS_FREE_AND_FAIL(g1, g2);
return NULL;
#else
@@ -774,7 +798,7 @@ lwgeom_linemerge_directed(const LWGEOM* geom, int directed)
if (directed)
{
#if POSTGIS_GEOS_VERSION < 31100
- lwerror("Directed line merging requires GEOS-3.11 or higher");
+ lwgeom_geos_error_minversion("Directed line merging", "3.11");
GEOS_FREE_AND_FAIL(g1);
return NULL;
#else
@@ -823,7 +847,7 @@ lwgeom_unaryunion_prec(const LWGEOM* geom, double prec)
if ( prec >= 0) {
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Fixed-precision union requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Fixed-precision unary union", "3.9");
GEOS_FREE_AND_FAIL(g1);
return NULL;
#else
@@ -875,7 +899,7 @@ lwgeom_difference_prec(const LWGEOM* geom1, const LWGEOM* geom2, double prec)
if ( prec >= 0) {
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Fixed-precision difference requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Fixed-precision difference", "3.9");
GEOS_FREE_AND_FAIL(g1, g2);
return NULL;
#else
@@ -926,7 +950,7 @@ lwgeom_symdifference_prec(const LWGEOM* geom1, const LWGEOM* geom2, double prec)
if ( prec >= 0) {
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Fixed-precision difference requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Fixed-precision symdifference", "3.9");
GEOS_FREE_AND_FAIL(g1, g2);
return NULL;
#else
@@ -985,7 +1009,7 @@ LWGEOM*
lwgeom_reduceprecision(const LWGEOM* geom, double gridSize)
{
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Precision reduction requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Precision reduction", "3.9");
return NULL;
#else
@@ -1079,7 +1103,7 @@ lwgeom_union_prec(const LWGEOM* geom1, const LWGEOM* geom2, double gridSize)
if ( gridSize >= 0) {
#if POSTGIS_GEOS_VERSION < 30900
- lwerror("Fixed-precision union requires GEOS-3.9 or higher");
+ lwgeom_geos_error_minversion("Fixed-precision union", "3.9");
GEOS_FREE_AND_FAIL(g1, g2);
return NULL;
#else
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/liblwgeom.h.in | 1 +
liblwgeom/lwgeom_geos.c | 38 +++++++++++++++++++++++++++++++-------
2 files changed, 32 insertions(+), 7 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list