[postgis-users] getting a square/rectangle arround a point

Kevin Neufeld kneufeld at refractions.net
Thu Aug 20 09:57:41 PDT 2009


You mean like this?
SELECT ST_Intersection(
   poly.geom,
   ST_Expand(pt.geom, 2))
FROM mypolygontable poly, mypointtable pt
WHERE poly.geom && ST_Expand(pt.geom, 2);

Yes, you can expand the bounding boxes on fly and use it to intersect another geometry.

Cheers,
-- Kevin

Daniel Grum wrote:
> Your request nr.2 is perfect, thank you.
> But can use this created polygon to selcet a part of another polygon, in 
> my case public.wald_by.the_geom.
> Or do I have to save the selcted information in a table and use this for 
> the new request???
> Because I need to selcet the other polygon to calculate the area of the 
> selected part, of public.wald_by.the_geom !
> 
> --Daniel



More information about the postgis-users mailing list