JSPM

nearest-db-stations

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q32703F
  • License ISC

Find the nearest DB Stations given a Latitude and a Longitude

Package Exports

  • nearest-db-stations

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nearest-db-stations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nearest-db-stations

Searches the nearest stations of Deutsche Bahn, using geokdbush. Data taken from the excellent db-stations package.

build status npm version npm version ISC-licensed

Installing

npm install nearest-db-stations

Usage

const nearestStations = require('nearest-db-stations')

const latitude = 52.509647;
const longitude = 13.375944;

const stations = nearestStations(latitude, longitude);

// Output as in db-stations

API

nearestStations(longitude, latitude[, maxDistance, maxResults])

Returns an array of the closest points from a given location in order of increasing distance.

  • longitude: query point longitude.
  • latitude: query point latitude.
  • maxDistance: (optional) maximum distance in meters to search within (Infinity by default).
  • maxResults: (optional) maximum number of points to return (5 by default).

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

Data License

The Dataset is published under Creative Commons Attribution 4.0 International by Deutsche Bahn (DB).