[postgis-users] How to select points within circle

Nicklas Avén nicklas.aven at jordogskog.no
Tue Oct 19 03:53:22 PDT 2010


Your syntax is a little backwards an it is better to use st_dwithin instead: select gid, the_geom, floorarea from "building" as m where ST_DWithin(m.geom,'POINT(306404701,6755737)'::geometry, 200.0);
HTHNicklas

2010-10-19 zhang zhe wrote:

Hello,
>  
> I have one table called building.sql which contains points. I want to select building which fall within a circle. This circle is not a sql table but instead only coordinate and radius such as circle(point '(0,0)', 2.0). 
>  
> My sql query is like this 
> select gid, the_geom, floorarea from "building" as m where m.geom within(GeoFromText(circle(point '(306404701,6755737)', 200.0)));
>  
> But it gives me erro. Does anyone knows where went wrong? 
>  
> Thanks a lot
>  
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101019/25278037/attachment.html>


More information about the postgis-users mailing list