[postgis-users] Documentation on GIS specific SQL

Matt Lynch matt@terraEngine.com
Thu Feb 20 17:54:26 2003


Wow, you're fast!

Ok, so I would do

SELECT *,box3d(the_geom)
 FROM demolakes;

Or 

SELECT *, xmin(box3d(the_geom)) AS ulx, ymax (box3d(the_geom)) AS uly,
xmax(box3d(the_geom)) AS lrx, ymin(box3d(the_geom)) AS lry
 FROM demolakes;

As you suggested to save work on the VB side.

Any suggestions of other sources of documentation, tutorials, etc?  I
don't want to keep bugging the listserv unnecessarily.

Thanks,

Matt


-----Original Message-----
From: postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of Paul
Ramsey
Sent: Thursday, February 20, 2003 10:44 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Documentation on GIS specific SQL


Matt Lynch wrote:

> But it appears that I must group in order to use extent

Yes, because extent is one of two (the other is collect()) aggregate 
functions currently in PostGIS. "select extent(geom) from tbl" returns 
the aggregate extent of every feature in the table, ie. the extent of 
the table itself.

You can get the bounding box of a single geometry with either the 
OpenGIS-standard envelope() or by casting the object to a box3d with 
box3d(). You can also use the xmin(), ymin() etc functions to get the 
extents directly, which might be more convenient for accessing them from

a database cursor, rather than parsing the values out of an envelope or 
bounding box string.

P.

-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey@refractions.net
      | Phone: (250) 885-0632
      \_


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.455 / Virus Database: 255 - Release Date: 2/13/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.455 / Virus Database: 255 - Release Date: 2/13/2003