<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks again Remi and Pierre<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">indeed with the following query:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">SELECT ST_Transform(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">           ST_Buffer (<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                ST_Union(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                    ST_Buffer(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                        ST_Transform(geom, 27572),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                        4<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                    )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                ),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                -3.0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">            ),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">            4326<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">as geom FROM points
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">we get something more like what we were expecting. we experimented with the endcap but the speed / complexity of features is not really a prob
 for our application. we have the transforms in there to allow the data to stay in degrees but the shrinkedness of the query to be parameterised in metres.
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">(e.g. +4, -3)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">cheers and bonsoir,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-i<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org]
<b>De la part de</b> Rémi Cura<br>
<b>Envoyé :</b> Tuesday, 14 January 2014 16:51<br>
<b>À :</b> PostGIS Users Discussion<br>
<b>Objet :</b> Re: [postgis-users] ST_ConcaveHull giving up too soon, aka too convex<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hope it works =)<br>
<br>
Don't forget to use text paramter of buffers to reduce the number of segpoints (faster, more coherent with your data)<br>
Try either 'endcap=square'<br>
or quadseg = 1 (I can't test here)<br>
Cheers,<br>
<br>
Rémi-C<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2014/1/14 Pierre Racine <<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a>><o:p></o:p></p>
<p class="MsoNormal">Try this:<br>
<br>
SELECT ST_Buffer(ST_Union(ST_Buffer(geom, 0.0001)), -0.00008) FROM points<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
> -----Original Message-----<br>
> From: <a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:postgis-users-">postgis-users-</a><br>
> <a href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a>] On Behalf Of Ivan Price<br>
> Sent: Tuesday, January 14, 2014 8:36 AM<br>
> To: PostGIS Users Discussion<br>
> Subject: Re: [postgis-users] ST_ConcaveHull giving up too soon, aka too<br>
> convex<br>
><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">> Thanks for your reply Remi,<br>
><br>
><br>
><br>
> for now we are going with simply a union of a buffer of the points (as you<br>
> suggested) as it makes sense in the context of the origin of the data<br>
> anyway.<br>
><br>
><br>
><br>
> cheers<br>
><br>
><br>
><br>
> -i<br>
><br>
><br>
><br>
><br>
><br>
> De : <a href="mailto:postgis-users-bounces@lists.osgeo.org">postgis-users-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:postgis-users-">postgis-users-</a><br>
> <a href="mailto:bounces@lists.osgeo.org">bounces@lists.osgeo.org</a>] De la part de Rémi Cura<br>
> Envoyé : Tuesday, 14 January 2014 11:39<br>
> À : PostGIS Users Discussion<br>
> Objet : Re: [postgis-users] ST_ConcaveHull giving up too soon, aka too<br>
> convex<br>
><br>
><br>
><br>
> Hey,<br>
><br>
> sadly I can't answer your questions,<br>
><br>
> but it looks like you don't want concave hull but instead Alpha Shape (see<br>
> SFCGAL , maybe they have integrated it).<br>
><br>
><br>
> You have still a lot of workaround :<br>
> if you don't mind expending the bouyndary, a union of buffers of points<br>
> if you don't mind quantization (anyway your input looks quantized) :<br>
> convert to raster, then any classical image processing easily available<br>
> (watershed for example) (you can use out of the box QGIS 2.0 raster<br>
> processing tools)<br>
> if you want a sharp boudary : and assuming your points are regularly<br>
> spaced : maybe something liek this (untested)<br>
> create a segment for each point to his K nearest neighbours (K would be 2<br>
> or 3, and you would put a max distance before drawing a line)<br>
><br>
> Then pick the segments that have no  intersection with other segments, and<br>
> either use ST_Polygonyze, or cut the bounding box polygon with the<br>
> segments and remove the part outside<br>
> .<br>
><br>
> Maybe you can try to reduce your point precision for processing (snap to<br>
> grid) and/or put the points in an appropriate srid (not too much digits)<br>
><br>
><br>
><br>
> Cheers,<br>
><br>
> Rémi-C<br>
><br>
><br>
><br>
> 2014/1/14 Ivan Price <<a href="mailto:Ivan.Price@noveltis.fr">Ivan.Price@noveltis.fr</a>><br>
><br>
><br>
><br>
> Hi there,<br>
><br>
><br>
><br>
> I am experimenting with ST_ConcaveHull, am using Postgres 9.2.2 on<br>
> windows with postgis 2.1.1 r12113<br>
><br>
><br>
><br>
> i have a table of 218 points forming roughly an arc (something like the nike<br>
> swoosh)<br>
><br>
><br>
><br>
> when i ask for the concave hull i'm expecting a poly shrink-wrapped to<br>
> them, however this is not the case, even when i set a very low percentage<br>
> area parameter. for example:<br>
><br>
><br>
><br>
> SELECT ST_ConcaveHull(ST_Collect(geom), 0.000001) as geom FROM<br>
> points;<br>
><br>
><br>
><br>
> i attach a screenshot of the points and the convext hull, as well as an sql<br>
> dump of the points themselves.<br>
><br>
><br>
><br>
> also as a side note, in researching the problem i upgraded from postgis 2.01<br>
> to 2.1.1 and noticed a change in the processing time for the above<br>
> statement from 1 minute to ~ 5 minutes.<br>
><br>
><br>
><br>
> are there any pointers for making ConcaveHull more 'aggressive' ?<br>
><br>
><br>
><br>
> thanks and regards<br>
><br>
><br>
><br>
> -i<br>
><br>
><br>
><br>
><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>
><br>
><br>
<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><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>