[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-26-g27cd95c

git at osgeo.org git at osgeo.org
Thu Dec 31 14:50:27 PST 2020


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  27cd95caf3cf16ab27dcb908c5b786c6ab36bafd (commit)
       via  0a5e4864ccdd348b9e9bb1dab25afa41c990ed59 (commit)
      from  c063dad34d41907d9e65394f340971e53e01df4e (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 27cd95caf3cf16ab27dcb908c5b786c6ab36bafd
Merge: 0a5e486 c063dad
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Dec 31 14:50:24 2020 -0800

    Merge branch 'master' of https://git.osgeo.org/gitea/postgis/postgis


commit 0a5e4864ccdd348b9e9bb1dab25afa41c990ed59
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Dec 31 14:49:24 2020 -0800

    Make the VSICURL synthetic driver work as documented. Closes #4818

diff --git a/raster/rt_core/rt_util.c b/raster/rt_core/rt_util.c
index 18a68b5..f616a56 100644
--- a/raster/rt_core/rt_util.c
+++ b/raster/rt_core/rt_util.c
@@ -392,10 +392,11 @@ rt_util_gdal_open(const char *fn, GDALAccess fn_access, int shared) {
 			/* do nothing */
 		}
 		else if (
-			(strstr(fn, "/vsicurl") != NULL) &&
+			(strstr(fn, "/vsi") != NULL) &&
+			(strstr(fn, "/vsimem") == NULL) &&
 			(strstr(gdal_enabled_drivers, GDAL_VSICURL) == NULL)
 		) {
-			rterror("rt_util_gdal_open: Cannot open VSICURL file. VSICURL disabled");
+			rterror("rt_util_gdal_open: Cannot open %s file. %s disabled", GDAL_VSICURL, GDAL_VSICURL);
 			return NULL;
 		}
 	}
diff --git a/raster/rt_pg/rtpostgis.c b/raster/rt_pg/rtpostgis.c
index be97205..278115c 100644
--- a/raster/rt_pg/rtpostgis.c
+++ b/raster/rt_pg/rtpostgis.c
@@ -278,6 +278,7 @@ static void
 rtpg_assignHookGDALEnabledDrivers(const char *enabled_drivers, void *extra) {
 	int enable_all = 0;
 	int disable_all = 0;
+	int vsicurl = 0;
 
 	char **enabled_drivers_array = NULL;
 	uint32_t enabled_drivers_count = 0;
@@ -294,6 +295,8 @@ rtpg_assignHookGDALEnabledDrivers(const char *enabled_drivers, void *extra) {
 	if (enabled_drivers == NULL)
 		return;
 
+	elog(DEBUG4, "Enabling GDAL drivers: %s", enabled_drivers);
+
 	/* destroy the driver manager */
 	/* this is the only way to ensure GDAL_SKIP is recognized */
 	GDALDestroyDriverManager();
@@ -325,6 +328,14 @@ rtpg_assignHookGDALEnabledDrivers(const char *enabled_drivers, void *extra) {
 			}
 		}
 	}
+	else if (strstr(enabled_drivers, GDAL_VSICURL) != NULL) {
+		for (i = 0; i < enabled_drivers_count; i++) {
+			if (strstr(enabled_drivers_array[i], GDAL_VSICURL) != NULL) {
+				enabled_drivers_found[i] = TRUE;
+				vsicurl = 1;
+			}
+		}
+	}
 
 	if (!enable_all) {
 		int found = 0;
@@ -393,6 +404,9 @@ rtpg_assignHookGDALEnabledDrivers(const char *enabled_drivers, void *extra) {
 			elog(WARNING, "Unknown GDAL driver: %s", enabled_drivers_array[i]);
 	}
 
+	if (vsicurl)
+		elog(WARNING, "%s set.", GDAL_VSICURL);
+
 	/* destroy the driver manager */
 	/* this is the only way to ensure GDAL_SKIP is recognized */
 	GDALDestroyDriverManager();
diff --git a/raster/test/cunit/cu_misc.c b/raster/test/cunit/cu_misc.c
index 3427605..24c618d 100644
--- a/raster/test/cunit/cu_misc.c
+++ b/raster/test/cunit/cu_misc.c
@@ -134,12 +134,12 @@ static void test_util_gdal_open() {
 	CU_ASSERT(ds == NULL);
 
 	/* enabled drivers with VSICURL */
-	/* disabled as we don't want network access as a requirement
-	gdal_enabled_drivers = enabled_vsi;
-	ds = rt_util_gdal_open("/vsicurl/http://download.osgeo.org/gdal/data/gtiff/small_world.tif", GA_ReadOnly, 0);
-	CU_ASSERT(ds != NULL);
-	GDALClose(ds);
-	*/
+	/* disabled as we don't want network access as a requirement */
+	// gdal_enabled_drivers = enabled_vsi;
+	// ds = rt_util_gdal_open("/vsicurl/http://download.osgeo.org/gdal/data/gtiff/small_world.tif", GA_ReadOnly, 0);
+	// CU_ASSERT(ds != NULL);
+	// GDALClose(ds);
+
 }
 
 /* register tests */

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

Summary of changes:
 raster/rt_core/rt_util.c    |  5 +++--
 raster/rt_pg/rtpostgis.c    | 14 ++++++++++++++
 raster/test/cunit/cu_misc.c | 12 ++++++------
 3 files changed, 23 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list