[postgis-users] ST_ConcaveHull giving up too soon, aka too convex

Rémi Cura remi.cura at gmail.com
Tue Jan 14 02:38:34 PST 2014


Hey,
sadly I can't answer your questions,
but it looks like you don't want concave hull but instead Alpha Shape (see
SFCGAL , maybe they have integrated it).

You have still a lot of workaround :
if you don't mind expending the bouyndary, a union of buffers of points
if you don't mind quantization (anyway your input looks quantized) :
convert to raster, then any classical image processing easily available
(watershed for example) (you can use out of the box QGIS 2.0 raster
processing tools)
if you want a sharp boudary : and assuming your points are regularly spaced
: maybe something liek this (untested)
create a segment for each point to his K nearest neighbours (K would be 2
or 3, and you would put a max distance before drawing a line)
Then pick the segments that have no  intersection with other segments, and
either use ST_Polygonyze, or cut the bounding box polygon with the segments
and remove the part outside
.
Maybe you can try to reduce your point precision for processing (snap to
grid) and/or put the points in an appropriate srid (not too much digits)

Cheers,

Rémi-C


2014/1/14 Ivan Price <Ivan.Price at noveltis.fr>

>
>
> Hi there,
>
>
>
> I am experimenting with ST_ConcaveHull, am using Postgres 9.2.2 on windows
> with postgis 2.1.1 r12113
>
>
>
> i have a table of 218 points forming roughly an arc (something like the
> nike swoosh)
>
>
>
> when i ask for the concave hull i'm expecting a poly shrink-wrapped to
> them, however this is not the case, even when i set a very low percentage
> area parameter. for example:
>
>
>
> SELECT ST_ConcaveHull(ST_Collect(geom), 0.000001) as geom FROM points;
>
>
>
> i attach a screenshot of the points and the convext hull, as well as an
> sql dump of the points themselves.
>
>
>
> also as a side note, in researching the problem i upgraded from postgis
> 2.01 to 2.1.1 and noticed a change in the processing time for the above
> statement from 1 minute to ~ 5 minutes.
>
>
>
> are there any pointers for making ConcaveHull more 'aggressive' ?
>
>
>
> thanks and regards
>
>
>
> -i
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140114/1710001a/attachment.html>


More information about the postgis-users mailing list