<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=563222714-02102007><FONT face=Arial
color=#0000ff size=2>Slight correction - in the new versions you are right only
xmin(box3d) and st_xmin(box3d) exists so my secondary comment about having
to get the box doesn't apply for new versions because there is no
ambiguity.</FONT></SPAN></DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff size=2>But
note there is are auto casts that takes a box2d ->box3d and
geometry->box3d so the function will work just fine on a box2d and a
geometry since it will silently cast box2d and geometry to box3d. That is
why it will work.</FONT></SPAN></DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff size=2>Hope
that doesn't confuse you more.</FONT></SPAN></DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=563222714-02102007><FONT face=Arial color=#0000ff
size=2>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Obe,
Regina<BR><B>Sent:</B> Tuesday, October 02, 2007 10:21 AM<BR><B>To:</B> PostGIS
Users Discussion<BR><B>Subject:</B> RE: [postgis-users] Re: From box2d to
bbox<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
color=#0000ff size=2>Simply doing this should work</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>UPDATE Mytable SET gbbox = st_xmin(the_geom) || ',' ||
st_ymin(the_geom) || ',' || st_xmax(the_geom) || ',' ||
st_ymax(the_geom)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>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</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>UPDATE Mytable SET gbbox = xmin(BOX2D(the_geom)) || ',' ||
ymin(BOX2D(the_geom)) || ',' || xmax(BOX2D(the_geom)) || ',' ||
ymax(BOX2D(the_geom))</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=524300714-02102007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of
</B>Gustavo Ces<BR><B>Sent:</B> Tuesday, October 02, 2007 9:56 AM<BR><B>To:</B>
PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] Re: From box2d
to bbox<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Hi Regina,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> What i was tried is</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>update Mytable set
caja1=boundary(setsrid(box2d(the_geom),23029))<BR>update Mytable set
gbbox=x(pointN(caja1,1))||','||y(pointN(caja1,1))||','||x(pointN(caja1,3))||','||y(pointN(caja1,3))</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Geoserver needs a parameter:
bbox=xmin,ymin,xmax,ymax </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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!
:)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Gus</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<P>
<HR SIZE=1>
<P></P>
<P><STRONG>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.
</STRONG></P></BODY></HTML>