[postgis-users] How to select points within circle

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


Yes, sorry Should have been select gid, the_geom, floorarea from "building" as m where ST_DWithin(m.geom,'POINT(306404701 6755737)'::geometry, 200.0);

/Nicklas 
2010-10-19 zhang zhe wrote:

Hello,
>  
> Thanks. I try to run your query, and it saids
> parse error-invalid geometry. point (306404701,...)
>  
> do you know where went wrong? 
>  
> Thanks
> 
>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/18591f0a/attachment.html>


More information about the postgis-users mailing list