[postgis-users] How to select points within circle, thanks it works

zhang zhe luckyclare at hotmail.com
Tue Oct 19 06:06:32 PDT 2010



 Hello,
 
thanks it works. 
 
BR,
JoJo


Date: Tue, 19 Oct 2010 12:53:22 +0200
From: nicklas.aven at jordogskog.no
To: postgis-users at postgis.refractions.net
CC: 
Subject: Re: [postgis-users] How to select points within circle



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);

HTH
Nicklas

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
>  
> 
_______________________________________________ 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/20101019/5928c7b0/attachment.html>


More information about the postgis-users mailing list