I've loaded a LIDAR xyz file into a PostGIS2.0 database and created a 3D point geometry column ("tblCLOUD") from the data.
I've also loaded into the database a shapefile that contains six (non-overlapping) polygons ("tblZONES").
What I'm trying to do now is extract the points covered by each polygon to an individual table. So the end result would be six tables containing N points each.
I've hit my limits with PSQL!
My two tables - tblcloud & tblpoly are stuctured as follows:
CREATE TABLE tblcloud ( "pointID" integer NOT NULL DEFAULT nextval('"tblcloud_pointID_seq"'::regclass), x double precision, y double precision, z double precision, geom geometry(PointZ,2193), CONSTRAINT pk_point_id PRIMARY KEY ("pointID" ) ) WITH ( OIDS=FALSE ); ALTER TABLE tblcloud OWNER TO postgres; -- Index: tblcloud_geom_gist -- DROP INDEX tblcloud_geom_gist; CREATE INDEX tblcloud_geom_gist ON tblcloud USING gist (geom ); CREATE TABLE tblpoly ( gid serial NOT NULL, minx numeric, miny numeric, maxx numeric, maxy numeric, cntx numeric, cnty numeric, area numeric, perim numeric, height numeric, width numeric, geom geometry(MultiPolygon,2193), CONSTRAINT tblpoly_pkey PRIMARY KEY (gid ) ) WITH ( OIDS=FALSE ); ALTER TABLE tblpoly OWNER TO tom; -- Index: tblpoly_geom_gist -- DROP INDEX tblpoly_geom_gist; CREATE INDEX tblpoly_geom_gist ON tblpoly USING gist (geom );