notes=# select AsText(Envelope(ST_Union(the_geom))) from notes; astext --------------------------------------------------------------- POLYGON((-74.0071258544922 40.7674407958984, -74.0071258544922 40.8000373840332, -73.9178161621094 40.8000373840332, -73.9178161621094 40.7674407958984, -74.0071258544922 40.7674407958984))