]> granicus.if.org Git - postgis/commitdiff
Add support for disabling offline raster storage at compile time
authorSandro Santilli <strk@keybit.net>
Thu, 10 Apr 2014 09:18:15 +0000 (09:18 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 10 Apr 2014 09:18:15 +0000 (09:18 +0000)
Adds --disable-offline-raster configure switch
Testsuite fails with offline rasters disabled (could be fixed to
skip offline raster tests)

git-svn-id: http://svn.osgeo.org/postgis/trunk@12450 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
raster/raster_config.h.in
raster/rt_core/rt_serialize.c

index 66eddd381cde76c5b9527381d471c91076b85efa..6c6392eda3ef9a12e67d3d214f692146a881f266 100644 (file)
@@ -1107,6 +1107,20 @@ if test "x$with_raster" != "xno"; then
 
                AC_SUBST([GDALFPOLYGONIZE])
 
+    dnl ===========================================================================
+    dnl Allow output of double truncation warnings with --with-raster-dblwarning
+    dnl ===========================================================================
+    AC_ARG_ENABLE(
+      [offline-rasters],
+      AC_HELP_STRING([--disable-offline-rasters], [disable support for off-db rasters]),
+      [POSTGIS_RASTER_DISABLE_OFFLINE=1],
+      [POSTGIS_RASTER_DISABLE_OFFLINE=0])
+
+    AC_DEFINE_UNQUOTED(
+      [POSTGIS_RASTER_DISABLE_OFFLINE],
+      [$POSTGIS_RASTER_DISABLE_OFFLINE],
+      [Define to disable support for offline rasters])
+
        else
                AC_MSG_RESULT([not found])
                AC_MSG_ERROR([gdal-config not found. Use --without-raster or try --with-gdalconfig=<path to gdal-config>])
@@ -1228,7 +1242,11 @@ AC_MSG_RESULT([  Perl:                 ${PERL}])
 AC_MSG_RESULT()
 AC_MSG_RESULT([ --------------- Extensions --------------- ])
 if test "x$RASTER" = "xraster"; then
-    AC_MSG_RESULT([  PostGIS Raster:       enabled])
+  if test "x$POSTGIS_RASTER_DISABLE_OFFLINE" = "x1"; then
+    AC_MSG_RESULT([  PostGIS Raster:       enabled (no offline)])
+  else
+    AC_MSG_RESULT([  PostGIS Raster:       enabled (offline included)])
+  fi
 else
     AC_MSG_RESULT([  PostGIS Raster:       disabled])
 
index a4bfdf1c4ee534ea80fb0dc82ce5bc083cfb2ca2..d2c41eb5bd72efa41eea2b7831cc60e65f764ec0 100644 (file)
@@ -32,3 +32,6 @@
 
 /* Define to 1 if a warning is outputted every time a double is truncated */
 #undef POSTGIS_RASTER_WARN_ON_TRUNCATION
+
+/* Define to disable support for offline rasters */
+#undef POSTGIS_RASTER_DISABLE_OFFLINE
index 7d18f147f977e43252e747fb406fd26b327798d9..aeae287afcf69bc897c7728324d5a9bd936f7f23 100644 (file)
@@ -580,6 +580,10 @@ rt_raster_serialize(rt_raster raster) {
                /* Add band type */
                *ptr = band->pixtype;
                if (band->offline) {
+#ifdef POSTGIS_RASTER_DISABLE_OFFLINE
+      rterror("rt_raster_serialize: offdb raster support disabled at compile-time");
+      return NULL;
+#endif
                        *ptr |= BANDTYPE_FLAG_OFFDB;
                }
                if (band->hasnodata) {