protected async Task <bool> CheckHouseInRadius(int h) { string houseQueryExtend = houseData[h].street + " " + houseData[h].postalCode + " " + houseData[h].city + " Netherlands"; //double[] d = await MappingService.GetCoordinatesAsync(houseQueryExtend); //double[] p = await MappingService.GetCoordinatesAsync(place); //double[] d = MappingService.GetPDOKinfoFromAddress(houseQueryExtend); double[] d = addressCoordinatesDictionary[houseData[h].postalCode.Replace(" ", "")]; //double[] p = MappingService.GetPDOKinfoFromAddress(place); //double[] p = addressCoordinatesDictionary[place]; CheckBaseKey(); //if (placeCoordinates == null) //{ // if (addressCoordinatesDictionary.ContainsKey("BaseAddress") && baseAddress.Key == place) // { // placeCoordinates = addressCoordinatesDictionary["BaseAddress"]; // } // else // { // placeCoordinates = MappingService.GetPDOKinfoFromAddress(place); // addressCoordinatesDictionary.Add("BaseAddress", placeCoordinates); // baseAddress = new KeyValuePair<string, double[]>(place, placeCoordinates); // } //} double dist = await MappingService.CalculateDistance(d, baseAddress.Value); if (dist < radius) { Console.WriteLine("House " + h + " is inside the radius! (" + dist + "km)"); return(true); } else { Console.WriteLine("*House " + h + " is NOT inside the radius! (" + dist + "km)"); return(false); } }