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

<bug> If no route found, estimated trip time is 214748365 #696

Closed
ghost opened this issue Aug 9, 2013 · 7 comments
Closed

<bug> If no route found, estimated trip time is 214748365 #696

ghost opened this issue Aug 9, 2013 · 7 comments

Comments

@ghost
Copy link

ghost commented Aug 9, 2013

Requests of these type give response code 207, but if the response code isn't checked you'll wind up with bad data. Suggest that you not return a time in these cases.

I'm testing some data from July 7th this year. Here is a sample error:

curl "http://127.0.0.1:5000/viaroute?loc=48.8575127465,2.3586840939&loc=48.8577807181,2.35861138342"

{"version": 0.3,"status":207,"status_message": "Cannot find route between points","route_geometry": "","route_instructions": [],"route_summary":{"total_distance":0,"total_time":214748365,"start_point":"","end_point":""},"alternative_geometries": [],"alternative_instructions":[],"alternative_summaries":[],"route_name":["",""],"alternative_names":[["",""]],"via_points":[],"hint_data": {"checksum":64665092, "locations": ["PdtPAEp2LQA_AAAA____fwAAAAAAAPA_B41KAEKZAwA", "PdtPAEp2LQAUAAAA____f-VAtpPgetQ_Eo1KAFOZAwD"]},"transactionId": "OSRM Routing Engine JSON Descriptor (v0.3)"}

@emiltin
Copy link
Contributor

emiltin commented Aug 10, 2013

i agree. see #518 and #519 for a suggestion to leave out empty fields.

@DennisOSRM
Copy link
Collaborator

The response code should always be checked. That's why it is there. The value of the total time is the maximum value of signed 32-bit integer (INT_MAX) which is generally treated as a placeholder for infinity.

@ghost
Copy link
Author

ghost commented Aug 12, 2013

Yes, I understand and am doing so in my own code. It just seems like
someone is going to hit this and complain - no response is much more
interpretable (and correct) than what's returned.

On Sat, Aug 10, 2013 at 5:52 AM, Dennis Luxen [email protected]:

The response code should always be checked. That's why it is there. The
value of the total time is the maximum value of signed 32-bit integer
(INT_MAX) which is generally treated as a placeholder for infinity.


Reply to this email directly or view it on GitHubhttps://github.com//issues/696#issuecomment-22439275
.

@DennisOSRM
Copy link
Collaborator

@jedhorne good point. Will likely change the behavior such that it does only give an estimate when a route is found.

@ghost
Copy link
Author

ghost commented Nov 11, 2013

Awesome, thanks!

On Fri, Nov 8, 2013 at 6:00 AM, Dennis Luxen [email protected]:

@jedhorne https://github.com/jedhorne good point. Will likely change
the behavior such that it does only give an estimate when a route is found.


Reply to this email directly or view it on GitHubhttps://github.com//issues/696#issuecomment-28064190
.

@emiltin
Copy link
Contributor

emiltin commented Nov 12, 2013

i think we should be consistent and generally leave out fields that wasn't requested: #518

@DennisOSRM
Copy link
Collaborator

closing here, for some time now the response (if no route is found) is:

{"status":207,"status_message": "Cannot find route between points"}

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

No branches or pull requests

2 participants