[postgis-users] Re: From box2d to bbox

Obe, Regina robe.dnd at cityofboston.gov
Tue Oct 2 08:50:49 PDT 2007


First do 
 
select postgis_full_version();
 
to determine what version you currently have.  You want to be running 1.3.1 to get all the ST_ functions.
 
Depends which OS you are running how best to upgrade and which version you are currently running.  Some linux versions have the latest distros, there is a precompiled upgrade install for Windows and Mac which you can download from here
 
http://postgis.refractions.net/download/
 
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 10:59 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Re: From box2d to bbox


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 <mailto:robe.dnd at cityofboston.gov>  
	To: PostGIS Users Discussion <mailto:postgis-users at postgis.refractions.net>  
	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/ef4fe4e4/attachment.html>


More information about the postgis-users mailing list