[postgis-devel] Ticket #1363 ST_AddBand(raster, raster[], integer)

Bborie Park bkpark at ucdavis.edu
Fri Jul 27 13:50:54 PDT 2012


Regina,

I'd like to pick your brain about this function before I write it in C
as I can't say I'm happy with the purpose of it.  Before you chew my
head off, please hear me out...

Looking at the code for that function, if the raster to which bands are
being added is NULL, ST_Band() is used on the first "from" raster and
following "from" rasters use ST_AddBand.  I also wonder what the memory
implications are for an array of rasters?  Is it consuming memory or are
they just datum pointers?

So, I'm wondering if it wouldn't be better to turn ST_Band into an
aggregate function and then run ST_AddBand upon the ST_Band output.
Something like...

SELECT ST_AddBand(
	torast, (
		SELECT ST_Band(fromrast, 1)
		FROM fromtable
	)
)
FROM totable

Your example in the docs would just be the ST_Band in the call above.

Thoughts?

-bborie

-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu



More information about the postgis-devel mailing list