[postgis-tickets] r16566 - Add ST_BandFileSize and ST_BandFileTimestamp,

Regina Obe lr at pcorp.us
Tue May 8 03:37:41 PDT 2018


Author: robe
Date: 2018-05-08 15:37:41 -0700 (Tue, 08 May 2018)
New Revision: 16566

Modified:
   trunk/NEWS
   trunk/doc/reference_raster.xml
   trunk/raster/rt_core/librtcore.h
   trunk/raster/rt_core/rt_band.c
   trunk/raster/rt_pg/rtpg_band_properties.c
   trunk/raster/rt_pg/rtpg_raster_properties.c
   trunk/raster/rt_pg/rtpostgis.sql.in
   trunk/raster/test/cunit/cu_band_basics.c
   trunk/raster/test/regress/load_outdb.sql
   trunk/raster/test/regress/load_outdb_expected
   trunk/raster/test/regress/rt_addband_expected
   trunk/raster/test/regress/rt_mapalgebra_expected
Log:
Add ST_BandFileSize and ST_BandFileTimestamp,
           extend ST_BandMetadata (Even Rouault)
Closes #4083 for PostGIS 2.5.0
Closes https://github.com/postgis/postgis/pull/240

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/NEWS	2018-05-08 22:37:41 UTC (rev 16566)
@@ -13,6 +13,8 @@
   - #3176, Add ST_OrientedEnvelope (Dan Baston)
   - #4029, Add ST_QuantizeCoordinates (Dan Baston)
   - #4063, Optional false origin point for ST_Scale (Paul Ramsey)
+  - #4082, Add ST_BandFileSize and ST_BandFileTimestamp,
+           extend ST_BandMetadata (Even Rouault)
 
 * Breaking Changes *
   - #4054, ST_SimplifyVW changed from > tolerance to >= tolerance

Modified: trunk/doc/reference_raster.xml
===================================================================
--- trunk/doc/reference_raster.xml	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/doc/reference_raster.xml	2018-05-08 22:37:41 UTC (rev 16566)
@@ -3760,7 +3760,7 @@
 			<refsection>
 				<title>Description</title>
 
-				<para>Returns basic meta data about a raster band. Columns returned: pixeltype, nodatavalue, isoutdb, path, outdbbandnum.
+				<para>Returns basic meta data about a raster band. Columns returned: pixeltype, nodatavalue, isoutdb, path, outdbbandnum, filesize, filetimestamp.
 				</para>
 				<note>
 					<para>
@@ -3775,9 +3775,12 @@
 				</note>
 				<note>
 					<para>
-						If isoutdb is False, path and outdbbandnum are NULL.
+						If isoutdb is False, path, outdbbandnum, filesize and filetimestamp are NULL. If outdb access is disabled, filesize and filetimestamp will also be NULL.
 					</para>
 				</note>
+
+				<para>Enhanced: 2.5.0 to include filesize and filetimestamp for outdb rasters.</para>
+
 			</refsection>
 
 			<refsection>
@@ -3795,11 +3798,11 @@
  	ARRAY[1,3,2]::int[]
 );
 
- bandnum | pixeltype | nodatavalue | isoutdb |                                      path                                      | outdbbandnum
----------+-----------+-------------+---------+--------------------------------------------------------------------------------+--------------
-       1 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            1
-       3 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            3
-       2 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            2
+ bandnum | pixeltype | nodatavalue | isoutdb |                                      path                                      | outdbbandnum  | filesize | filetimestamp |
+---------+-----------+-------------+---------+--------------------------------------------------------------------------------+---------------+----------+---------------+-
+       1 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            1  |    12345 |    1521807257 |
+       3 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            3  |    12345 |    1521807257 |
+       2 | 8BUI      |             | t       | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/Projected.tif      |            2  |    12345 |    1521807257 |
 				</programlisting>
 
 			</refsection>
@@ -3819,9 +3822,9 @@
 	WHERE rid=2
 ) As foo;
 
- rid | pixeltype | nodatavalue | isoutdb | path | outdbbandnum
------+-----------+---- --------+---------+------+--------------
-   2 | 8BUI      |           0 | f       |      |
+ rid | pixeltype | nodatavalue | isoutdb | path | outdbbandnum  | filesize | filetimestamp |
+-----+-----------+---- --------+---------+------+---------------+----------+---------------+-
+   2 | 8BUI      |           0 | f       |      |               |          |               |
 				</programlisting>
 
 			</refsection>
@@ -4022,6 +4025,86 @@
 			</refsection>
 		</refentry>
 
+		<refentry id="RT_ST_BandFileSize">
+			<refnamediv>
+				<refname>ST_BandFileSize</refname>
+				<refpurpose>Returns the file size of a band stored in file system. If no bandnum specified, 1 is assumed.</refpurpose>
+			</refnamediv>
+
+			<refsynopsisdiv>
+				<funcsynopsis>
+				  <funcprototype>
+					<funcdef>bigint <function>ST_BandFileSize</function></funcdef>
+					<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+					<paramdef choice="opt"><type>integer </type> <parameter>bandnum=1</parameter></paramdef>
+				  </funcprototype>
+				</funcsynopsis>
+			</refsynopsisdiv>
+
+			<refsection>
+				<title>Description</title>
+
+				<para>Returns the file size of a band stored in file system.  Throws an error if called with an in db band, or if outdb access is not enabled.</para>
+
+                                <para>This function is typically used in conjunction with ST_BandPath() and ST_BandFileTimestamp() so a client can determine if the filename of a outdb raster as seen by it is the same as the one seen by the server.</para>
+
+				<para>Availability: 2.5.0</para>
+
+			</refsection>
+
+                        <refsection>
+                                <title>Examples</title>
+
+                                <programlisting>SELECT ST_BandFileSize(rast,1) FROM dummy_rast WHERE rid = 1;
+
+ st_bandfilesize
+-----------------
+          240574
+				</programlisting>
+
+			</refsection>
+
+		</refentry>
+
+		<refentry id="RT_ST_BandFileTimestamp">
+			<refnamediv>
+				<refname>ST_BandFileTimestamp</refname>
+				<refpurpose>Returns the file timestamp of a band stored in file system. If no bandnum specified, 1 is assumed.</refpurpose>
+			</refnamediv>
+
+			<refsynopsisdiv>
+				<funcsynopsis>
+				  <funcprototype>
+					<funcdef>bigint <function>ST_BandFileTimestamp</function></funcdef>
+					<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
+					<paramdef choice="opt"><type>integer </type> <parameter>bandnum=1</parameter></paramdef>
+				  </funcprototype>
+				</funcsynopsis>
+			</refsynopsisdiv>
+
+			<refsection>
+				<title>Description</title>
+
+				<para>Returns the file timestamp (number of seconds since Jan 1st 1970 00:00:00 UTC) of a band stored in file system.  Throws an error if called with an in db band, or if outdb access is not enabled.</para>
+
+                                <para>This function is typically used in conjunction with ST_BandPath() and ST_BandFileSize() so a client can determine if the filename of a outdb raster as seen by it is the same as the one seen by the server.</para>
+
+				<para>Availability: 2.5.0</para>
+			</refsection>
+
+                        <refsection>
+                                <title>Examples</title>
+
+                                <programlisting>SELECT ST_BandFileTimestamp(rast,1) FROM dummy_rast WHERE rid = 1;
+
+ st_bandfiletimestamp
+----------------------
+           1521807257
+				</programlisting>
+
+			</refsection>
+		</refentry>
+
 		<refentry id="RT_ST_BandPixelType">
 			<refnamediv>
 				<refname>ST_BandPixelType</refname>

Modified: trunk/raster/rt_core/librtcore.h
===================================================================
--- trunk/raster/rt_core/librtcore.h	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/rt_core/librtcore.h	2018-05-08 22:37:41 UTC (rev 16566)
@@ -513,6 +513,26 @@
 const char* rt_band_get_ext_path(rt_band band);
 
 /**
+ * Return file size in bytes.
+ *
+ * Only for out-db rasters.
+ *
+ * @param band : the band
+ * @return file size in bytes or 0 in case of error.
+ */
+uint64_t rt_band_get_file_size(rt_band band);
+
+/**
+ * Return file timestamp.
+ *
+ * Only for out-db rasters.
+ *
+ * @param band : the band
+ * @return file timestamp (Unix time) or 0 in case of error.
+ */
+uint64_t rt_band_get_file_timestamp(rt_band band);
+
+/**
  * Return bands' external band number (only valid when
  * rt_band_is_offline returns non-zero).
  *

Modified: trunk/raster/rt_core/rt_band.c
===================================================================
--- trunk/raster/rt_core/rt_band.c	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/rt_core/rt_band.c	2018-05-08 22:37:41 UTC (rev 16566)
@@ -28,11 +28,15 @@
  *
  */
 
+// For stat64()
+#define _LARGEFILE64_SOURCE 1
+
 #include <stdio.h>
 
 #include "librtcore.h"
 #include "librtcore_internal.h"
 
+#include "cpl_vsi.h"
 #include "gdal_vrt.h"
 
 /**
@@ -579,6 +583,50 @@
 	return ES_NONE;
 }
 
+uint64_t rt_band_get_file_size(rt_band band) {
+    VSIStatBufL sStat;
+
+    assert(NULL != band);
+    if (!band->offline) {
+        rterror("rt_band_get_file_size: Band is not offline");
+        return 0;
+    }
+    /* offline_data is disabled */
+    if (!enable_outdb_rasters) {
+        rterror("rt_band_get_file_size: Access to offline bands disabled");
+        return 0;
+    }
+
+    if( VSIStatL(band->data.offline.path, &sStat) != 0 ) {
+        rterror("rt_band_get_file_size: Cannot access file");
+        return 0;
+    }
+
+    return sStat.st_size;
+}
+
+uint64_t rt_band_get_file_timestamp(rt_band band) {
+    VSIStatBufL sStat;
+
+    assert(NULL != band);
+    if (!band->offline) {
+        rterror("rt_band_get_file_timestamp: Band is not offline");
+        return 0;
+    }
+    /* offline_data is disabled */
+    if (!enable_outdb_rasters) {
+        rterror("rt_band_get_file_timestamp: Access to offline bands disabled");
+        return 0;
+    }
+
+    if( VSIStatL(band->data.offline.path, &sStat) != 0 ) {
+        rterror("rt_band_get_file_timestamp: Cannot access file");
+        return 0;
+    }
+
+    return sStat.st_mtime;
+}
+
 rt_pixtype
 rt_band_get_pixtype(rt_band band) {
 

Modified: trunk/raster/rt_pg/rtpg_band_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_band_properties.c	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/rt_pg/rtpg_band_properties.c	2018-05-08 22:37:41 UTC (rev 16566)
@@ -27,6 +27,9 @@
  *
  */
 
+// For stat64()
+#define _LARGEFILE64_SOURCE 1
+
 #include <postgres.h>
 #include <fmgr.h>
 #include <funcapi.h>
@@ -43,6 +46,8 @@
 
 #include "rtpostgis.h"
 
+extern char enable_outdb_rasters;
+
 /* Get all the properties of a raster band */
 Datum RASTER_getBandPixelType(PG_FUNCTION_ARGS);
 Datum RASTER_getBandPixelTypeName(PG_FUNCTION_ARGS);
@@ -340,7 +345,126 @@
 	PG_RETURN_TEXT_P(result);
 }
 
+
 /**
+ * Return the file size of the raster.
+ */
+PG_FUNCTION_INFO_V1(RASTER_getBandFileSize);
+Datum RASTER_getBandFileSize(PG_FUNCTION_ARGS)
+{
+    rt_pgraster *pgraster;
+    rt_raster raster;
+    rt_band band = NULL;
+    int64_t fileSize;
+    int32_t bandindex;
+
+    /* Index is 1-based */
+    bandindex = PG_GETARG_INT32(1);
+    if ( bandindex < 1 ) {
+            elog(NOTICE, "Invalid band index (must use 1-based). Returning NULL");
+            PG_RETURN_NULL();
+    }
+
+    if (PG_ARGISNULL(0)) PG_RETURN_NULL();
+    pgraster = (rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+
+    raster = rt_raster_deserialize(pgraster, FALSE);
+    if ( ! raster ) {
+        PG_FREE_IF_COPY(pgraster, 0);
+        elog(ERROR, "RASTER_getFileSize: Could not deserialize raster");
+        PG_RETURN_NULL();
+    }
+
+    /* Fetch requested band */
+    band = rt_raster_get_band(raster, bandindex - 1);
+    if (!band) {
+        elog(
+                NOTICE,
+                "Could not find raster band of index %d when getting band path. Returning NULL",
+                bandindex
+        );
+        rt_raster_destroy(raster);
+        PG_FREE_IF_COPY(pgraster, 0);
+        PG_RETURN_NULL();
+    }
+
+    if (!rt_band_is_offline(band)) {
+        elog(NOTICE, "Band of index %d is not out-db.", bandindex);
+        rt_band_destroy(band);
+        rt_raster_destroy(raster);
+        PG_FREE_IF_COPY(pgraster, 0);
+        PG_RETURN_NULL();
+    }
+
+    fileSize = rt_band_get_file_size(band);
+
+    rt_band_destroy(band);
+    rt_raster_destroy(raster);
+    PG_FREE_IF_COPY(pgraster, 0);
+
+    PG_RETURN_INT64(fileSize);
+}
+
+/**
+ * Return the file timestamp of the raster.
+ */
+PG_FUNCTION_INFO_V1(RASTER_getBandFileTimestamp);
+Datum RASTER_getBandFileTimestamp(PG_FUNCTION_ARGS)
+{
+    rt_pgraster *pgraster;
+    rt_raster raster;
+    rt_band band = NULL;
+    int64_t fileSize;
+    int32_t bandindex;
+
+    /* Index is 1-based */
+    bandindex = PG_GETARG_INT32(1);
+    if ( bandindex < 1 ) {
+            elog(NOTICE, "Invalid band index (must use 1-based). Returning NULL");
+            PG_RETURN_NULL();
+    }
+
+    if (PG_ARGISNULL(0)) PG_RETURN_NULL();
+    pgraster = (rt_pgraster *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+
+    raster = rt_raster_deserialize(pgraster, FALSE);
+    if ( ! raster ) {
+        PG_FREE_IF_COPY(pgraster, 0);
+        elog(ERROR, "RASTER_getBandFileTimestamp: Could not deserialize raster");
+        PG_RETURN_NULL();
+    }
+
+    /* Fetch requested band */
+    band = rt_raster_get_band(raster, bandindex - 1);
+    if (!band) {
+        elog(
+                NOTICE,
+                "Could not find raster band of index %d when getting band path. Returning NULL",
+                bandindex
+        );
+        rt_raster_destroy(raster);
+        PG_FREE_IF_COPY(pgraster, 0);
+        PG_RETURN_NULL();
+    }
+
+    if (!rt_band_is_offline(band)) {
+        elog(NOTICE, "Band of index %d is not out-db.", bandindex);
+        rt_band_destroy(band);
+        rt_raster_destroy(raster);
+        PG_FREE_IF_COPY(pgraster, 0);
+        PG_RETURN_NULL();
+    }
+
+    fileSize = rt_band_get_file_timestamp(band);
+
+    rt_band_destroy(band);
+    rt_raster_destroy(raster);
+    PG_FREE_IF_COPY(pgraster, 0);
+
+    PG_RETURN_INT64(fileSize);
+}
+
+/**
  * Get raster bands' meta data
  */
 PG_FUNCTION_INFO_V1(RASTER_bandmetadata);
@@ -359,6 +483,8 @@
 		bool isoutdb;
 		char *bandpath;
 		uint8_t extbandnum;
+                uint64_t filesize;
+                uint64_t timestamp;
 	};
 	struct bandmetadata *bmd = NULL;
 	struct bandmetadata *bmd2 = NULL;
@@ -535,6 +661,16 @@
 			else
 				bmd[i].extbandnum = 0;
 
+                        bmd[i].filesize = 0;
+                        bmd[i].timestamp = 0;
+                        if( bmd[i].bandpath && enable_outdb_rasters ) {
+                            VSIStatBufL sStat;
+                            if( VSIStatL(bmd[i].bandpath, &sStat) == 0 ) {
+                                bmd[i].filesize = sStat.st_size;
+                                bmd[i].timestamp = sStat.st_mtime;
+                            }
+                        }
+
 			rt_band_destroy(band);
 		}
 
@@ -575,7 +711,7 @@
 
 	/* do when there is more left to send */
 	if (call_cntr < max_calls) {
-		int values_length = 6;
+		int values_length = 8;
 		Datum values[values_length];
 		bool nulls[values_length];
 
@@ -599,6 +735,15 @@
 			nulls[5] = TRUE;
 		}
 
+		if (bmd2[call_cntr].filesize) {
+                    values[6] = UInt64GetDatum(bmd2[call_cntr].filesize);
+                    values[7] = UInt64GetDatum(bmd2[call_cntr].timestamp);
+                }
+                else {
+                    nulls[6] = TRUE;
+                    nulls[7] = TRUE;
+                }
+
 		/* build a tuple */
 		tuple = heap_form_tuple(tupdesc, values, nulls);
 

Modified: trunk/raster/rt_pg/rtpg_raster_properties.c
===================================================================
--- trunk/raster/rt_pg/rtpg_raster_properties.c	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/rt_pg/rtpg_raster_properties.c	2018-05-08 22:37:41 UTC (rev 16566)
@@ -44,6 +44,8 @@
 Datum RASTER_getWidth(PG_FUNCTION_ARGS);
 Datum RASTER_getHeight(PG_FUNCTION_ARGS);
 Datum RASTER_getNumBands(PG_FUNCTION_ARGS);
+Datum RASTER_getFileSize(PG_FUNCTION_ARGS);
+Datum RASTER_getFileTimestamp(PG_FUNCTION_ARGS);
 Datum RASTER_getXScale(PG_FUNCTION_ARGS);
 Datum RASTER_getYScale(PG_FUNCTION_ARGS);
 Datum RASTER_getXSkew(PG_FUNCTION_ARGS);

Modified: trunk/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- trunk/raster/rt_pg/rtpostgis.sql.in	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/rt_pg/rtpostgis.sql.in	2018-05-08 22:37:41 UTC (rev 16566)
@@ -4989,7 +4989,9 @@
 	OUT nodatavalue double precision,
 	OUT isoutdb boolean,
 	OUT path text,
-	OUT outdbbandnum integer
+	OUT outdbbandnum integer,
+	OUT filesize bigint,
+	OUT filetimestamp bigint
 )
 	AS 'MODULE_PATHNAME','RASTER_bandmetadata'
 	LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL;
@@ -5001,11 +5003,27 @@
 	OUT nodatavalue double precision,
 	OUT isoutdb boolean,
 	OUT path text,
-	OUT outdbbandnum integer
+	OUT outdbbandnum integer,
+	OUT filesize bigint,
+	OUT filetimestamp bigint
 )
-	AS $$ SELECT pixeltype, nodatavalue, isoutdb, path, outdbbandnum FROM @extschema at .ST_BandMetaData($1, ARRAY[$2]::int[]) LIMIT 1 $$
+	AS $$ SELECT pixeltype, nodatavalue, isoutdb, path, outdbbandnum, filesize, filetimestamp FROM @extschema at .ST_BandMetaData($1, ARRAY[$2]::int[]) LIMIT 1 $$
 	LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
 
+
+-- Availability: 2.5.0
+CREATE OR REPLACE FUNCTION ST_BandFileSize(rast raster, band integer DEFAULT 1)
+    RETURNS bigint
+    AS 'MODULE_PATHNAME','RASTER_getBandFileSize'
+    LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL;
+
+
+-- Availability: 2.5.0
+CREATE OR REPLACE FUNCTION St_BandFileTimestamp(rast raster, band integer DEFAULT 1)
+    RETURNS bigint
+    AS 'MODULE_PATHNAME','RASTER_getBandFileTimestamp'
+    LANGUAGE 'c' IMMUTABLE STRICT _PARALLEL;
+
 -----------------------------------------------------------------------
 -- Raster Pixel Accessors
 -----------------------------------------------------------------------

Modified: trunk/raster/test/cunit/cu_band_basics.c
===================================================================
--- trunk/raster/test/cunit/cu_band_basics.c	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/test/cunit/cu_band_basics.c	2018-05-08 22:37:41 UTC (rev 16566)
@@ -54,6 +54,9 @@
 	/* isoffline */
 	CU_ASSERT(!rt_band_is_offline(band));
 
+        CU_ASSERT_EQUAL(rt_band_get_file_size(band), 0);
+        CU_ASSERT_EQUAL(rt_band_get_file_timestamp(band), 0);
+
 	/* data */
 	CU_ASSERT(rt_band_get_data(band) != NULL);
 
@@ -118,6 +121,9 @@
 	/* ext path */
 	CU_ASSERT_STRING_EQUAL(rt_band_get_ext_path(band), path);
 
+        CU_ASSERT_EQUAL(rt_band_get_file_size(band), 13674);
+        CU_ASSERT_NOT_EQUAL(rt_band_get_file_timestamp(band), 0);
+
 	/* ext band number */
 	CU_ASSERT_EQUAL(rt_band_get_ext_band_num(band, &extband), ES_NONE);
 	CU_ASSERT_EQUAL(extband, 2);

Modified: trunk/raster/test/regress/load_outdb.sql
===================================================================
--- trunk/raster/test/regress/load_outdb.sql	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/test/regress/load_outdb.sql	2018-05-08 22:37:41 UTC (rev 16566)
@@ -1 +1,17 @@
 SELECT count(*) FROM raster_outdb_template;
+SELECT DISTINCT ST_BandFileSize(rast) FROM raster_outdb_template;
+SELECT DISTINCT ST_BandFileTimestamp(rast) FROM raster_outdb_template;
+SET postgis.enable_outdb_rasters = true;
+SELECT DISTINCT ST_BandFileSize(rast) FROM raster_outdb_template;
+SELECT DISTINCT ST_BandFileTimestamp(rast) != 0 FROM raster_outdb_template;
+
+-- error cases
+SELECT ST_BandFileSize(''::raster);
+SELECT ST_BandFileTimestamp(''::raster);
+SELECT ST_BandFileSize(rast,-1) FROM raster_outdb_template WHERE rid = 1;
+SELECT ST_BandFileTimestamp(rast,-1) FROM raster_outdb_template WHERE rid = 1;
+SELECT ST_BandFileSize(rast,10) FROM raster_outdb_template WHERE rid = 1;
+SELECT ST_BandFileTimestamp(rast,10) FROM raster_outdb_template WHERE rid = 1;
+-- valid raster, but file does not exist
+SELECT ST_BandFileSize('0100000100000000000000F03F000000000000F0BF0000000000000000000000000000000000000000000000000000000000000000000000005A003200840000DEADBEEF00'::raster);
+SELECT ST_BandFileTimestamp('0100000100000000000000F03F000000000000F0BF0000000000000000000000000000000000000000000000000000000000000000000000005A003200840000DEADBEEF00'::raster);

Modified: trunk/raster/test/regress/load_outdb_expected
===================================================================
--- trunk/raster/test/regress/load_outdb_expected	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/test/regress/load_outdb_expected	2018-05-08 22:37:41 UTC (rev 16566)
@@ -1 +1,15 @@
 4
+ERROR:  rt_band_get_file_size: Access to offline bands disabled
+ERROR:  rt_band_get_file_timestamp: Access to offline bands disabled
+NOTICE:  Band of index 1 is not out-db.
+13674
+NOTICE:  Band of index 1 is not out-db.
+t
+ERROR:  rt_raster_from_wkb: wkb size (0)  < min size (61) at character 24
+ERROR:  rt_raster_from_wkb: wkb size (0)  < min size (61) at character 29
+NOTICE:  Invalid band index (must use 1-based). Returning NULL
+NOTICE:  Invalid band index (must use 1-based). Returning NULL
+NOTICE:  Could not find raster band of index 10 when getting band path. Returning NULL
+NOTICE:  Could not find raster band of index 10 when getting band path. Returning NULL
+ERROR:  rt_band_get_file_size: Cannot access file
+ERROR:  rt_band_get_file_timestamp: Cannot access file

Modified: trunk/raster/test/regress/rt_addband_expected
===================================================================
--- trunk/raster/test/regress/rt_addband_expected	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/test/regress/rt_addband_expected	2018-05-08 22:37:41 UTC (rev 16566)
@@ -90,23 +90,23 @@
 NOTICE:  RASTER_copyBand: Could not add band to raster. Returning original raster.
 1234.5678
 1234.567|255
-1|4BUI|0|f||
-2|8BUI|0|f||
-3|16BUI|0|f||
-4|32BUI|0|f||
-5|64BF|0|f||
-1|2BUI|0|f||
-2|4BUI|0|f||
-3|8BUI|0|f||
-4|16BUI|0|f||
-5|32BUI|0|f||
-6|64BF|0|f||
-1|4BUI|0|f||
-2|8BUI|0|f||
-3|16BUI|0|f||
-4|32BUI|0|f||
-5|64BF|0|f||
-6|2BUI|0|f||
+1|4BUI|0|f||||
+2|8BUI|0|f||||
+3|16BUI|0|f||||
+4|32BUI|0|f||||
+5|64BF|0|f||||
+1|2BUI|0|f||||
+2|4BUI|0|f||||
+3|8BUI|0|f||||
+4|16BUI|0|f||||
+5|32BUI|0|f||||
+6|64BF|0|f||||
+1|4BUI|0|f||||
+2|8BUI|0|f||||
+3|16BUI|0|f||||
+4|32BUI|0|f||||
+5|64BF|0|f||||
+6|2BUI|0|f||||
 90
 1|1|t|t
 1|2|t|t

Modified: trunk/raster/test/regress/rt_mapalgebra_expected
===================================================================
--- trunk/raster/test/regress/rt_mapalgebra_expected	2018-05-08 21:09:54 UTC (rev 16565)
+++ trunk/raster/test/regress/rt_mapalgebra_expected	2018-05-08 22:37:41 UTC (rev 16566)
@@ -84,8 +84,8 @@
 NOTICE:  value = {{{200,200,NULL},{200,200,NULL},{NULL,NULL,NULL}}}
 NOTICE:  pos = [0:1][1:2]={{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-3|(0,0,0,0,1,-1,0,0,0,0)|(,,,,)|
-4|(1,-1,2,2,1,-1,0,0,0,1)|(8BUI,0,f,,)|255
+3|(0,0,0,0,1,-1,0,0,0,0)|(,,,,,,)|
+4|(1,-1,2,2,1,-1,0,0,0,1)|(8BUI,0,f,,,,)|255
 NOTICE:  value = {{{NULL,NULL,NULL},{NULL,1,1},{NULL,1,1}}}
 NOTICE:  pos = [0:1][1:2]={{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -98,7 +98,7 @@
 NOTICE:  value = {{{1,1,2},{1,1,2},{10,10,20}}}
 NOTICE:  pos = [0:1][1:2]={{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-NOTICE:  record = (10,"(0,0,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,)",255)
+NOTICE:  record = (10,"(0,0,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,,,)",255)
 NOTICE:  value = {{{1,2,2},{10,20,20},{10,20,20}}}
 NOTICE:  pos = [0:1][1:2]={{1,1},{3,3}}
 NOTICE:  userargs = <NULL>
@@ -111,7 +111,7 @@
 NOTICE:  value = {{{20,20,30},{20,20,30},{200,200,300}}}
 NOTICE:  pos = [0:1][1:2]={{2,2},{4,4}}
 NOTICE:  userargs = <NULL>
-NOTICE:  record = (14,"(2,-2,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,)",255)
+NOTICE:  record = (14,"(2,-2,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,,,)",255)
 NOTICE:  value = {{{10,20,20},{100,200,200},{100,200,200}}}
 NOTICE:  pos = [0:1][1:2]={{1,1},{3,3}}
 NOTICE:  userargs = {1000}
@@ -124,17 +124,17 @@
 NOTICE:  value = {{{200,200,300},{200,200,300},{NULL,NULL,NULL}}}
 NOTICE:  pos = [0:1][1:2]={{2,2},{4,4}}
 NOTICE:  userargs = {1000}
-NOTICE:  record = (17,"(2,-4,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,)",1000)
+NOTICE:  record = (17,"(2,-4,2,2,1,-1,0,0,0,1)","(32BUI,0,f,,,,)",1000)
 NOTICE:  value = {{{1}},{{2}}}
 NOTICE:  pos = [0:2][1:2]={{1,1},{2,2},{1,1}}
 NOTICE:  userargs = <NULL>
-20|21|(1,-1,1,1,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|(1,-1,1,1,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  Raster provided has no bands
-20|22|(0,0,0,0,0,0,0,0,0,0)|(,,,,)
+20|22|(0,0,0,0,0,0,0,0,0,0)|(,,,,,,)
 NOTICE:  value = {{{2}},{{3}}}
 NOTICE:  pos = [0:2][1:2]={{1,1},{1,2},{2,1}}
 NOTICE:  userargs = <NULL>
-21|22|(1,-2,1,1,1,-1,0,0,0,1)|(16BUI,0,f,,)
+21|22|(1,-2,1,1,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{1}},{{NULL}}}
 NOTICE:  pos = [0:2][1:2]={{1,1},{1,1},{0,0}}
 NOTICE:  userargs = <NULL>
@@ -162,7 +162,7 @@
 NOTICE:  value = {{{NULL}},{{2}}}
 NOTICE:  pos = [0:2][1:2]={{3,3},{3,3},{2,2}}
 NOTICE:  userargs = <NULL>
-20|21|(0,0,3,3,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|(0,0,3,3,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{1}},{{NULL}}}
 NOTICE:  pos = [0:2][1:2]={{1,1},{1,1},{1,-1}}
 NOTICE:  userargs = <NULL>
@@ -187,7 +187,7 @@
 NOTICE:  value = {{{NULL}},{{3}}}
 NOTICE:  pos = [0:2][1:2]={{2,4},{2,4},{2,2}}
 NOTICE:  userargs = <NULL>
-20|22|(0,0,2,4,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|22|(0,0,2,4,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{1}},{{NULL}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{0,0},{1,-1}}
 NOTICE:  userargs = <NULL>
@@ -224,7 +224,7 @@
 NOTICE:  value = {{{NULL}},{{NULL}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{3,4},{3,4},{2,3},{3,2}}
 NOTICE:  userargs = <NULL>
-20|21|22|(0,0,3,4,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|22|(0,0,3,4,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{1}},{{NULL}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{0,0},{1,-1}}
 NOTICE:  userargs = <NULL>
@@ -237,7 +237,7 @@
 NOTICE:  value = {{{1}},{{2}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{2,2},{1,1},{2,0}}
 NOTICE:  userargs = <NULL>
-20|21|22|(0,0,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|22|(0,0,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{1}},{{2}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{2,2},{1,1},{2,0}}
 NOTICE:  userargs = <NULL>
@@ -250,7 +250,7 @@
 NOTICE:  value = {{{NULL}},{{2}},{{NULL}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{3,3},{2,2},{3,1}}
 NOTICE:  userargs = <NULL>
-20|21|22|(1,-1,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|22|(1,-1,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{NULL}},{{NULL}},{{3}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,3},{0,2},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -263,9 +263,9 @@
 NOTICE:  value = {{{NULL}},{{NULL}},{{3}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{2,4},{1,3},{2,2}}
 NOTICE:  userargs = <NULL>
-20|21|22|(0,-2,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,)
+20|21|22|(0,-2,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  Raster provided has no bands
-20|21|22|(0,0,0,0,0,0,0,0,0,0)|(,,,,)
+20|21|22|(0,0,0,0,0,0,0,0,0,0)|(,,,,,,)
 NOTICE:  value = {{{1}},{{10}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -278,7 +278,7 @@
 NOTICE:  value = {{{1}},{{10}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{2,2},{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-30|(0,0,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,)
+30|(0,0,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{100}},{{1}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -291,7 +291,7 @@
 NOTICE:  value = {{{100}},{{1}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{2,2},{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-30|(0,0,2,2,1,-1,0,0,0,1)|(32BUI,0,f,,)
+30|(0,0,2,2,1,-1,0,0,0,1)|(32BUI,0,f,,,,)
 NOTICE:  value = {{{20}},{{20}}}
 NOTICE:  pos = [0:2][1:2]={{1,1},{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -304,7 +304,7 @@
 NOTICE:  value = {{{20}},{{20}}}
 NOTICE:  pos = [0:2][1:2]={{2,2},{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-31|(0,1,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,)
+31|(0,1,2,2,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{10}},{{2}},{{20}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{1,2},{1,2}}
 NOTICE:  userargs = <NULL>
@@ -311,7 +311,7 @@
 NOTICE:  value = {{{10}},{{2}},{{20}}}
 NOTICE:  pos = [0:3][1:2]={{2,1},{2,1},{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-30|31|(0,0,2,1,1,-1,0,0,0,1)|(16BUI,0,f,,)
+30|31|(0,0,2,1,1,-1,0,0,0,1)|(16BUI,0,f,,,,)
 NOTICE:  value = {{{100}},{{1}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{1,1},{1,1},{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -324,7 +324,7 @@
 NOTICE:  value = {{{100}},{{1}},{{100}}}
 NOTICE:  pos = [0:3][1:2]={{2,2},{2,2},{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-30|(0,0,2,2,1,-1,0,0,0,1)|(32BUI,0,f,,)
+30|(0,0,2,2,1,-1,0,0,0,1)|(32BUI,0,f,,,,)
 NOTICE:  value = {{{10}}}
 NOTICE:  pos = [0:1][1:2]={{1,1},{1,1}}
 NOTICE:  userargs = <NULL>
@@ -337,7 +337,7 @@
 NOTICE:  value = {{{10}}}
 NOTICE:  pos = [0:1][1:2]={{2,2},{2,2}}
 NOTICE:  userargs = <NULL>
-30|(0,0,2,2,1,-1,0,0,0,1)|(8BUI,0,f,,)
+30|(0,0,2,2,1,-1,0,0,0,1)|(8BUI,0,f,,,,)
 NOTICE:  value = {{{1}}}
 NOTICE:  pos = [0:1][1:2]={{1,1},{1,1}}
 NOTICE:  userargs = {}



More information about the postgis-tickets mailing list