Postgis convex hull

Quantum Gis has been  pissing me off for the last week with its slow rendering time.  I probably should switch to something leaner. For the time being I will just export what I want as an image, for instance the convex hulls of the area codes that I want to keep in mind.

select area_code,
 ST_ConvexHull(ST_Collect(geom))
 from stations
 group by area_code
 having count(*)>10;

The interesting thing here is that the Convex Hull function is not an aggregate, but the collect function is, as explained by the Postgis manual. I like the manual, it usually has the correct clarifications regarding functions so that I can make good decisions.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s