[postgis-users] Add bands to a raster

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Feb 13 07:01:14 PST 2013


That looks good. does it work?

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of SIG CEN L-R
> Sent: Monday, February 11, 2013 5:42 PM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] Add bands to a raster
> 
> Good evening,
> 
> I would like to apply what I red from Pierre Racine about the way to add a band
> to a raster from another one.
> http://geospatialelucubrations.blogspot.fr/2012/09/loading-many-rasters-into-
> separate.html?showComment=1346973298820#c4654958992264542142
> 
> I have 3 tables all tiled the same way.
> The first one "altitude", the second one "temp_min" and the third one
> "temp_max"
> 
> In order to facilitate analyses, I would like to add 2 bands to the raster "altitude"
> 
> I translate what I understood from Mr Racine like this, could someone tell me if I
> am wrong ?
> 
> UPDATE altitude SET rast=ST_AddBand(altitude.rast, min.rast)
> FROM temperature_min min
> WHERE ST_UpperLeftX(min.rast) = ST_UpperLeftX(altitude.rast)
> AND ST_UpperLeftY(min.rast) = ST_UpperLeftY(altitude.rast);
> 
> UPDATE altitude SET rast=ST_AddBand(altitude.rast, max.rast)
> FROM temperature_max max
> WHERE ST_UpperLeftX(max.rast) = ST_UpperLeftX(altitude.rast)
> AND ST_UpperLeftY(max.rast) = ST_UpperLeftY(altitude.rast);
> 
> Thanks a lot!
> 
> Mathieu Bossaert
> 
> --
> Mathieu BOSSAERT
> Responsable du système d'information <http://si.cenlr.org/>  du CEN L-R
> 04 67 29 90 65 - sig at cenlr.org
>  <http://sig.cenlr.org/_media/signature-courriel_mathieu.jpg>
> 
> ________________________________



More information about the postgis-users mailing list