[web2py] Re: Subquery question

2016-12-12 Thread Gael Princivalle
I have to learn more about it. I've choose geometry as geography don't support st_within that'is the function that I need for testing in a point is inside a map area. Il giorno lunedì 12 dicembre 2016 20:46:47 UTC+1, Pierre ha scritto: > > > my guess is you are not "feeding" the geometry field w

[web2py] Re: Subquery question

2016-12-12 Thread Pierre
my guess is you are not "feeding" the geometry field with the correct data the "natural" container for raw (default) lat lon is a geography field : *geography()* if instead you want to use a *geometry()*, you need to transform the original data from EPSG:4326 to another coordinates system I us

[web2py] Re: Subquery question

2016-12-12 Thread Gael Princivalle
Thank you Pierre I've add this field to the db: Field('geopoint', 'geometry()', compute=lambda r: 'POINT({0} {1})'.format( float(r['longitude']),float(r['latitude']))), and I've also substitute the geometry filed with this new geopoint filed in the query: events_comments = db((db.events_c

[web2py] Re: Subquery question

2016-12-12 Thread Pierre
don't know if this relates to your problem but I have had issues with the *geoPoint* object in the past and as soon as I removed it from my code everything worked fine. Try with : pt = 'POINT({0} {1})'.format(lon,lat) instead of a geoPoint -- Resources: - http://web2py.com - http://web2py