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

NodeJS version of osrm-routed #4604

Closed
wants to merge 4 commits into from
Closed

NodeJS version of osrm-routed #4604

wants to merge 4 commits into from

Conversation

danpat
Copy link
Member

@danpat danpat commented Oct 12, 2017

Issue

This PR implements an experimental port of osrm-routed to NodeJS using express as the URL router.

Currently a WIP - all tests pass, but a few error messages have changed, and working on it has shown that our error scenario coverage is not really very complete.

  • Fix trip plugin, or delete bad trip test - one test expects to set source=last, which according to our docs, is not valid
  • Discuss error messages - because URL parser is not boost, getting char offset messages is much harder - are we tied to the old error strings?
  • Result precision - there are some rounding changes in some values - should these be fixed, or are they ok to slip through?
  • Tidy up/refactor lib/index.js changes
  • Support all osrm-routed command-line options and generate help message
  • Blocked by InvalidUrl with polyline #4690 (polyline URL support)
  • Support max search radius for a map-matching requests. Issue is here

Tasklist

  • ADD OWN TASKS HERE
  • update relevant Wiki pages
  • add regression / cucumber cases (see docs/testing.md)
  • review
  • adjust for comments

@emiltin
Copy link
Contributor

emiltin commented Oct 13, 2017

good idea, i think many people miss this part of the tool chain

| route/v1/driving/1,1;1 | 400 | Coordinates must be an array of (lon/lat) pairs |
| route/v1/driving/1,1;1,1,1 | 400 | Coordinates must be an array of (lon/lat) pairs |
| route/v1/driving/1,1;x | 400 | Coordinates must be an array of (lon/lat) pairs |
| route/v1/driving/1,1;x,y | 400 | Lng/Lat coordinates must be valid numbers |
Copy link
Member

Choose a reason for hiding this comment

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

Why the changes here?

@@ -47,7 +47,7 @@ class OSRMBaseLoader{
if (err) {
if (retryCount < 10) {
retryCount++;
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 10);
setTimeout(() => { tryConnect(this.scope.OSRM_PORT, retry); }, 100);
Copy link
Member

Choose a reason for hiding this comment

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

Why the change here? Is 10s no longer enough?

@@ -96,6 +96,7 @@ Feature: Basic trip planning
| waypoints | source | trips |
| a,b,c,d,e,f,g,h,i,j,k,l | first | alkjihgfedcba |

@todo
Copy link
Member

Choose a reason for hiding this comment

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

Why disabling this test?

std::strcpy(buffer.get(), code);
std::strcat(buffer.get(), ": ");
std::strcat(buffer.get(), message);
throw std::logic_error(buffer.get());
Copy link
Member

Choose a reason for hiding this comment

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

Please change the last couple of lines to

const auto code = .. .value;
const auto message = .. .value;
// both are of type std::string now, see https://github.com/Project-OSRM/osrm-backend/blob/031ce72db1bdb724527096703c55741a7c7f572c/include/util/json_container.hpp#L81
throw std::logic_error{code + ": " + message}

}
else
{
throw std::logic_error(code_iter->second.get<osrm::json::String>().value.c_str());
Copy link
Member

Choose a reason for hiding this comment

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

logic_error should have a ctor taking a std::string; the c_str is not needed here

@TheMarex
Copy link
Member

TheMarex commented Sep 3, 2021

Not really a big priority anymore given that docker kind of won. Also turns out going through the V8 serialization layer is not for free, so the C++ based HTTP server is actually quite a bit faster.

@TheMarex TheMarex closed this Sep 3, 2021
@DennisOSRM DennisOSRM deleted the osrm-routed.js branch November 6, 2022 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants