<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Thanks for you previous help and quick responses. I'm only getting to look at your suggestions now, however I noticed in PostGIS 2.0 the ST_ConcaveHull() which is closer to our functionality needs so have started to try and work with this instead of the convexhull option. Maybe another to-do re aggregate operations of both these functions.<BR> <BR>Anyway I started my first test implementation from your suggestions in the following form:<BR> <BR>WITH ctsubgroup AS <BR> ( SELECT ST_ConcaveHull(ST_Force_2D(ST_Union(local_geom)), 0.9) As geom<BR> FROM lidar_099<BR> GROUP BY ST_SnapToGrid(local_geom, 10,10)<BR>)<BR>SELECT ST_AsEWKT(ST_ConcaveHull(ST_Union(geom), 0.9))<BR>FROM ctsubgroup;<BR> <BR>The table in question has 62 million popints and is a small one. The Query is still running after 6 hours but quite quickly it reported the following:<BR> <BR>**************PGADMIN MESSAGE - START**************<BR>NOTICE: geometry_gist_joinsel called with incorrect join type<br>CONTEXT: SQL statement "SELECT ST_Union(ARRAY(SELECT geom<br> FROM (<br> -- fuse near neighbors together<br> SELECT DISTINCT ON (i) i, ST_Distance(var_atempgeoms[i],var_atempgeoms[j]), ST_Buffer(ST_MakeLine(var_atempgeoms[i], var_atempgeoms[j]) , var_buf*5, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> INNER JOIN generate_series(1,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10)<br> )<br> UNION ALL<br> -- catch the ones with no near neighbors<br> SELECT i, 0, ST_Buffer(var_atempgeoms[i] , var_buf*10, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> LEFT JOIN generate_series(ceiling(array_upper(var_atempgeoms,1)/2)::integer,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10) <br> )<br> WHERE j IS NULL<br> ORDER BY 1, 2<br> ) As foo ) )"<br>PL/pgSQL function "st_concavehull" line 39 at assignment<br>NOTICE: geometry_gist_joinsel called with incorrect join type<br>CONTEXT: SQL statement "SELECT ST_Union(ARRAY(SELECT geom<br> FROM (<br> -- fuse near neighbors together<br> SELECT DISTINCT ON (i) i, ST_Distance(var_atempgeoms[i],var_atempgeoms[j]), ST_Buffer(ST_MakeLine(var_atempgeoms[i], var_atempgeoms[j]) , var_buf*5, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> INNER JOIN generate_series(1,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10)<br> )<br> UNION ALL<br> -- catch the ones with no near neighbors<br> SELECT i, 0, ST_Buffer(var_atempgeoms[i] , var_buf*10, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> LEFT JOIN generate_series(ceiling(array_upper(var_atempgeoms,1)/2)::integer,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10) <br> )<br> WHERE j IS NULL<br> ORDER BY 1, 2<br> ) As foo ) )"<br>PL/pgSQL function "st_concavehull" line 39 at assignment<br>NOTICE: geometry_gist_joinsel called with incorrect join type<br>CONTEXT: SQL statement "SELECT ST_Union(ARRAY(SELECT geom<br> FROM (<br> -- fuse near neighbors together<br> SELECT DISTINCT ON (i) i, ST_Distance(var_atempgeoms[i],var_atempgeoms[j]), ST_Buffer(ST_MakeLine(var_atempgeoms[i], var_atempgeoms[j]) , var_buf*5, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> INNER JOIN generate_series(1,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10)<br> )<br> UNION ALL<br> -- catch the ones with no near neighbors<br> SELECT i, 0, ST_Buffer(var_atempgeoms[i] , var_buf*10, 'quad_segs=3') As geom<br> FROM generate_series(1,array_upper(var_atempgeoms, 1)) As i<br> LEFT JOIN generate_series(ceiling(array_upper(var_atempgeoms,1)/2)::integer,array_upper(var_atempgeoms, 1)) As j <br> ON (<br> NOT ST_Intersects(var_atempgeoms[i],var_atempgeoms[j])<br> AND ST_DWithin(var_atempgeoms[i],var_atempgeoms[j], var_buf*10) <br> )<br> WHERE j IS NULL<br> ORDER BY 1, 2<br> ) As foo ) )"<br>PL/pgSQL function "st_concavehull" line 39 at assignment<BR>**************PGADMIN MESSAGE - END**************<BR> <BR>Is this a significant issue as the Query still seems to be running.<BR> <BR>Cheers,<BR> <BR>Paul<BR> <BR> <BR> </div></body>
</html>