Given an initial lat/lng, a distance(in kms), and a bearing (degrees), this will calculate the resulting lat/lng coordinates.
(init_loc, distance, bearing)
| 47 | |
| 48 | |
| 49 | def get_new_coords(init_loc, distance, bearing): |
| 50 | """ |
| 51 | Given an initial lat/lng, a distance(in kms), and a bearing (degrees), |
| 52 | this will calculate the resulting lat/lng coordinates. |
| 53 | """ |
| 54 | origin = geopy.Point(init_loc[0], init_loc[1]) |
| 55 | destination = geopy.distance.distance(kilometers=distance).destination(origin, bearing) |
| 56 | return (destination.latitude, destination.longitude) |
no outgoing calls
no test coverage detected