[postgis-users] ST_Clip

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Aug 17 08:00:08 PDT 2015


I guess the band argument comes before the geom argument in ST_Clip(). You can pass an array for the bands you require.

Pierre

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of David Haynes
> Sent: Wednesday, July 22, 2015 4:40 PM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] ST_Clip
> 
> Hello
> 
> I believe I am in appropriately using the ST_Clip function on a multiband
> raster. I have a raster with 13 bands and I want to retrieve from the clip
> bands # 1,3
> 
> How do I do that?
> 
> I tried using:
> array[1,3] as bnd
> 
> Didn't work still returns 13 bands.
> 
> with bnd_num as
> (
> select array[1,3] as bnd
> )
> select p.geoid, p.label, ST_Numbands(ST_CLIP(r.rast,p.geom,b.bnd, True))
> from bnd_num b, polygon p inner join modis_igbp_stack r on
> ST_Intersects(r.rast, p.geom);


More information about the postgis-users mailing list