开发者

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

开发者 https://www.devze.com 2022-12-21 11:10 出处:网络
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.

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 ef开发者_JAVA百科ficiently query for them?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消