I'm not sure I follow.  Can you explain what exactly you want to do?

The following query will collect points into clusters (multipoints), clustered 
on a 100x100 grid.

-- generate a sample random point dataset
CREATE TABLE points AS
SELECT ST_MakePoint(random()*1000, random()*1000) AS geom
FROM generate_series(1, 100000);

-- create point clusters
SELECT st_collect(geom)
FROM points
GROUP BY
  round(st_x(geom)/100)*100,
  round(st_y(geom)/100)*100;


Kevin


On 2/4/2010 11:26 PM, sunpeng wrote:
I want to write "cluster by" instead of "group by" on geospatial point
data,should I write the code at postgresql or postgis ?
thanks

peng



_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to