[postgis-users] Re: Aggregate?

Stephen Crawford src176 at psu.edu
Thu Mar 1 12:53:29 PST 2007


Thanks. 

I don't quite understand this part:
"Use collect(geometryn(the_geom, 1)) id your data is specified as singular
multigeometries."

Also, if I want to keep a few of the record for based on another another
value, should this work?:

SELECT name, party, collect(the_geom)) AS the_geom,
    FROM constituencies
   GROUP BY constituencies.name, constituencies.party;

Thanks,
Steve



 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Laurence
Rowe
Sent: Thursday, March 01, 2007 3:29 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Re: Aggregate?

Something like:

SELECT name, collect(the_geom)) AS the_geom,
    FROM constituencies
   GROUP BY constituencies.name;

Works for me. Use collect(geometryn(the_geom, 1)) id your data is specified
as singular multigeometries.

Laurence


Stephen Crawford wrote:
> All,
> 
> I have a postGIS feature data set of the ranges of species, with many 
> separate records for each species name.  I would like to aggregate 
> these into a table with one multi-poly feauture for each species.  
> Should I use
> Collect() for this task?  And could somebody give me quick example?
> 
> Thanks,
> Steve
> 
> Stephen Crawford
> Center for Environmental Informatics
> GeoVISTA Center
> The Pennsylvania State University
> 814.865.9905
> src176 at psu.edu

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list