mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
Add support for disabling offline raster storage at compile time
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
This commit is contained in:
parent
b55193f5c3
commit
610a37eb20
20
configure.ac
20
configure.ac
|
@ -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])
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue