[SCM] PostGIS branch master updated. 3.4.0rc1-1069-g9c2efa917

git at osgeo.org git at osgeo.org
Mon Mar 25 12:54:31 PDT 2024


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  9c2efa9175a5c2c1ca5a42974c07a05506aabc7b (commit)
      from  41561a9d6f7049389b4f6f2224d960541e647a1e (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 9c2efa9175a5c2c1ca5a42974c07a05506aabc7b
Author: Sandro Santilli <strk at kbt.io>
Date:   Mon Mar 25 20:52:55 2024 +0100

    Allow debugging geoms in WKB format
    
    Define POSTGIS_DEBUG_GEOMETRY_WKB to get HEXKWB instead of EWKT

diff --git a/liblwgeom/lwgeom_log.h b/liblwgeom/lwgeom_log.h
index feb2ac5d7..22ea89e81 100644
--- a/liblwgeom/lwgeom_log.h
+++ b/liblwgeom/lwgeom_log.h
@@ -52,17 +52,28 @@
                 __FILE__, __func__, __LINE__, __VA_ARGS__); \
         } while (0);
 
+#ifdef POSTGIS_DEBUG_GEOMETRY_WKB
 /* Display a notice and a WKT representation of a geometry
  * at the given debug level */
+#define LWDEBUGG(level, geom, msg) \
+  if (POSTGIS_DEBUG_LEVEL >= level) \
+  do { \
+    char *wkt = lwgeom_to_hexwkb_buffer(geom, WKB_EXTENDED); \
+    LWDEBUGF(level, msg ": %s", wkt); \
+    lwfree(wkt); \
+  } while (0);
+#else
+/* Display a notice and an HEXWKB representation of a geometry
+ * at the given debug level */
 #define LWDEBUGG(level, geom, msg) \
   if (POSTGIS_DEBUG_LEVEL >= level) \
   do { \
     size_t sz; \
     char *wkt = lwgeom_to_wkt(geom, WKT_EXTENDED, 15, &sz); \
-    /* char *wkt = lwgeom_to_hexwkb(geom, WKT_EXTENDED, &sz); */ \
     LWDEBUGF(level, msg ": %s", wkt); \
     lwfree(wkt); \
   } while (0);
+#endif
 
 /* Display a formatted notice and a WKT representation of a geometry
  * at the given debug level */
diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c
index fde0b3992..55184436c 100644
--- a/liblwgeom/topo/lwgeom_topo.c
+++ b/liblwgeom/topo/lwgeom_topo.c
@@ -27,6 +27,7 @@
 #include "../postgis_config.h"
 
 /*#define POSTGIS_DEBUG_LEVEL 2*/
+#define POSTGIS_DEBUG_GEOMETRY_WKB 1
 #include "lwgeom_log.h"
 
 #include "liblwgeom_internal.h"

-----------------------------------------------------------------------

Summary of changes:
 liblwgeom/lwgeom_log.h       | 13 ++++++++++++-
 liblwgeom/topo/lwgeom_topo.c |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list