[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-992-g8fd02bc3a

git at osgeo.org git at osgeo.org
Wed Jun 21 11:38:13 PDT 2023


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  8fd02bc3ac8fe9c96635efd1f32d9ef9ea938bdf (commit)
      from  6cc527c57a8f13936234da6e19fa3062b18bbfb7 (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 8fd02bc3ac8fe9c96635efd1f32d9ef9ea938bdf
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Jun 21 11:38:02 2023 -0700

    Add metadata about Proj network grids cache to the postgis_proj_version() info string

diff --git a/NEWS b/NEWS
index a6fc1e74e..efc226614 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ xxxx/xx/xx
   - Speed up coincident nodes check in topology validation  (Sandro Santilli)
   - GH718, ST_QuantizeCoordinates(): speed-up implementation (Even Rouault)
   - Repair spatial planner stats to use computed selectivity for contains/within queries (Paul Ramsey)
+  - Additional metadata on Proj installation in postgis_proj_version (Paul Ramsey)
 
 * Bug Fix *
 
diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c
index 3d631faa8..105720bb5 100644
--- a/postgis/lwgeom_transform.c
+++ b/postgis/lwgeom_transform.c
@@ -31,6 +31,7 @@
 #include "../postgis_config.h"
 #include "liblwgeom.h"
 #include "lwgeodetic.h"
+#include "stringbuffer.h"
 #include "lwgeom_transform.h"
 
 
@@ -200,14 +201,30 @@ Datum transform_pipeline_geom(PG_FUNCTION_ARGS)
 PG_FUNCTION_INFO_V1(postgis_proj_version);
 Datum postgis_proj_version(PG_FUNCTION_ARGS)
 {
+	stringbuffer_t sb;
+
 #if POSTGIS_PROJ_VERSION < 61
-	const char *ver = pj_get_release();
-	text *result = cstring_to_text(ver);
+	stringbuffer_init(&sb);
+	stringbuffer_append(&sb, pj_get_release());
 #else
 	PJ_INFO pji = proj_info();
-	text *result = 	cstring_to_text(pji.version);
+	stringbuffer_init(&sb);
+	stringbuffer_append(&sb, pji.version);
+#endif
+
+#if POSTGIS_PROJ_VERSION >= 70
+	stringbuffer_aprintf(&sb,
+		" PROJ_NETWORK=%s",
+		proj_context_is_network_enabled(NULL) ? "ON" : "OFF");
+
+	if (proj_context_get_url_endpoint(NULL))
+		stringbuffer_aprintf(&sb, " PROJ_URL_ENDPOINT=%s", proj_context_get_url_endpoint(NULL));
+
+	if (proj_context_get_user_writable_directory(NULL, 0))
+		stringbuffer_aprintf(&sb, " PROJ_GRID_DIRECTORY=%s", proj_context_get_user_writable_directory(NULL, 0));
 #endif
-	PG_RETURN_POINTER(result);
+
+	PG_RETURN_POINTER(cstring_to_text(stringbuffer_getstring(&sb)));
 }
 
 

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

Summary of changes:
 NEWS                       |  1 +
 postgis/lwgeom_transform.c | 25 +++++++++++++++++++++----
 2 files changed, 22 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list