I am working on a constructing a grid of coordinates given the four corner coordinates (latitude,longitude pairs).
Thanks to the explanations and methods provided at Algorithm for offsetting a latitude/longitude by some amount of meters
I had a quick question. I calculated the offset for latitude and longitude using the formula and I observed that it worked when moving along y direction (that is adding required_displacement / 111111 to latitude)
However it did not work when moving in the x direction. That is I added (required_displacement / (111111*cos(latitude) ) to the longitude. (I did take care to interpret cos(10) as the cosine of 10 degrees, not 10 radians)
original coordinates = (40.080772, -88.19044)
displacement = 200 meters
Along y direction = (40.0825720018, -88.19044) - 200 meters
Along x direction = (40.080772, -88.18808747937236) - 928 meters
I used the Google Distance Matrix API to compute the distances between the original co-ordinates and the new coordinates obtained after displacement (https://maps.googleapis.com/maps/api/distancematrix/json?origins=40.080772,-88.19044&destinations=40.080772,-88.18808747937236&mode=walking)
Can anyone help me understand what I am doing wrong?
Aucun commentaire:
Enregistrer un commentaire