Skip to content
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

Fixing error with some HERE responses #16

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Fixing error with some HERE responses #16

merged 1 commit into from
Oct 1, 2024

Conversation

arnasbr
Copy link
Contributor

@arnasbr arnasbr commented Sep 30, 2024

relevant data that causes the issue:

origin,destination,departure_time,google_travel_time,tomtom_travel_time,here_travel_time,mapbox_travel_time,tt_travel_time
"58.57324829999991, -4.845694899999996","58.6114888999999, -4.996785099999998",2024-09-24 07:00:00+0100,993.0,8231.0,0.0,2438.0,1249.0
"58.57324829999991, -4.845694899999996","58.6114888999999, -4.996785099999998",2024-09-24 10:00:00+0100,993.0,8231.0,0.0,2344.0,1212.0
"58.57324829999991, -4.845694899999996","58.6114888999999, -4.996785099999998",2024-09-24 13:00:00+0100,993.0,8231.0,0.0,2344.0,1212.0
"58.57324829999991, -4.845694899999996","58.6114888999999, -4.996785099999998",2024-09-24 16:00:00+0100,993.0,8231.0,0.0,2344.0,1375.0
"58.57324829999991, -4.845694899999996","58.6114888999999, -4.996785099999998",2024-09-24 19:00:00+0100,993.0,8231.0,0.0,2344.0,1122.0
"58.5865792999999, -4.894686800000001","58.61901859999991, -5.004178600000005",2024-09-24 07:00:00+0100,835.0,6474.0,0.0,1907.0,988.0
"58.5865792999999, -4.894686800000001","58.61901859999991, -5.004178600000005",2024-09-24 10:00:00+0100,835.0,6474.0,0.0,1813.0,961.0
"58.5865792999999, -4.894686800000001","58.61901859999991, -5.004178600000005",2024-09-24 13:00:00+0100,835.0,6474.0,0.0,1813.0,961.0
"58.5865792999999, -4.894686800000001","58.61901859999991, -5.004178600000005",2024-09-24 16:00:00+0100,835.0,6474.0,0.0,1813.0,1085.0
"58.5865792999999, -4.894686800000001","58.61901859999991, -5.004178600000005",2024-09-24 19:00:00+0100,835.0,6474.0,0.0,1813.0,889.0
"58.58964559999993, -4.907861099999995","58.6196854999999, -5.004064599999998",2024-09-24 07:00:00+0100,778.0,5912.0,0.0,1752.0,905.0
"58.58964559999993, -4.907861099999995","58.6196854999999, -5.004064599999998",2024-09-24 10:00:00+0100,778.0,5912.0,0.0,1752.0,878.0
"58.58964559999993, -4.907861099999995","58.6196854999999, -5.004064599999998",2024-09-24 13:00:00+0100,778.0,5912.0,0.0,1658.0,878.0
"58.58964559999993, -4.907861099999995","58.6196854999999, -5.004064599999998",2024-09-24 16:00:00+0100,778.0,5912.0,0.0,1658.0,992.0
"58.58964559999993, -4.907861099999995","58.6196854999999, -5.004064599999998",2024-09-24 19:00:00+0100,778.0,5912.0,0.0,1658.0,814.0
"58.61514680000021, -4.977610800000009","58.58267099999993, -4.882223199999996",2024-09-24 07:00:00+0100,760.0,6214.0,0.0,2296.0,947.0
"58.61514680000021, -4.977610800000009","58.58267099999993, -4.882223199999996",2024-09-24 10:00:00+0100,760.0,6214.0,0.0,2391.0,922.0
"58.61514680000021, -4.977610800000009","58.58267099999993, -4.882223199999996",2024-09-24 13:00:00+0100,760.0,6214.0,0.0,2296.0,922.0
"58.61514680000021, -4.977610800000009","58.58267099999993, -4.882223199999996",2024-09-24 16:00:00+0100,760.0,6214.0,0.0,2296.0,1042.0
"58.61514680000021, -4.977610800000009","58.58267099999993, -4.882223199999996",2024-09-24 19:00:00+0100,760.0,6214.0,0.0,2296.0,852.0
"58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999",2024-09-24 07:00:00+0100,932.0,7471.0,0.0,2250.0,1135.0
"58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999",2024-09-24 10:00:00+0100,932.0,7471.0,0.0,2344.0,1102.0
"58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999",2024-09-24 13:00:00+0100,932.0,7471.0,0.0,2250.0,1102.0
"58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999",2024-09-24 16:00:00+0100,932.0,7471.0,0.0,2250.0,1247.0
"58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999",2024-09-24 19:00:00+0100,932.0,7471.0,0.0,2250.0,1020.0

@arnasbr arnasbr self-assigned this Sep 30, 2024
Comment on lines +65 to +72
# For some reason, HERE provider returns 0 duration, 0 length
# for some routes in the mountains, but doesn't indicate anywhere
# that it failed. Returning 0 fails `asType(int)` conversion later.
# Example route in UK where this happens:
# "58.61966879999991, -5.0040819999999995","58.578906999999894, -4.880025099999999"
if total_duration == 0:
return RequestResult(None)

Copy link
Contributor Author

@arnasbr arnasbr Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the whole UK input file, this only happened for the HERE provider, nowhere else.

Another solution would be to simply remove the routes (only 4 of them, they seem to be somewhere in the northern mountains) that return this 0 travel time result. They seem to get pretty random results in other APIs, ranging from 900 to 7500. But even if we do that, having this for safety is still probably nice.

Copy link
Collaborator

@pawel-wroniszewski pawel-wroniszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@arnasbr arnasbr merged commit 3303e2b into master Oct 1, 2024
5 checks passed
@arnasbr arnasbr deleted the fix-here-error branch October 1, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants