简体   繁体   中英

How to store location data to speedup distance calculation?

I am working on to create an application which will fetch a list of all the hospitals within a certain radius of the user's location. So in-case we have in our database a list of all the hospitals of this planet with there GPS locations, will we need to find distance of the user with each one of them and then list the hospitals which are at less than the prescribed radius? With multiple users accessing our application concurrently, it may crash our servers. Is there a way to optimize this? How should I store the location data of the hospitals such that the p

Although your question does not seem quite finished, I recommend taking a look at R-trees as your data structure of choice:

http://en.wikipedia.org/wiki/R-tree

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM