File 2a9cc526.patch of Package librttopo

From 2a9cc526b1da8ea58422ed0158f57dabd82c498d Mon Sep 17 00:00:00 2001
From: Andrea Peri <aperi2007@gmail.com>
Date: Fri, 31 Dec 2021 14:56:36 +0000
Subject: [PATCH] apply patch postgis
 https://trac.osgeo.org/postgis/changeset/15444

---
 src/rtout_x3d.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/rtout_x3d.c b/src/rtout_x3d.c
index 3dad3ab..0165bf2 100644
--- a/src/rtout_x3d.c
+++ b/src/rtout_x3d.c
@@ -63,6 +63,20 @@ rtgeom_to_x3d3(const RTCTX *ctx, const RTGEOM *geom, char *srs, int precision, i
 {
   int type = geom->type;
 
+/* apply patch postgis: https://trac.osgeo.org/postgis/changeset/15444 */
+/* https://trac.osgeo.org/postgis/ticket/3704 */
+
+/* Empty string for empties */
+  if( lwgeom_is_empty(geom) )
+  {
+    char *ret = NULL;
+    ret = lwalloc(1);
+    ret[0] = '\0';
+    return ret;
+  }
+
+/* end patch */
+
   switch (type)
   {
   case RTPOINTTYPE:
openSUSE Build Service is sponsored by