npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

raido

v2.0.2

Published

Microservice for shortest path routing on Norwegian trails

Downloads

18

Readme

Raidō

Build status Codacy grade Codacy coverage NPM downloads NPM version Node version Dependency status

Microservice for shortest path routing on Norwegian trails using pgRouting and waymarked trails from the Norwegian Mapping Authority (Kartverket).

The name Raidō means "ride, journey" in the runic alphabets is the reconstructed Proto-Germanic name of the r- rune of the Elder Futhark ᚱ. The name is attested for the same rune in all three rune poems, Old Norwegian Ræið Icelandic Reið, Anglo-Saxon Rad.

ᚱ Ræið kveða rossom væsta; Reginn sló sværðet bæzta.

API

GET /v1/routing

  • string source - start point coordinate on the format x,y
  • string target - end point coordinate on the format x,y
  • number path_buffer - route sensitivity / buffer (default 2000)
  • number point_buffer - point sensitivity / buffer (default 10)
  • string bbox - bbox bounding bounds on the format x1,y1,x2,y2
  • number limit - max number of shortest path to return (default 1)

Return shortest path from source to target. Returns a GeometryCollection if a route is found.

Returned route

{
  "type": "GeometryCollection",
  "geometries": [{
    "type": "LineString",
    "coordinates": [...],
    "properties": {
      "cost": 1510.05825002283
    }
  }]
}

Mutliple routes

If you want multiple shortest path you can use the limit query parameter to control the number of routes returned. By default only the shortest route will be returned.

{
  "type": "GeometryCollection",
  "geometries": [{
    "type": "LineString",
    "coordinates": [...],
    "properties": {
      "cost": 1510.05825002283
    }
  },{
    "type": "LineString",
    "coordinates": [...],
    "properties": {
      "cost": 1610.06825002284
    }
  }]
}

Route not found

If the source or target points can not be found or a route between them could not be found the routing will return an empty GeometryCollection.

{
  "type": "GeometryCollection",
  "geometries": []
}

Production

docker run --name postgres turistforeningen/pgrouting-n50:latest
docker run --link postgres turistforeningen/raido:latest -p 8080

Development

Requirements

  • Docker 1.10+
  • Docker Compose v1.4+

Start

docker-compose up

Test

docker-compose run --rm node npm run test
docker-compose run --rm node npm run lint

MIT lisenced