[postgis-users] Need help concatentating 60, 000 polygon geometries

Kevin Neufeld kneufeld at refractions.net
Thu Oct 4 12:56:09 PDT 2007


Scott Schulthess wrote:
>
> Hello everyone,
>
>  
>
> I have a table with 60,000 rows.
>
>  
>
> Each row has a geometry field that is a polygon.
>
>  
>
> I want to concatenate all of these geometry objects into one big 
> multipolygon, or at the very least, a polygon, so I can query easily 
> on one geometry object to see if a point lies within that multipolygon.
>
>  ...
>
Use collect(geometry set).

CREATE TABLE my_multi_polygon AS
  SELECT collect(geom) AS geom
  FROM my_poly_table;

-------------
Kevin Neufeld
Software Developer
Refractions Research Inc.
300-1207 Douglas St.
Victoria, B.C., V8W 2E7

Phone: (250) 383-3022
Email: kneufeld at refractions.net




More information about the postgis-users mailing list