I\'m currently developing an app for Android which uses google map service. Because users will be able to see thousands of markers I would like to load only those which are curr
Where are those place-marks coming from? If they are coming from a web service, check if the web service supports spatial queries. If its a basic point in extent (rectangular envelope) you could do something like this:
Note: (xmin, ymin -> xmax, ymax) are the bounds of your rectangle (extent).
def is_point_in_rect(px, py, xmin, ymin, xmax, ymax):
if px >= xmin and px <= xmax:
if py >= ymin and py <= ymax:
return True
else:
return False
This is something very simple. You can even use the Google Maps Data API to store your place-marks and that has a mechanism to execute spatial queries.
If your data is on Google App Engine, then you could use GeoPt based queries or you could roll your own spatial index. Check out http://code.google.com/p/geomodel/