I am making store locator application. In my application i am showing nearest store to given latitude and longitude. i am getting my current lan. and lot.
I have xml file on server containing all information of stores and latitude and longitude. What i am thinking to connect application with that xml file and gets nearest stores according to given coordinates.
Now problem is how can i get nearest stores to given coordinates.
I have heared about haversine formula but how can i use that formula to get nearest stores from xml file?
or if there is other way please suggest
If i were you i would parse all the file to get the list of stores. classed by X and then Y.
Then to get the list of the closest shops just take them in the list.
I’m pretty sure you won’t be able to get the shops on the fly without parsing your file.
Another way is to send a request to the server wich answer you with only the closer shops! Every task made on a portable device such as an iphone cost much time and battery than if it was done on the server.