1

I have a list of latitude and longitude values in a database. Based on a user’s location I need to extract the closest location from the database based on walking distances. For this purpose, I need to first get all values from the database into an array and then calculate WALKING distances to each and then return the lat/long of the shortest distance.

Note: I have no problem extracting the database values. I need help with the calculation of walking distances between 2 points.

I have so far found threads here which either show straight line distances. Is there any way to get walking distances between 2 points? If so, I would appreciate if you could point me in the right direction (link/previous question) or provide some guidance on what classes or functions to use.

M M
  • 13
  • 3

1 Answers1

1

You can get the distance in meter using the

CLLocationDistance distance = [locationOne distanceFromLocation:locationTwo];

you can acoordingly convert it into CentiMeter or Kilometer, this may serve your purpose

Geet
  • 2,427
  • 2
  • 21
  • 39