]> granicus.if.org Git - postgis/commitdiff
Subtract size of offdb raster paths in test for ST_MemSize
authorSandro Santilli <strk@keybit.net>
Mon, 23 Jun 2014 07:37:53 +0000 (07:37 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 23 Jun 2014 07:37:53 +0000 (07:37 +0000)
Doing so should make the resulting size equal on all systems,
fixing the travis builds:
https://travis-ci.org/postgis/postgis#L2373-L2380

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

raster/test/regress/rt_utility.sql
raster/test/regress/rt_utility_expected

index d8dee3da5150bb56f7ed9c9c49f725518f4460ec..8ce2434c48445cac5114fcf4710acaf2b0c66cc5 100644 (file)
@@ -439,7 +439,20 @@ ORDER BY rid;
 -----------------------------------------------------------------------
 
 SELECT 'ms1', ST_MemSize(ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0));
-SELECT 'ms2', ST_MemSize(rast) from raster_outdb_template order by rid;
+WITH
+mem AS (
+  SELECT rid, ST_MemSize(rast) as size from raster_outdb_template
+),
+path AS (
+  SELECT rid, sum(length(st_bandpath(rast,n))) as len,
+    array_agg(st_bandpath(rast,n)) as agg
+  FROM raster_outdb_template, generate_series(1,ST_NumBands(rast)) n
+  GROUP BY rid
+)
+SELECT 'ms2', mem.rid, mem.size - path.len
+  from mem, path
+  where mem.rid = path.rid
+  order by mem.rid;
 
 -----------------------------------------------------------------------
 -- st_bandpath()
index 771ec378cd2f38bf148cca4ef7a60c703ecd404e..95d31e4e650c9dfc8e63226db58bebaf9cc7e6e9 100644 (file)
@@ -52,10 +52,10 @@ Skewed raster of 10x10 pixels has 1 band and extent of BOX(0 -10,10 0.0001)
     band 1 of pixtype 8BUI is out-db with NODATA value of 255
     band 2 of pixtype 8BUI is in-db with NODATA value of 0
 ms1|64
-ms2|280
-ms2|280
-ms2|8240
-ms2|8240
+ms2|1|82
+ms2|2|82
+ms2|3|8174
+ms2|4|8174
 NOTICE:  Could not find raster band of index 1 when getting band path. Returning NULL
 bandpath1|
 bandpath2|testraster.tif