-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inaccuracy in Distance Calculation Using Google Maps API with .NET 8.0 #386
Comments
Will take a look at it soon |
I took a look at it. |
I actually got it finished already. |
Thank you very much ! This fixed the issue. |
Closing issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Firstly, I would like to extend my gratitude for your valuable contribution to the project.
During the course of my work, I have encountered a notable discrepancy in distance calculation that warrants your attention.
Environment Details:
.NET Core Framework Version: .NET 8.0
Google Maps API Version: 5.31
Issue Description:
We are currently working with the Google Maps Directions API to calculate walking distances between two points. However, the distances returned by the API seem to be significantly inaccurate. This issue does not trigger an error in the traditional sense, but the data accuracy is compromised, which is concerning.
Correct distance: 249 ft
Incorrect distance: 1.5 mi
API Request Details:
Here are the specifics of the request and the method involved:
Origin Coordinates: 32.5523936,-116.9080947
Destination Coordinates: 32.552406158844668,-116.90853506326675
The code snippet for generating the directions request is as follows:
DirectionsRequest request = new()
{
Key = _key,
TravelMode = TravelMode.Walking,
Origin = new LocationEx(Origin),
Destination = new LocationEx(Destination)
};
DirectionsResponse response = await GoogleMaps.Directions.QueryAsync(request);
Despite the proximity of the origin and destination points, the data fetched from the Google Maps Directions API is surprisingly off the mark.
Suspected Cause:
The inconsistency appears to be linked to the TravelMode enum, specifically when set to Walking, Driving Etc.
To better illustrate the issue, I have included comparison images showcasing the distance variations.
Request for Assistance:
Could you please review the implementation and advise on any potential misconfigurations or alternative approaches to address this accuracy problem? Your expertise in this matter would be immensely appreciated.
PS: I also tested the Routes, DirectionsMatrix with the QueryAsync and they also responded with the incorrect data.
Best regards
Response using GoogleAPI Library:

Response using Gmaps API with correct travelMode:

Response using Gmaps API with incorrect travelMode:

The text was updated successfully, but these errors were encountered: