[postgis-users] merge geometries

Heitzso heitzso at growthmodels.com
Sun Aug 31 12:35:19 PDT 2003


I've used 'collect(the_geom) as the_geom'
as an aggregate function, but it doesn't pull out
the internal pieces.  Context was wanting to
aggregate census block into census tract.  What
I'm left with is a polygon with lots of internal
line segments within the census tract that correspond
to the census block boundaries.


Chris Faulkner wrote:
> Hello
> 
> Is there any way to merge geometries using one of the functions in postgis.
> If I have a table with 2 fields, ID and GEOMETRY. I have a list of ids and
> would like to combine all the geometries in those ids.
> 
> select combine(GEOMETRY) from table where id in (1,2,3);
> 
> I expect that the function would return a type of MULTILINE, MULTIPOLYGON
> and so on.
> 
> I can see a function geometry_union but this expects two parameters, two
> geometries. My requirement is slightly different, or is there anyway of
> using this to achieve what I want ?
> 
> Thanks





More information about the postgis-users mailing list