Not with the current sources but they can be modified.
You can always use executesql to run a SQL command.
The actual command depends on what you are doing.
If you are running from source, modifying it is not that hard.
In \gluon\packages\dal\pydal\objects.py replace (at line 1328 in ver.2.12.03)
def st_dwithin(self, value, distance):
db = self.db
return Query(db, db._adapter.ST_DWITHIN, self, (value, distance))
with
def st_dwithin(self, value, distance, use_spheroid=True):
db = self.db
return Query(db, db._adapter.ST_DWITHIN, self, (value, distance, use_spheroid))
and in \gluon\packages\dal\pydal\adapters\postgres.py replace (at line 325)
def ST_DWITHIN(self, first, tup):
"""
http://postgis.org/docs/ST_DWithin.html
"""
second, third = tup
return 'ST_DWithin(%s,%s,%s)' %(self.expand(first),
self.expand(second, first.type),
self.expand(third, 'double'))
with
def ST_DWITHIN(self, geo1, tup):
"""
http://postgis.org/docs/ST_DWithin.html
"""
geo2, dist, use_spheroid = tup
if use_spheroid:
return 'ST_DWithin(%s,%s,%s)' %(self.expand(geo1),
self.expand(geo2, geo1.type),
self.expand(dist, 'double'))
else:
return 'ST_DWithin(%s,%s,%s,%s)' %(self.expand(geo1),
self.expand(geo2, geo1.type),
self.expand(dist, 'double'),
self.expand(False, 'boolean'))
If you or someone else is willing to test the changes we can add them to the next version.
Denes