Thank you Pierre, it works as I would like. I would like to use the pixel values in calculations. <div><br></div><div>I did not find ST_Clip in the manual.<div><br></div><div>Joan<br><br><div class="gmail_quote">On 28 February 2012 19:16, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> I would like to get the pixel value and geometry without having to group the<br>
> pixels with the same value together as ST_DumpAsPolygons does.<br>
><br>
> I my goal is to get pixel values whose center is within a polygon.<br>
<br>
</div>SELECT (ST_PixelAsPolygons(ST_Clip(rast, yourpolygon))).val<br>
FROM yourrastertable, yourpolygontable<br>
WHERE ST_Intersects(rast, yourpolygon)<br>
<br>
but normally you want to compute some sort of statistic with all those values. In this case you use ST_SummaryStats() instead of PixelAsPolygons().<br>
<br>
Pierre<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br></div></div>