On Wed, Sep 12, 2012 at 09:42:56AM -0600, René Fournier wrote: > Yes, this works great. > > UPDATE territories SET border = (SELECT > ST_ConvexHull(ST_Collect(ST_GeomFromText('MULTIPOINT(-111.868842 50.569455, > -111.898634 50.569992, -111.907919 50.583764, -111.868859 50.569452)') ) )) > WHERE id = 3014; > > Now... I'm trying to figure out, how to do the same, except create the border > (polygon) from points in another table, e.g.: > > UPDATE territories SET border = (SELECT ST_ConvexHull(ST_Collect( > SELECT location FROM addresses WHERE territory_id = 3014 > ))) WHERE id = 3014; > > ...returns "ERROR: function st_collect(geography) does not exist HINT: No > function matches the given name and argument types. You might need to add > explicit type casts." > > So I'm wondering, since both border (final polygon) and location (source of > points) are of type geography, what's the best way to go about this? Or > should I have just used geometry types? Sorry for the dumb questions, I'm > trying to define the schemas by best practices so I don't have to fix them > later. Geography seemed right when I started the project.
Collecting a geography seems so easy, dunno why it's not supported. Anyway you can cast your geographies to geometry for the sake of computation and then cast back to geography. I just hope none of your territories cross the dateline --strk; _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users