Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Routing engine for OpenStreetMap data implementing high-performance algorithms for shortest paths in road networks.
Provides bindings to the Open Source Routing Machine - OSRM.
By default, binaries are provided for:
On those platforms no external dependencies are needed.
Just do:
npm install osrm
However other platforms will fall back to a source compile: see Source Build for details.
The node-osrm
module consumes data processed by OSRM core.
This repository contains a Makefile that does this automatically:
osrm-extract
and osrm-prepare
Just run:
make berlin-latest.osrm.hsgr
Once that is done then you can calculate routes in Javascript like:
// Note: to require osrm locally do:
// require('./lib/osrm.js')
var osrm = require('osrm')
var opts = new osrm.Options("./test/data/berlin.ini");
var engine = new osrm.Engine(opts);
var query = new osrm.Query({coordinates: [[52.519930,13.438640], [52.513191,13.415852]]});
var sync_result = engine.run(query);
JSON.parse(engine.run(query));
{ status: 0,
status_message: 'Found route between points',
route_geometry: '{~pdcBmjfsXsBrD{KhS}DvHyApCcf@l}@kg@z|@_MbX|GjHdXh^fm@dr@~\\l_@pFhF|GjCfeAbTdh@fFqRp}DoEn\\cHzR{FjLgCnFuBlG{AlHaAjJa@hLXtGnCnKtCnFxCfCvEl@lHBzA}@vIoFzCs@|CcAnEQ~NhHnf@zUpm@rc@d]zVrTnTr^~]xbAnaAhSnPgJd^kExPgOzk@maAx_Ek@~BuKvd@cJz`@oAzFiAtHvKzAlBXzNvB|b@hGl@Dha@zFbGf@fBAjQ_AxEbA`HxBtPpFpa@rO_Cv_B_ZlD}LlBGB',
route_instructions:
[ ... ],
route_summary:
{ total_distance: 2814,
total_time: 211,
start_point: 'Friedenstraße',
end_point: 'Am Köllnischen Park' },
alternative_geometries: [],
alternative_instructions: [],
alternative_summaries: [],
route_name:
[ 'Lichtenberger Straße',
'Holzmarktstraße' ],
alternative_names: [ [ '', '' ] ],
via_points:
[ [ 52.519934, 13.438647 ],
[ 52.513162, 13.415509 ] ],
via_indices: [ 0, 69 ],
alternative_indices: [],
hint_data:
{ checksum: 222545162,
locations:
[ '9XkCAJgBAAAtAAAA____f7idcBkPGuw__mMhA7cOzQA',
'TgcEAFwFAAAAAAAAVAAAANIeb5DqBHs_ikkhA1W0zAA' ] } }
To build from source you will need:
develop
branch, cloned from github.-DWITH_TOOLS=1
so that libOSRM
is createdTo build with OS X Mavericks you need to ensure the bindings link to libc++
. An easy way to do this is to set:
export CXXFLAGS=-mmacosx-version-min=10.9
before building node-osrm
.
To build the bindings you need to first build and install the develop
branch of Project-OSRM
:
# grab develop branch
git clone -b develop https://github.com/DennisOSRM/Project-OSRM.git
cd Project-OSRM
mkdir build;
cd build;
cmake ../ -DWITH_TOOLS=1
make
sudo make install
NOTE: If you hit problems building Project-OSRM see the wiki for details.
Then build node-osrm
against Project-OSRM
installed in /usr/local
:
git clone https://github.com/DennisOSRM/node-osrm.git
cd node-osrm
npm install
Developers of node-osrm
should set up a Source Build and after changes to the code run:
make
Under the hood this uses node-gyp to compile the source code.
Run the tests like:
make test
Releasing a new version of node-osrm
requires:
1) Confirm the desired OSRM branch and commit.
This is configurable via the OSRM_BRANCH
and OSRM_COMMIT
variables in travis.ci.
See Issue 36 for further ideas on streamlining this.
2) Bump node-osrm version
Change the package.json version:
-alpha
if you are testing experimental features or binary packaging.-alpha
if you are preparting for a stable release and increment if needed.3) Tag
Tag a new release:
git tag v0.3.0 -m "Tagging v0.3.0
4) Push the tag to github:
git push --tags
This will trigger travis.ci to build Ubuntu binaries and publish the entire package to the npm registry upon success. The publishing will use the s3 and npm auth credentials of @springmeyer currently - this needs to be made more configurable in the future.
5) Merge master
into the osx
branch
git checkout osx
git pull origin master --no-commit
git commit -a -m "[publish-binary]"
This will build and publish OS X binaries on travis.ci. Be prepared to watch the travis run and re-start builds that fail due to timeouts (the OS X machines are underpowered).
6) You are done
If the travis builds succeeded then you can rest assured the binaries are working since they not only publish but also test installing from what they published.
Now go ahead and use the new tag in your applications package.json
as a dependency and you will get binaries rather than needing a source compile.
FAQs
The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.
The npm package osrm receives a total of 265 weekly downloads. As such, osrm popularity was classified as not popular.
We found that osrm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 21 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.