<div dir="ltr"><span style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">Hi,</span><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">Thank you for the tips. </div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">Well, I don't know why, but the st_clip function doesn't seem work fine. </div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">After clipping and dumping each pixel as point, some points follow tiles, others follow the geometry. Any idea why ?</div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">For now, to avoid the problem, I apply a St_ContainsProperly after the dump.</div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></div><div style="font-size:13px;color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><img src="cid:15607a8323c4dc67b7b1" alt="unnamed.png" class="" style="max-width: 100%; opacity: 1;"><br></div><div><div dir="ltr" style="color:rgb(117,117,117);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><div style="color:rgb(33,33,33)"><div>Red : geometry</div><div>Light blue : tiles</div><div>Dark blue : pixels as points</div></div><br></div>Thank you for your help !</div><div><br></div>Pierre<br><div class="gmail_quote"><div class="GmSign"><br><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><br></div><div dir="ltr">Le ven. 15 juil. 2016 à 17:28, Pierre Racine <<a href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry for the late answer.<br>
<br>
You have to vectorize them on the fly from within OpenJump:<br>
<br>
SELECT (ST_DumpAsPolygons(rast).* FROM yourrastertable;<br>
<br>
If your raster is very big and tiled, just vectorize the tiles you need:<br>
<br>
SELECT rid, rast::geometry FROM yourrastertable;<br>
<br>
Look at the rids and then:<br>
<br>
SELECT (ST_DumpAsPolygons(rast).* FROM yourrastertable<br>
WHERE rid = x or rid = y<br>
<br>
Pierre<br>
<br>
> -----Original Message-----<br>
> From: postgis-users [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>] On Behalf<br>
> Of Pierre Bails<br>
> Sent: Friday, June 24, 2016 12:32 PM<br>
> To: PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br>
> Subject: Re: [postgis-users] Raster tile size impact results<br>
><br>
> Hello,<br>
><br>
> Unfortunatly, I don't find a way to print raster results in OpenJump. Can you<br>
> explain me how I can do it ?<br>
><br>
> Thank you for your help !<br>
><br>
> Pierre<br>
><br>
> Le lun. 20 juin 2016 à 16:16, Pierre Racine <<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a><br>
> <mailto:<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a>> > a écrit :<br>
><br>
><br>
>       I would try to understand, visually using OpenJump, how your tiles are<br>
> clipped in the two cases... I guess sometimes 1 pixel wide tiles get clipped in a<br>
> strange way.<br>
><br>
>       Pierre<br>
><br>
>       > -----Original Message-----<br>
>       > From: postgis-users [mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a><br>
> <mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>> ] On Behalf<br>
>       > Of Pierre Bails<br>
>       > Sent: Wednesday, June 15, 2016 11:41 AM<br>
>       > To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a> <mailto:<a href="mailto:postgis-" target="_blank">postgis-</a><br>
> <a href="mailto:users@lists.osgeo.org" target="_blank">users@lists.osgeo.org</a>><br>
>       > Subject: [postgis-users] Raster tile size impact results<br>
>       ><br>
>       > Hi all,<br>
>       ><br>
>       > I'm looking for get all pixel's value in a raster insert thanks to<br>
> raster2pgsql<br>
>       > intersect by a polygon.<br>
>       > Nevertheless, there are some things that I don't understand: depends<br>
> on tile<br>
>       > size, I don't have the same result... The error between 2 raster is also<br>
> correlate<br>
>       > to the pixel size (I assume it's due to the pixel number).<br>
>       ><br>
>       > Can you explain me how the tile size can influence the final result ?<br>
>       ><br>
>       > Here is the query :<br>
>       > SELECT DISTINCT SUM((px).val)<br>
>       > FROM(<br>
>       >   SELECT *<br>
>       >   FROM  mns INNER JOIN<br>
>       ><br>
> st_setsrid(st_geomfromgeojson('{"type":"Polygon","coordinates":[[[x,y],[x,y],[x<br>
>       > ,y] ]]}'), 4326) as geom on ST_Intersects(mns.rast, geom)<br>
>       > ) AS clip, ST_PixelAsCentroids (ST_Clip(clip.rast, clip.geom),1) AS px;<br>
>       ><br>
>       ><br>
>       > DSM px size 70cm:<br>
>       > raster2pgsql -a -t 250x250 -s 4326 -F pathToDSM.tiff dsmTable (result:<br>
> 46 347<br>
>       > 846)<br>
>       ><br>
>       > raster2pgsql -a -t 50x50 -s 4326 -F pathToDSM.tiff dsmTable    : 46 382<br>
> 873<br>
>       > Difference: 35027<br>
>       ><br>
>       ><br>
>       > DSM px size 20cm :<br>
>       > raster2pgsql -a -t 250x250 -s 4326 -F pathToDSM.tiff dsmTable :  567<br>
> 505 888<br>
>       ><br>
>       > raster2pgsql -a -t 50x50 -s 4326 -F pathToDSM.tiff dsmTable    : 596<br>
> 897 610<br>
>       > Difference: 29 391 722<br>
>       ><br>
>       ><br>
>       > If we considere 250x250's result as reference, there is a difference of<br>
> 0.07% in<br>
>       > the first case, and 5% in the second. If the polygon area increases, the<br>
> error rate<br>
>       > increases.<br>
>       ><br>
>       > Thank you,<br>
>       ><br>
>       > Pierre<br>
>       _______________________________________________<br>
>       postgis-users mailing list<br>
>       <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a> <mailto:<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>><br>
>       <a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div></div>