Skip to content

Commit

Permalink
Implement NodeJS based server fully replicating osrm-routed
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Oct 22, 2022
1 parent ba9cc7c commit 98dce89
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ jobs:
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
make --jobs=${JOBS}
popd
- run: npm link
- run: cd routed-js && npm ci && npm link
- run: osrm-routed-js --version
- name: Run all tests
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_APPLE_SILICON != 'ON' }}
Expand Down
1 change: 1 addition & 0 deletions features/options/routed/invalid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: osrm-routed command line options: invalid options
Background:
Given the profile "testbot"

@skip_on_routed_js
Scenario: osrm-routed - Non-existing option
When I try to run "osrm-routed --fly-me-to-the-moon"
Then stdout should be empty
Expand Down
4 changes: 2 additions & 2 deletions features/testbot/snap_intersection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ Feature: Snapping at intersections
| a,f,k | ac,cf,cf,fj,kj,kj | 132.8s | 132.8 |
| k,f | ik,fi,fi | 54.3s | 54.3 |
| f,a | ef,ae,ae | 66.6s | 66.6 |
| k,f,a | kj,fj,fj,ef,ae,ae | 141.399999999s | 141.399999999 |
| k,f,a | kj,fj,fj,ef,ae,ae | 141.399999999s +- 1e-7 | 141.399999999 +- 1e-7 |

When I request a travel time matrix I should get
| | a | f | k |
Expand Down Expand Up @@ -626,4 +626,4 @@ Feature: Snapping at intersections
| a,f,k | ad,df,df,fj,kj,kj | 105.6s | 105.6 |
| k,f | ik,fi,fi | 54.3s | 54.3 |
| f,a | ef,ae,ae | 66.6s | 66.6 |
| k,f,a | ik,fi,fi,ef,ae,ae | 120.899999999s | 120.899999999 |
| k,f,a | ik,fi,fi,ef,ae,ae | 120.899999999s +- 1e-7 | 120.899999999 +- 1e-7 |
44 changes: 44 additions & 0 deletions routed-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions routed-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"access": "public"
},
"devDependencies": {
"@types/node": "^18.11.3",
"@types/yargs": "^17.0.13",
"typescript": "^4.8.4"
}
}
2 changes: 1 addition & 1 deletion routed-js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,6 @@ function parseCoordinatesAndFormat(coordinatesAndFormat) {
if (!coordinatesSchema(coordinates)) {
throw { message: 'Invalid coordinates', code: 'InvalidQuery' };
}
return { coordinates, format };
return { coordinates: coordinates, format };
}
exports.parseCoordinatesAndFormat = parseCoordinatesAndFormat;
2 changes: 1 addition & 1 deletion routed-js/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,5 @@ export function parseCoordinatesAndFormat(coordinatesAndFormat: string): { coord
if (!coordinatesSchema(coordinates)) {
throw {message: 'Invalid coordinates', code: 'InvalidQuery'};
}
return { coordinates, format };
return { coordinates: coordinates as [number, number][], format };
}

0 comments on commit 98dce89

Please sign in to comment.