jeudi 1 mai 2014

Calculate distance from a lat/lon coord to a street


Vote count:

0




I have the coordinates for a street, for example:



CLLocationCoordinate2D street[3];
street[0] = CLLocationCoordinate2DMake(-17.3521, 145.5898);
street[1] = CLLocationCoordinate2DMake(-17.3518, 145.5910);
street[2] = CLLocationCoordinate2DMake(-17.3515, 145.5917);


And a location that is fairly close to the street (about 60 meters):



CLLocationCoordinate2D location = CLLocationCoordinate2DMake(-17.3525, 145.5911);


How can I calculate the distance between the location and position along the street's path?


I'm not looking for the distance to the closest point in the array, I want the distance to the closest position in between the points.



asked 51 secs ago






Aucun commentaire:

Enregistrer un commentaire