<div dir="ltr">ST_Intersection(rast, geom) does vectorize the raster before intersecting with the polygon. ST_Clip(rast, geom) rasterizes the polygon before intersecting with the raster.<div><br></div><div>Can you provide more information? Such as the query and the version of PostGIS?</div><div><br></div><div>-bborie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 5, 2015 at 2:05 PM, Jean Marchal <span dir="ltr"><<a href="mailto:jean.d.marchal@gmail.com" target="_blank">jean.d.marchal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi list,<br></div><div><br>I am trying to return all the pixels in a raster that intersect (not just touch) an extent (say a rectangle). I tried ST_Clip and ST_Intersection(raster, geom) but they don't return all the pixels that intersect my extent polygon. Do I have to vectorize the raster first using ST_PixelAsPolygons or there is a better / more efficient way to proceed? <br><br></div><div>Ultimately the goal is to fetch the resulting raster in R.<br><br></div><div>Thanks,<br></div><div><br>Jean<br></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>