Thank you Pierre, it works as I would like. I would like to use the pixel
values in calculations.

I did not find ST_Clip in the manual.

Joan

On 28 February 2012 19:16, Pierre Racine <pierre.rac...@sbf.ulaval.ca>wrote:

> > I would like to get the pixel value and geometry without having to group
> the
> > pixels with the same value together as ST_DumpAsPolygons does.
> >
> > I my goal is to get pixel values whose center is within a polygon.
>
> SELECT (ST_PixelAsPolygons(ST_Clip(rast, yourpolygon))).val
> FROM yourrastertable, yourpolygontable
> WHERE ST_Intersects(rast, yourpolygon)
>
> but normally you want to compute some sort of statistic with all those
> values. In this case you use ST_SummaryStats() instead of PixelAsPolygons().
>
> Pierre
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to