Adding 'Search Nearby' Functionality

92 views
Skip to first unread message

laadeedaa~

unread,
Jun 4, 2014, 10:59:41 AM6/4/14
to mitappinv...@googlegroups.com
Hi,
I would like to add the search nearby function to an app I'm building. Right now, I can get the latitude and longitude I'm at - what I want is to be able to search for nearby businesses within a 200 - 300m radius. Any ideas how?

Regards,
Colin

Taifun

unread,
Jun 4, 2014, 3:11:43 PM6/4/14
to mitappinv...@googlegroups.com
fusiontables offer the ST_INTERSECTS and ORDER BY ST_DISTANCE functionality,

Used in the WHERE clause. The syntax is: ST_INTERSECTS(<location_column>, <geometry>)

ST_INTERSECTS cannot be combined with ORDER BY ST_DISTANCE.

Request: Order by Distance

Find 10 rows nearest to the given location.

SELECT 'Store Name', Pharmacy, Hours FROM 1EIv-k-417_BWrgm4mNANo-Ejvc94hZYsvh7jIA WHERE Pharmacy='yes' AND ST_INTERSECTS(Address, CIRCLE(LATLNG(37.3242,-121.9806),5000))

which means, if you store theses businesses and their location in a fusiontable, you could easily get the nearby businesses...

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         


Reply all
Reply to author
Forward
0 new messages