I've a Postgis table of around 80,000 points and want to be able to populate a second table summarizing the data with convex hulls based on points with a common attribute.
For example, the data contains the telephone exchange which each point is associated with - I want to create a convex hull for all points in each telephone exchange. It ought to create around 1000 overlapping polygons.
I tried using the normally excellent QGis ftools convex hull plugin with the option to create hulls based on an input field but my computer spent 6-hours maximising 3 of the four cores before crashing QGis.
And I've tried doing it directly in sql:
INSERT INTO new_table(exchange_name, the_geom)
SELECT exchange_name, ST_ConvexHull(ST_Collect(the_geom)) As the_geom
FROM first_table
GROUP BY exchange_name
But this complains about invalid geometry - I've tried geometry constraints of "MULTIPOLYGON" and generic "GEOMETRY" so not sure why this should happen - the source table loads perfectly in QGis.
The Grass "v.hull" tool only creates a convex hull for all points and not based on an attribute.
Any tips or suggestions would be very welcome!