<div dir="ltr">Hi all,<div><br></div><div>I'm looking for get all pixel's value in a raster insert thanks to raster2pgsql intersect by a polygon. </div><div>Nevertheless, there are some things that I don't understand: depends on tile size, I don't have the same result... The error between 2 raster is also correlate to the pixel size (I assume it's due to the pixel number).</div><div><br></div><div>Can you explain me how the tile size can influence the final result ?</div><div><br></div><div><b>Here is the query :</b></div><div><div>SELECT DISTINCT SUM((px).val)</div><div>FROM(</div><div>  SELECT *</div><div>  FROM  mns INNER JOIN  st_setsrid(st_geomfromgeojson('{"type":"Polygon","coordinates":[[[x,y],<span style="line-height:1.5">[x,y]</span><span style="line-height:1.5">,</span>[x,y] <span style="line-height:1.5">]]}'), 4326) as geom on ST_Intersects(mns.rast, geom)</span></div><div><span style="line-height:1.5">) AS clip, ST_PixelAsCentroids (ST_Clip(clip.rast, clip.geom),1) AS px;</span><br></div></div><div><br></div><div><b>DSM px size 70cm: </b></div><div>raster2pgsql -a -t 250x250 -s 4326 -F pathToDSM.tiff dsmTable (result: 46 347 846)<br></div><div><span style="line-height:1.5">raster2pgsql -a -t 50x50 -s 4326 -F pathToDSM.tiff dsmTable    : </span><span style="line-height:1.5">46 382 873</span></div><div>Difference: <span style="line-height:1.5">35027</span></div><div><span style="line-height:1.5"><br></span></div><div><b>DSM px size 20cm : </b></div><div>raster2pgsql -a -t 250x250 -s 4326 -F pathToDSM.tiff dsmTable :  567 505 888 <br></div><div><span style="line-height:1.5">raster2pgsql -a -t 50x50 -s 4326 -F pathToDSM.tiff dsmTable    : </span>596 897 610</div><div>Difference: 29 391 722 </div><div>   <br></div><div>If we considere 250x250's result as reference, there is a difference of 0.07% in the first case, and 5% in the second. If the polygon area increases, the error rate increases.</div><div><br></div><div>Thank you,</div><div><br></div><div>Pierre</div><div><div class="GmSign"><div dir="ltr"><div><div><div dir="ltr"><div dir="ltr"><div dir="ltr" style="font-size:12.8px"></div></div></div></div></div></div></div></div></div>