[SCM] PostGIS branch master updated. 3.4.0rc1-1151-gbb94b8dc8
git at osgeo.org
git at osgeo.org
Wed Jun 12 08:08:39 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 bb94b8dc8bfbe31bcf505d0262724236011601a7 (commit)
from 23a1dd0339b4333787d23e7f2ffd5f6d293bead8 (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 bb94b8dc8bfbe31bcf505d0262724236011601a7
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Jun 12 12:42:17 2024 +0200
New postgis_proj_compiled_version() and exposure in full version
Only shows compiled version in postgis_full_version() output
if it doesn't match with runtime version up to patchlevel.
Closes #5742
diff --git a/NEWS b/NEWS
index 195cd9102..c0283954f 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,7 @@ Andreas Schild (German Team)
- command upgrade upgrades all databases that need to be
- command status reports status of all databases
(Sandro Santilli)
+ - #5742, expose version of PROJ at compile time (Sandro Santilli)
- #5721, Allow sharing sequences between different topologies (Lars Opsahl)
- #5667, TopoGeo_LoadGeometry (Sandro Santilli)
- #5055, add explicit <> geometry operator to prevent non-unique
diff --git a/doc/reference_version.xml b/doc/reference_version.xml
index 9c448561a..1cbdc8917 100644
--- a/doc/reference_version.xml
+++ b/doc/reference_version.xml
@@ -7,7 +7,7 @@
</abstract>
</info>
-
+
<refentry xml:id="PostGIS_Extensions_Upgrade">
<refnamediv>
@@ -420,10 +420,64 @@ postgis_liblwgeom_version
<refsection>
<title>See Also</title>
- <para><xref linkend="PostGIS_Full_Version"/>, <xref linkend="PostGIS_GEOS_Version"/>, <xref linkend="PostGIS_Lib_Version"/>, <xref linkend="PostGIS_LibXML_Version"/>, <xref linkend="PostGIS_Version"/></para>
+ <para>
+<xref linkend="PostGIS_PROJ_Compiled_Version"/>,
+<xref linkend="PostGIS_Full_Version"/>,
+<xref linkend="PostGIS_GEOS_Version"/>,
+<xref linkend="PostGIS_Lib_Version"/>,
+<xref linkend="PostGIS_LibXML_Version"/>,
+<xref linkend="PostGIS_Version"/></para>
</refsection>
</refentry>
+ <refentry xml:id="PostGIS_PROJ_Compiled_Version">
+ <refnamediv>
+ <refname>PostGIS_PROJ_Compiled_Version</refname>
+
+ <refpurpose>Returns the version number of the PROJ
+ library against which PostGIS was built.</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>text <function>PostGIS_PROJ_Compiled_Version</function></funcdef>
+
+ <paramdef></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+
+ <refsection>
+ <title>Description</title>
+
+ <para>Returns the version number of the PROJ library, or
+ against which PostGIS was built.</para>
+
+ <para role="availability" conformance="3.4.0">Availability: 3.5.0</para>
+ </refsection>
+
+ <refsection>
+ <title>Examples</title>
+
+ <programlisting>SELECT PostGIS_PROJ_Compiled_Version();
+ postgis_proj_compiled_version
+-------------------------------
+ 9.1.1
+(1 row)</programlisting>
+ </refsection>
+
+ <refsection>
+ <title>See Also</title>
+
+ <para>
+<xref linkend="PostGIS_PROJ_Version"/>,
+<xref linkend="PostGIS_Full_Version"/>
+ </para>
+ </refsection>
+ </refentry>
+
+
<refentry xml:id="PostGIS_Wagyu_Version">
<refnamediv>
<refname>PostGIS_Wagyu_Version</refname>
@@ -650,4 +704,4 @@ postgis_liblwgeom_version
</refsection>
</refentry>
- </section>
\ No newline at end of file
+ </section>
diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c
index 43e40de68..82c7382a4 100644
--- a/postgis/lwgeom_transform.c
+++ b/postgis/lwgeom_transform.c
@@ -39,6 +39,7 @@ Datum transform(PG_FUNCTION_ARGS);
Datum transform_geom(PG_FUNCTION_ARGS);
Datum transform_pipeline_geom(PG_FUNCTION_ARGS);
Datum postgis_proj_version(PG_FUNCTION_ARGS);
+Datum postgis_proj_version_compiled(PG_FUNCTION_ARGS);
Datum LWGEOM_asKML(PG_FUNCTION_ARGS);
/**
@@ -227,6 +228,23 @@ Datum postgis_proj_version(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(cstring_to_text(stringbuffer_getstring(&sb)));
}
+PG_FUNCTION_INFO_V1(postgis_proj_compiled_version);
+Datum postgis_proj_compiled_version(PG_FUNCTION_ARGS)
+{
+ static char ver[64];
+ text *result;
+ sprintf(
+ ver,
+ "%d.%d.%d",
+ (POSTGIS_PROJ_VERSION/10000),
+ ((POSTGIS_GEOS_VERSION%10000)/100),
+ ((POSTGIS_GEOS_VERSION)%100)
+ );
+
+ result = cstring_to_text(ver);
+ PG_RETURN_POINTER(result);
+}
+
/**
* Encode feature in KML
*/
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index c8f0ed48b..33d0ee707 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -3033,6 +3033,11 @@ CREATE OR REPLACE FUNCTION postgis_proj_version() RETURNS text
LANGUAGE 'c' IMMUTABLE
_COST_DEFAULT;
+CREATE OR REPLACE FUNCTION postgis_proj_compiled_version() RETURNS text
+ AS 'MODULE_PATHNAME'
+ LANGUAGE 'c' IMMUTABLE
+ _COST_DEFAULT;
+
CREATE OR REPLACE FUNCTION postgis_wagyu_version() RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE 'c' IMMUTABLE
@@ -3223,6 +3228,7 @@ DECLARE
libver text;
librev text;
projver text;
+ projver_compiled text;
geosver text;
geosver_compiled text;
sfcgalver text;
@@ -3248,6 +3254,7 @@ BEGIN
SELECT @extschema at .postgis_proj_version() INTO projver;
SELECT @extschema at .postgis_geos_version() INTO geosver;
SELECT @extschema at .postgis_geos_compiled_version() INTO geosver_compiled;
+ SELECT @extschema at .postgis_proj_compiled_version() INTO projver_compiled;
SELECT @extschema at .postgis_libjson_version() INTO json_lib_ver;
SELECT @extschema at .postgis_libprotobuf_version() INTO protobuf_lib_ver;
SELECT @extschema at .postgis_wagyu_version() INTO wagyu_lib_ver;
@@ -3346,6 +3353,10 @@ BEGIN
IF projver IS NOT NULL THEN
fullver = fullver || ' PROJ="' || projver || '"';
+ IF (string_to_array(projver, '.'))[1:3] != (string_to_array(projver_compiled, '.'))[1:3]
+ THEN
+ fullver = format('%s (compiled against PROJ %s)', fullver, projver_compiled);
+ END IF;
END IF;
IF gdalver IS NOT NULL THEN
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
doc/reference_version.xml | 60 +++++++++++++++++++++++++++++++++++++++++++---
postgis/lwgeom_transform.c | 18 ++++++++++++++
postgis/postgis.sql.in | 11 +++++++++
4 files changed, 87 insertions(+), 3 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list