<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Dear List,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am dabbling with some Landsat-8 imagery in PostGIS, using raster functionality. I am primarily interested in deriving polygon-delineated extracts from the various spectral bands (e.g. for a forest patch, an agricultural field, etc).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Landsat-8 provides the so-called BQA band (see <a href="http://landsat.usgs.gov/L8QualityAssessmentBand.php">http://landsat.usgs.gov/L8QualityAssessmentBand.php</a>) which is a bit-coded set of quality parameters, for which the cloud and haze indicators (bits 12-15 (right to left)) are the most important (for me). I would want to mask out all pixels, in the spectral band(s), for which these bits are set in the BQA band.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Did anyone come across a solution that would address this kind of masking operation? The only reference I seem to be able to find is the statement that “no masks (you can create a mask as a band)” in the WKTRaster wiki page on osgeo, which is somewhat cryptic. I would know how to do this outside the database (using JAI), but it seems that masking is some core operation one would expect in raster functionality.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As a side issue, would it be possible (is it foreseen?) to create raster operators that work in an equivalent arithmetic way as on single variable (i.e. 2*rast, rast ~ 128, rast < 3) but produce rast as output (maybe through a mapping to ST_MapAlgebra functions)?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any pointers welcome and excuses if I have overlooked discussions on this topic. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Guido Lemoine<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Scientific Officer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>European Commission, Joint Research Centre (JRC)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Institute for the Protection and Security of the Citizen (IPSC)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Global Security and Crisis Management Unit<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal><span lang=NL style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Via E.Fermi 2749, I-21027 Ispra (VA) Italy, TP 268<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>Tel. +39 0332 786239 (direct line) Fax +39 0332 785154<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>e-mail: <a href="mailto:guido.lemoine@jrc.ec.europa.eu"><span style='color:blue'>guido.lemoine@jrc.ec.europa.eu</span></a> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black;mso-fareast-language:EN-GB'>web: <a href="http://globesec.jrc.ec.europa.eu/"><span style='color:blue'>http://globesec.jrc.ec.europa.eu</span></a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D;mso-fareast-language:EN-GB'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>