[postgis-users] Re: From box2d to bbox
Gustavo Ces
g.ces at pettra.es
Tue Oct 2 07:59:25 PDT 2007
Thanks for answering :)
Yes, it works well ( option without st_functions). But now i´ve got another question. I can make St_buffers but not St_xmin... Is it posible? And another one, thought is a typical question, how can i upgrade to St_functions ?
Gus
----- Original Message -----
From: Obe, Regina
To: PostGIS Users Discussion
Sent: Tuesday, October 02, 2007 4:21 PM
Subject: RE: [postgis-users] Re: From box2d to bbox
It applies to box2d as well as all postgis geometries because the postgis geometries have auto casters that will cast them to bbox when using bbox functions. So you actually don't even need to get the bbox to use those functions.
Simply doing this should work
UPDATE Mytable SET gbbox = st_xmin(the_geom) || ',' || st_ymin(the_geom) || ',' || st_xmax(the_geom) || ',' || st_ymax(the_geom)
--------------------------------------------------------------------------------------------------------------------
Now it just occurred to me that if you don't have the st_ versions of these functions, then you do need the BBOX. So you would need to do
UPDATE Mytable SET gbbox = xmin(BOX2D(the_geom)) || ',' || ymin(BOX2D(the_geom)) || ',' || xmax(BOX2D(the_geom)) || ',' || ymax(BOX2D(the_geom))
The reason for that is that for some reason there is an xmax for box2d and one for box3d so what happens is that when applied to a geometry there is abiguity as to what the geometry should be cast to because the geom can be cast to the box2d or box3d so can use either function.
Hope that helps,
Regina
------------------------------------------------------------------------------
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gustavo Ces
Sent: Tuesday, October 02, 2007 9:56 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Re: From box2d to bbox
Hi Regina,
What i was tried is
update Mytable set caja1=boundary(setsrid(box2d(the_geom),23029))
update Mytable set gbbox=x(pointN(caja1,1))||','||y(pointN(caja1,1))||','||x(pointN(caja1,3))||','||y(pointN(caja1,3))
Geoserver needs a parameter: bbox=xmin,ymin,xmax,ymax
I don´t find the xmax function applied to a box2d ( only to box3d) and , is it.... i´ve just have read your last message! :)
Gus
------------------------------------------------------------------------------
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
------------------------------------------------------------------------------
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071002/20c5aced/attachment.html>
More information about the postgis-users
mailing list