<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Steve,<br>I think I've done something similar with ST_ConvexHull( ), where I had a data set full of LINESTRING geometries and wanted to ConvexHull them into as many separate polygons as there are unique sets of values for two or three attributes stored on the objects. paraphrased below to obscure original detail:<br><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">SELECT</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">ST_ConvexHull ( ST_Collect ( the_geom ) ) AS poly,</span><br style="font-family: courier,monaco,monospace,sans-serif;
font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr1,</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr2,</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr3</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">FROM</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span
style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1,</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table2</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">WHERE</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">some condition AND</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family:
courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">some other condition AND</span><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"></span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">GROUP BY</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr1,</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr2,</span><br style="font-family:
courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">table1.attr3;</span><br><br>I think in your case if you could do something like this or similar?<br><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">select</span><br style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);"><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">func_returning_dist_as_one_of_5_ranges(the_distance) AS range,</span><br><span style="font-family: courier,monaco,monospace,sans-serif; font-weight: bold; color: rgb(191, 95, 0);">ST_ConvexHull ( ST_Collect ( the_geom ) ) AS poly<br>from table<br>where....<br>GROUP BY range;<br></span><blockquote style="border-left: 2px solid rgb(16, 16, 255);
margin-left: 5px; padding-left: 5px;"><div class="plainMail"><br>Hi all,<br><br>I am trying to construct multiple convex hulls from a series of point <br>where I have an attribute dist for each point.<br><br>What I want is to generate convex hulls for expanding rings where dist <br><= slice up to some max_dist.<br><br>So if slice=100 and max_dist=500, then each hull would be:<br><br>1. all points <= 100<br>2. all points <= 200<br>3. all points <= 300<br>4. all points <= 400<br>5. all points <= 500<br><br>So I have a procedure that generates the points and is fairly costly to <br>run. I would like to run it once and extract all the hulls in a single <br>pass if possible.<br><br>I'm currently running postgresql 8.3 and "POSTGIS="1.5.1" <br>GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008" <br>LIBXML="2.6.32" USE_STATS"<br><br>Any thoughts or snippets would be
appreciated.<br><br>Thanks,<br> -Steve<br><br><br></div></blockquote></td></tr></table>