<div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm basically trying to compute # of pixels of land cover type by polygon, for lots of polygons. <br></div><div><br></div><div>I'm working with a query a query like this:<br></div><div></div><div>SELECT  bbl, (pvc).VALUE, SUM((pvc).COUNT) AS tot_pix<br> FROM base_rasters.landcover6in<br>  INNER join  results_scratch.polys_test<br>  ON ST_Intersects(landcover6in.rast, polys_test.geom_2263), <br>    ST_ValueCount(ST_Clip(landcover6in.rast,polys_test.geom_2263),1) AS pvc<br>  GROUP BY (pvc).VALUE, bbl<br> ORDER BY (pvc).VALUE;</div><div><br></div><div>For smaller polygons, spot-checking, it looks like I'm generally getting the right results. However, for larger polygons, not always. For example, though a polygon might not have roads, I'm getting non-0 counts for road pixels within a polygon (polygons have unique identifiers as 'bbl').  The total area of pixels counted ends up being larger than the polygon (larger than would be attributable to differences between polygons edges & pixels)<br></div><div><br></div><div>I'm thinking it's an issue when there are multiple raster tiles included... but not entirely sure. Any suggestions on whether there's something off in this query that might be causing an issue like I describe?</div><div><br></div><div>Thanks in advance for any suggestions!</div><div>Mike<br></div></div>