Thanks.  This is what I see at line 2983 in dal.py:

    def ST_DWITHIN(self, first, second):
        """
        http://postgis.org/docs/ST_Within.html
        """
        return 'ST_DWithin(%s,%s)' %(self.expand(first), 
self.expand(second, first.type))


The proper documentation is at http://postgis.org/docs/ST_DWithin.html (note 
the 'D').  Also looks like this is missing the 3rd argument to ST_DWithin:

boolean *ST_DWithin*(geometry g1, geometry g2, double precision 
distance_of_srid);


On Sunday, December 8, 2013 9:25:35 AM UTC-5, Massimo Di Pierro wrote:

> Added ST_Dwithin support in trunk. Please check it.
>
> On Sunday, 8 December 2013 07:02:06 UTC-6, User wrote:
>>
>> I'm storing latitude/longitude coordinates in a geometry field (using 
>> PostgreSQL 
>> 9.1.10):
>>
>> Field('point', 'geometry()')
>>
>> I understand there is also the geography type but from my reading 
>> geometry is faster and is suitable for small distances (
>> http://workshops.boundlessgeo.com/postgis-intro/geography.html#why-not-use-geography
>> )
>>
>> I want users to be able to specify a reference point and search for all 
>> records within X distance from the reference point.  Using raw SQL I would 
>> use  ST_DWithin <http://postgis.refractions.net/docs/ST_DWithin.html> doing 
>> something like
>>
>> SELECT name, ST_AsText(point)
>> FROM mytable
>> WHERE ST_DWithin(point, ST_GeomFromText('POINT(40.47112 -76.33)',4326), 
>> 0.1)
>>
>> But web2py does not seem to support ST_DWithin only st_within.  So how 
>> can I achieve a similar result in web2py?
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to