Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How may I store geographical data in an android database and query for it?

I want to store locations in my Android phone and be able for the application to tell me if I am inside these points&radius.

What is the best way to store many point&radius locations and efficiently query for them?

like image 742
Eduardo Avatar asked Mar 01 '10 22:03

Eduardo


1 Answers

I have not tried this but as a very simple approach you could store the locations as lat/long pairs and a radius and use the android.location.Location class's distanceTo method as your "hit" test?

Iterate through each pair in turn and apply the test?

see sdk reference

like image 51
Richard Avatar answered Oct 16 '22 01:10

Richard