[postgis-devel] Name of ST_MakeBox2D parameters

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Fri May 8 03:14:34 PDT 2009


Mateusz Loskot wrote:

> Hi,
> 
> In the manual for SVN trunk [1] it states that box constructor
> accepts LowLeft/UpRight corners:
> 
> box2d ST_MakeBox2D(geometry pointLowLeft, geometry pointUpRight);
> 
> [1] 
> http://postgis.refractions.net/documentation/manual-svn/ST_MakeBox2D.html
> 
> Is there any assumption regarding origin and orientation of coordinate 
> system?
> Given sample queries below, I've found the name a little confusing:
> 
> sistest=# SELECT ST_MakeBox2D(ST_Point(0, 0), ST_Point(5,5));
>  st_makebox2d
> --------------
>  BOX(0 0,5 5)
> 
> sistest=# SELECT ST_MakeBox2D(ST_Point(5, 5), ST_Point(0, 0));
>  st_makebox2d
> --------------
>  BOX(5 5,0 0)
> 
> sistest=# SELECT ST_XMin(ST_MakeBox2D(ST_Point(5, 5), ST_Point(0, 0)));
>  st_xmin
> ---------
>        5
> 
> sistest=# SELECT ST_XMax(ST_MakeBox2D(ST_Point(5, 5), ST_Point(0, 0)));
>  st_xmax
> ---------
>        0


Hi Mateusz,

I think that ST_MakeBox2D() is working correctly, and the bug is that 
ST_XMax() and ST_YMax() simply returns the relevant structure elements 
rather than the true maximum.

My gut feeling is that this is a bug; feel free to add it to the PostGIS 
tracker against 1.4.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063



More information about the postgis-devel mailing list