> Hi, > > I have a table with 4 columns, x max, ymax, xmin, ymin coordinates for > the corner points of rectangles. > > Is there a way / function to convert these into a rectangle / polygon? > > Thanks, > > R. >
Hi Franck, Sure: select st_makeBox2d( st_makepoint(xmin, ymin), st_makepoint(xmax, ymax)) will give you a BOX2D, ie a rectangle the same query, cast as a geometry, will convert it to a POLYGON (5 coordinates): select astext(st_makeBox2d( st_makepoint(0, 1), st_makepoint(2, 3))::geometry) Nicolas _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
