[postgis-users] ConvexHull Aggregate?

Paul Ramsey pramsey at refractions.net
Thu Sep 21 18:35:18 PDT 2006


Have you tried? That query below should run, because you do have an  
aggregate in the picture, collect().

On 21-Sep-06, at 6:26 PM, Curtis W. Ruck wrote:

> For instance.  Say i have a table with the schema of
>
> int rowID
> varchar category
> the_geom geometry (Point2D)
> and other useful fields
>
> And i want to get convex hulls of each category in one query.
>
> SELECT convexhull(collect(the_geom)), category, count(*) FROM  
> tblName GROUP BY category;
>
> convexhull isn't an aggregate function so it can't work in this  
> context.
>
> ----- Original Message ----
> From: Paul Ramsey <pramsey at refractions.net>
> To: Curtis W. Ruck <ruckc at yahoo.com>; PostGIS Users Discussion  
> <postgis-users at postgis.refractions.net>
> Sent: Thursday, September 21, 2006 12:59:45 PM
> Subject: Re: [postgis-users] ConvexHull Aggregate?
>
> perhaps:
>
>   select convexhull(collect(the_geom) from thetable
>
> depends on what semantic you mean when you say "if convexhull was  
> an aggregate".
>
> P
>
> On 21-Sep-06, at 10:44 AM, Curtis W. Ruck wrote:
>
>> Anyone know how in a SQL select statement to get a Convex Hull  
>> polygon geometry as if ConvexHull was an aggregate function?
>>
>> Curtis
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> _______________________________________________
> 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