1.1.0 • Published 4 months ago
db-hafas-stations v1.1.0
db-hafas-stations
All Deutsche Bahn (DB) stations returned by their HAFAS API, currently about 299k.
Installation
npm install db-hafas-stations
Note: This Git repo does not contain the data, but the npm package does.
Usage
stations()
returns a readable stream in object mode, emitting Friendly Public Transport Format station
and stop
objects read from db-hafas-stations/data.ndjson
(~14mb).
import readDbHafasStations from 'db-hafas-stations'
for await const (station of readDbHafasStations()) {
console.log(station)
}
{
type: 'station',
id: '8000007',
name: 'Alzey',
weight: 73.1,
location: {
type: 'location',
latitude: 49.7502,
longitude: 8.109749
}
}
// …
readDbHafasStations.full()
returns a readable stream with more fields per object, read from db-hafas-stations/full.ndjson
(~112mb).
Related
db-hafas-stations-autocomplete
– Search for stations of DB (data from HAFAS).db-stations
– A collection of all stations of Deutsche Bahn, computed from open data.hafas-find-stations
– Given a HAFAS client, find all stations in a bounding box.hafas-discover-stations
– Pass in a HAFAS client, discover stations by querying departures.db-stops-search
– Search through all stops/stations indb-hafas-stations
. Formats and imports the stops into a Meilisearch instance.
Contributing
If you have a question or have difficulties using db-hafas-stations
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.