Hi,<br><br>I have point data on a grid and I would like to identify and label point clusters so that I can do a Dissolve operation and reduce the point clusters to polygons. I can cluster the data by attribute with the very simple:<br>
<br>select distinct <a href="http://a.id">a.id</a>, a.the_geom from tablename a, tablename b WHERE st_distance(a.the_geom, b.the_geom) < 0.0001 and a.grid_code > 1000;<br><br>This quickly identifies clusters of contiguous grid points with grid_code values greater than 1000, but I don't see how to modify it to allow distinct labeling of these clusters (like cluster1, cluster2, etc.), which seems necessary for the subsequent Dissolve operation. Can anyone suggest a modification to this SQL, or another statement, to cluster with labeling? I can think of some ways to hack this together in Python but they would likely be much less efficient.<br>
<br>Thanks in advance,<br>Chris<br><br><br>