[postgis-users] Pixel value/geom

Joan wamaithajoan at gmail.com
Tue Feb 28 10:41:00 PST 2012


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.Racine at 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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120228/eb4df777/attachment.html>


More information about the postgis-users mailing list