0

Using the following routine would it be possible to find the ten nearest clincs I am using parse.com to store my info and I have long and latitude their I am using xamian.ios c#. I want to be able to just list the first ten ares that match one being passed in with just using long and lat ?

I am very basic at maths so if any formulas need using can an example be provided thanks.

public async void populateFromParseLocalDB()
{
        var query = ParseObject.GetQuery ("clinics");
        IEnumerable<ParseObject> results = await query.FindAsync();

        int i=0;

        foreach (var record in results)
        {
            i++;
            Console.WriteLine("in for each");
            var name = record.Get<String>("Name");
            var lat = record.Get<string>("lat");
            var lng = record.Get<string>("lng");
            Console.WriteLine(name);
        }

        int mycount = i;
    }
Jason
  • 86,222
  • 15
  • 131
  • 146
c-sharp-and-swiftui-devni
  • 3,743
  • 4
  • 39
  • 100
  • Please take the time to search first, and to give your question a meaningful title. You really want to know how to calculate the distance between two points - which has nothing to do with geolocation or Xamarin. This question has been answered multiple times on SO, and there are thousands of Google hits that will explain how to do it. – Jason Oct 19 '14 at 18:13
  • Unless maybe he wants "road distance" instead of straight line. Of course if that's the case, it should be stated in the question, and the code that's already been tried should also be posted. – ctacke Oct 20 '14 at 14:14
  • @Jason yes while that may be true it does have to do with xamrian as xamiran ios has limitations in the linq and using the geography to find this info out – c-sharp-and-swiftui-devni Oct 20 '14 at 21:05

0 Answers0