I'm developing an application on app engine where I store location information in the datastore. I'm trying to fetch all the points (lat, long) within a specified radius of a given point. Similar to this StackOverflow question on SQL. I would like to know if the same can be achieved with GQL. (similar to this article I found)
Looking forward to your suggestions,
Not with GQL, but you can do this using the Search API, though this means you need to separately index your entities as searchable documents and is much more expensive as well ($0.06/100k for a datastore query versus $0.6/10k for a complex search query, which all geopoint search queries are).
EDIT TO ANSWER QUESTION IN THE COMMENT: It seems to me like the example does solve your problem:
Replace the
100
with500
and the coordinates ingeopoint(35.2, 40.5)
with the coordinates of the center of your circle, andsurvey_marker
with the name of your indexed GeoPt property.So if you indexed your documents like this:
You would write your query like so:
Hope this helps.