[postgis-users] PostGIS 1.5.3-2 Help: ST_ConvexHull ( ST_Collect ( points from a join table

Domenico Giusti dncgst at gnewarchaeology.it
Fri Feb 27 11:24:36 PST 2015


Dear list,

I have two tables and I need help:)

* table_record with a 3d polygon geom
	id, primary key
	code,
	geom
* table_record_point with a 3d point geom
	id, primary key
	code, reference table_record(code)
	x,
	y,
	z,
	geom

The relation is one-to-many, as one record could have one or more points.

I would like to update record.geom with a ConvexHull 3d polygon
collecting points from record_point.geom for some records.

I can print out the geom_hull:

SELECT p.code,
ST_ConvexHull(ST_Collect(p.geom)) AS geom_hull
FROM record_point AS p WHERE p.code = 'D19C5P05'
GROUP BY p.code;

but I miss the way to join the tables and update the record.geom.

Thanks for any help!

-- 
Domenico Giusti <dncgst at gnewarchaeology.it>
GPG keyID: 2048R/A3AB7054F6E5D778


More information about the postgis-users mailing list