[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-123-gd7287d9af

git at osgeo.org git at osgeo.org
Thu Jan 6 22:24:14 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  d7287d9afd946013476fb8c0484a1a2bd7931291 (commit)
       via  1b2c2bbb50495ff0207ca4bb24aa21178bf18f19 (commit)
      from  187152efe010c3d030f8b7fab392acdb47a5a543 (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 d7287d9afd946013476fb8c0484a1a2bd7931291
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Jan 7 01:22:29 2022 -0500

    News: sfcgal_full_version
    Closes https://trac.osgeo.org/postgis/ticket/5040
    Closes https://git.osgeo.org/gitea/postgis/postgis/pulls/61

diff --git a/NEWS b/NEWS
index c710b74de..27828bb65 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PostGIS 3.3.0dev
 
  * Enhancements *
   - #5037, add convexhull 3D (Loïc Bartoletti)
+  - #5040, add postgis_sfcgal_full_version (Loïc Bartoletti)
 
 PostGIS 3.2.0 (Olivier Courtin Edition)
 2021/12/17

commit 1b2c2bbb50495ff0207ca4bb24aa21178bf18f19
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Mon Nov 15 14:15:46 2021 +0100

    add sfcgal_full_version

diff --git a/doc/reference_sfcgal.xml b/doc/reference_sfcgal.xml
index a917e4189..e4c0685c2 100644
--- a/doc/reference_sfcgal.xml
+++ b/doc/reference_sfcgal.xml
@@ -33,15 +33,56 @@
 	  <refsection>
 		<title>Description</title>
 
+        <para>Returns the version of SFCGAL in use</para>
+
 		<para>Availability: 2.1.0</para>
 		<para>&sfcgal_required;</para>
 		<para>&Z_support;</para>
 		<para>&P_support;</para>
 		<para>&T_support;</para>
 	  </refsection>
+	  <refsection>
+				<title>See Also</title>
+
+				<para><xref linkend="postgis_sfcgal_full_version" /></para>
+		</refsection>
 
 	</refentry>
 
+	<refentry id="postgis_sfcgal_full_version">
+	  <refnamediv>
+		<refname>postgis_sfcgal_full_version</refname>
+
+		<refpurpose>Returns the full version of SFCGAL in use including CGAL and Boost versions</refpurpose>
+	  </refnamediv>
+
+	  <refsynopsisdiv>
+		<funcsynopsis>
+		  <funcprototype>
+			<funcdef>text <function>postgis_sfcgal_full_version</function></funcdef>
+                        <void/>
+		  </funcprototype>
+		</funcsynopsis>
+	  </refsynopsisdiv>
+
+	  <refsection>
+		<title>Description</title>
+
+        <para>Returns the full version of SFCGAL in use including CGAL and Boost versions</para>
+
+		<para>Availability: 3.2.0</para>
+		<para>&sfcgal_required;</para>
+		<para>&Z_support;</para>
+		<para>&P_support;</para>
+		<para>&T_support;</para>
+	  </refsection>
+	  <refsection>
+				<title>See Also</title>
+
+				<para><xref linkend="postgis_sfcgal_version" /></para>
+		</refsection>
+
+	</refentry>
 
 	<refentry id="ST_Extrude">
 	  <refnamediv>
diff --git a/liblwgeom/lwgeom_sfcgal.c b/liblwgeom/lwgeom_sfcgal.c
index 72ff5d45a..d49d3f93a 100644
--- a/liblwgeom/lwgeom_sfcgal.c
+++ b/liblwgeom/lwgeom_sfcgal.c
@@ -23,6 +23,7 @@
  **********************************************************************/
 
 #include "lwgeom_sfcgal.h"
+#include <stdio.h>
 
 static int SFCGAL_type_to_lwgeom_type(sfcgal_geometry_type_t type);
 static POINTARRAY *ptarray_from_SFCGAL(const sfcgal_geometry_t *geom, int force3D);
@@ -36,6 +37,20 @@ lwgeom_sfcgal_version()
 	return version;
 }
 
+#define MAX_LENGTH_SFCGAL_FULL_VERSION 50
+/* Return SFCGAL full version string */
+const char *
+lwgeom_sfcgal_full_version()
+{
+#if POSTGIS_SFCGAL_VERSION >= 10400
+	const char *version = sfcgal_full_version();
+#else
+	char *version = (char*)malloc(MAX_LENGTH_SFCGAL_FULL_VERSION);
+	snprintf(version, MAX_LENGTH_SFCGAL_FULL_VERSION, "SFCGAL=\"%s\" CGAL=\"Unknown\" Boost=\"Unknown\"", sfcgal_version());
+#endif
+	return version;
+}
+
 /*
  * Mapping between SFCGAL and PostGIS types
  *
diff --git a/liblwgeom/lwgeom_sfcgal.h b/liblwgeom/lwgeom_sfcgal.h
index bc85748c2..fa21be697 100644
--- a/liblwgeom/lwgeom_sfcgal.h
+++ b/liblwgeom/lwgeom_sfcgal.h
@@ -28,6 +28,9 @@
 /* return SFCGAL version string */
 const char *lwgeom_sfcgal_version(void);
 
+/* return SFCGAL full version string */
+const char *lwgeom_sfcgal_full_version(void);
+
 /* Convert SFCGAL structure to lwgeom PostGIS */
 LWGEOM *SFCGAL2LWGEOM(const sfcgal_geometry_t *geom, int force3D, int32_t SRID);
 
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index b901614a2..04f11babe 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3076,7 +3076,7 @@ BEGIN
 			RAISE DEBUG 'Function postgis_gdal_version() not found.  Is raster support enabled and rtpostgis.sql installed?';
 	END;
 	BEGIN
-		SELECT @extschema at .postgis_sfcgal_version() INTO sfcgalver;
+		SELECT @extschema at .postgis_sfcgal_full_version() INTO sfcgalver;
 		BEGIN
 			SELECT @extschema at .postgis_sfcgal_scripts_installed() INTO sfcgal_scr_ver;
 		EXCEPTION
diff --git a/postgis/uninstall_sfcgal.sql.in b/postgis/uninstall_sfcgal.sql.in
index 095131f15..4ec220cc9 100644
--- a/postgis/uninstall_sfcgal.sql.in
+++ b/postgis/uninstall_sfcgal.sql.in
@@ -16,6 +16,8 @@ BEGIN;
 
 DROP FUNCTION IF EXISTS postgis_sfcgal_version();
 
+DROP FUNCTION IF EXISTS postgis_sfcgal_full_version();
+
 DROP FUNCTION IF EXISTS ST_3DIntersection(geom1 geometry, geom2 geometry);
 
 DROP FUNCTION IF EXISTS ST_Tesselate(geometry);
diff --git a/sfcgal/lwgeom_sfcgal.c b/sfcgal/lwgeom_sfcgal.c
index 23cfc783b..777365e0f 100644
--- a/sfcgal/lwgeom_sfcgal.c
+++ b/sfcgal/lwgeom_sfcgal.c
@@ -99,6 +99,10 @@ handleInterrupt(int sig)
 
 Datum postgis_sfcgal_version(PG_FUNCTION_ARGS);
 
+#if POSTGIS_SFCGAL_VERSION >= 10400
+Datum postgis_sfcgal_full_version(PG_FUNCTION_ARGS);
+#endif
+
 Datum sfcgal_from_ewkt(PG_FUNCTION_ARGS);
 Datum sfcgal_area3D(PG_FUNCTION_ARGS);
 Datum sfcgal_intersection3D(PG_FUNCTION_ARGS);
@@ -562,6 +566,16 @@ Datum postgis_sfcgal_version(PG_FUNCTION_ARGS)
 	PG_RETURN_POINTER(result);
 }
 
+#if POSTGIS_SFCGAL_VERSION >= 10400
+PG_FUNCTION_INFO_V1(postgis_sfcgal_full_version);
+Datum postgis_sfcgal_full_version(PG_FUNCTION_ARGS)
+{
+	const char *ver = lwgeom_sfcgal_full_version();
+	text *result = cstring_to_text(ver);
+	PG_RETURN_POINTER(result);
+}
+#endif
+
 PG_FUNCTION_INFO_V1(sfcgal_is_solid);
 Datum sfcgal_is_solid(PG_FUNCTION_ARGS)
 {
diff --git a/sfcgal/sfcgal.sql.in b/sfcgal/sfcgal.sql.in
index d5af9de3d..8de50c939 100644
--- a/sfcgal/sfcgal.sql.in
+++ b/sfcgal/sfcgal.sql.in
@@ -27,6 +27,13 @@ CREATE OR REPLACE FUNCTION postgis_sfcgal_version() RETURNS text
         AS 'MODULE_PATHNAME'
         LANGUAGE 'c' IMMUTABLE;
 
+#if POSTGIS_SFCGAL_VERSION >= 10400
+-- Availability: 3.2.0
+CREATE OR REPLACE FUNCTION postgis_sfcgal_full_version() RETURNS text
+        AS 'MODULE_PATHNAME'
+        LANGUAGE 'c' IMMUTABLE;
+#endif
+
 -- Availability: 3.0.0
 CREATE OR REPLACE FUNCTION postgis_sfcgal_noop(geometry)
         RETURNS geometry

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

Summary of changes:
 NEWS                            |  1 +
 doc/reference_sfcgal.xml        | 41 +++++++++++++++++++++++++++++++++++++++++
 liblwgeom/lwgeom_sfcgal.c       | 15 +++++++++++++++
 liblwgeom/lwgeom_sfcgal.h       |  3 +++
 postgis/postgis.sql.in          |  2 +-
 postgis/uninstall_sfcgal.sql.in |  2 ++
 sfcgal/lwgeom_sfcgal.c          | 14 ++++++++++++++
 sfcgal/sfcgal.sql.in            |  7 +++++++
 8 files changed, 84 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list