[SCM] PostGIS branch master updated. 3.5.0-195-g0549494e1

git at osgeo.org git at osgeo.org
Thu Jan 23 15:00:49 PST 2025


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  0549494e141deb6da46d7c2bf7489f7febe2d20c (commit)
      from  1f7c3150b47ac75059ede6ee4cc8cec30bf5f5ea (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 0549494e141deb6da46d7c2bf7489f7febe2d20c
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Jan 23 15:00:03 2025 -0800

    Add interrupt support to interpolate grid, and
    confirm interrupt support on GDAL contour.
    References #5841

diff --git a/raster/rt_core/librtcore.h b/raster/rt_core/librtcore.h
index 0953e365e..cfc8981df 100644
--- a/raster/rt_core/librtcore.h
+++ b/raster/rt_core/librtcore.h
@@ -2334,14 +2334,6 @@ rt_util_gdal_driver_registered(const char *drv);
 GDALDatasetH
 rt_util_gdal_open(const char *fn, GDALAccess fn_access, int shared);
 
-
-/*
-    Callback for GDAL functions to hook into interrupt system
-*/
-int
-rt_util_gdal_progress_func(double dfComplete, const char *pszMessage, void *pProgressArg);
-
-
 void
 rt_util_from_ogr_envelope(
 	OGREnvelope	env,
diff --git a/raster/rt_core/rt_gdal.c b/raster/rt_core/rt_gdal.c
index 90a509a99..6303c5ee9 100644
--- a/raster/rt_core/rt_gdal.c
+++ b/raster/rt_core/rt_gdal.c
@@ -55,7 +55,7 @@ typedef struct
 /*  GDAL progress callback for interrupt handling */
 /* ---------------------------------------------------------------- */
 
-int rt_util_gdal_progress_func(
+static int rt_util_gdal_progress_func(
 	double dfComplete,
 	const char *pszMessage,
 	void *pProgressArg)
diff --git a/raster/rt_pg/rtpg_gdal.c b/raster/rt_pg/rtpg_gdal.c
index 957c208e2..f65c7631e 100644
--- a/raster/rt_pg/rtpg_gdal.c
+++ b/raster/rt_pg/rtpg_gdal.c
@@ -30,6 +30,7 @@
 #include <postgres.h>
 #include <fmgr.h>
 #include <funcapi.h> /* for SRF */
+#include <miscadmin.h>
 #include <utils/builtins.h> /* for text_to_cstring() */
 #include <access/htup_details.h> /* for heap_form_tuple() */
 #include <utils/lsyscache.h> /* for get_typlenbyvalalign */
@@ -625,6 +626,19 @@ Datum RASTER_Contour(PG_FUNCTION_ARGS)
 	}
 }
 
+
+static int rtpg_util_gdal_progress_func(
+	double dfComplete,
+	const char *pszMessage,
+	void *pProgressArg)
+{
+	(void)dfComplete;
+	(void)pszMessage;
+
+	/* return 0 to cancel processing, 1 to continue */
+	return !(QueryCancelPending || ProcDiePending);
+}
+
 /************************************************************************
  *  RASTER_InterpolateRaster
  *
@@ -790,7 +804,7 @@ Datum RASTER_InterpolateRaster(PG_FUNCTION_ARGS)
 	        env.MinX, env.MaxX, env.MinY, env.MaxY,
 	        in_band_width, in_band_height,
 	        in_band_gdaltype, out_data,
-	        NULL, /* GDALProgressFunc */
+	        rtpg_util_gdal_progress_func, /* GDALProgressFunc */
 	        NULL /* ProgressArgs */
 	        );
 

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

Summary of changes:
 raster/rt_core/librtcore.h |  8 --------
 raster/rt_core/rt_gdal.c   |  2 +-
 raster/rt_pg/rtpg_gdal.c   | 16 +++++++++++++++-
 3 files changed, 16 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list