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

On Monday, November 16, 2015 at 8:40:21 AM UTC-5, Pierre wrote:
>
> Hi,
>
> I'd like to specify use_spheroid=False when calling web2py function 
> st_dwithin 
>
> postgis ref :
> boolean *ST_DWithin*(geography gg1, geography gg2, double precision 
> distance_meters, boolean use_spheroid);
>
>  Is it possible ?
>
>
> if not can can I achieve it with  executesSQL ?
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to