Giter Site home page Giter Site logo

vbb-stations's Introduction

vbb-stations 🚏

A collection of all stations of the Berlin Brandenburg public transport service (VBB), computed from open GTFS data.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install vbb-stations

Usage

The npm package contains Friendly Public Transport Format 1.2.1 stations and stops. weight is the sum of all arrivals & departures at a station, weighted by mode of transport.

[
	{
		type: 'station',
		id: '900000009101',
		name: 'U Amrumer Str.',
		location: {
			type: 'location',
			latitude: 52.542202,
			longitude: 13.349534
		},
		weight: 3563
	}
]

You can filter all stations by id or any property (lodash.get will be used).

const stations = require('vbb-stations')

console.log(stations('900000009101')) // query a single station
console.log(stations({ // filter by property
	weight: 3563,
	'location.latitude': 52.542202
}))

full.json contains all stops of each station and unshortened names.

require('vbb-stations/full.json')['900000009101']

One entry looks like this:

{
	type: 'station',
	id: '900000009101',
	name: 'U Amrumer Str. (Berlin)',
	location: {
		type: 'location',
		latitude: 52.542202,
		longitude: 13.349534
	},
	weight: 3284.25,
	stops: [
		{
			type: 'stop',
			id: '070101000865',
			name: 'U Amrumer Str. (Berlin)',
			station: '900000009101',
			location: {
				type: 'location',
				latitude: 52.542202,
				longitude: 13.349534
			}
		},
		// …
		{
			type: 'stop',
			id: '070201092402',
			name: 'U Amrumer Str. (Berlin)',
			station: '900000009101',
			location: {
				type: 'location',
				latitude: 52.542202,
				longitude: 13.349534
			}
		}
	]
}

names.json contains only shortened names.

require('vbb-stations/names.json')['900000009101'] // U Amrumer Str.

API

stations([pattern])

pattern can be one of the following:

  • a station ID, like 900000009101
  • 'all'
  • an object like {weight: 42, name: 'Alt Pinnow'}, with each property being mandatory

Contributing

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

vbb-stations's People

Contributors

dabendorf avatar derhuerst avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vbb-stations's Issues

An in-range update of tape is breaking the build 🚨

The devDependency tape was updated from 4.9.2 to 4.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tape is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 60 commits.

  • 34b1832 v4.10.0
  • 6209882 Merge all orphaned tags: 'v1.1.2', 'v2.0.2', 'v2.1.1', 'v2.2.2', 'v2.3.3', 'v2.4.3', 'v2.5.1', 'v2.6.1', 'v2.7.3', 'v2.8.1', 'v2.9.1', 'v2.10.3', 'v2.11.1', 'v2.13.4', 'v2.14.0', 'v2.14.1', 'v3.6.1'
  • 82e7b26 [Deps] update glob
  • 9e3d25e [Dev Deps] update eslint, js-yaml
  • fd807f5 v1.1.2
  • eddbff5 v2.14.1
  • 6ce09d9 Minor test tweaks due to whitespace differences in v2 vs v4.
  • 71af8ba gitignore node_modules
  • 4c0d9e6 Merge pull request #268 from ljharb/throws_non_function_should_fail
  • d0a675f v3.6.1
  • d22b5fc Minor test tweaks due to output differences in v1 vs v4.
  • 8b3c1b7 Add missing concat-stream devDep
  • 3495543 gitignore node_modules
  • db81846 Merge pull request #268 from ljharb/throws_non_function_should_fail
  • 7ed6651 Minor test tweaks due to whitespace differences in v3 vs v4.

There are 60 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of vbb-parse-line is breaking the build 🚨

Version 0.2.6 of vbb-parse-line was just published.

Branch Build failing 🚨
Dependency vbb-parse-line
Current Version 0.2.5
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

vbb-parse-line is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 1 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

stations are split apart in dataset

The static dataset contains groups stops into stations, but lots of large stations in Berlin actually still spit up. Consider the following examples.


vbb-stations --columns id,name,lines --name stadtmitte
900000100011 U Stadtmitte   N6 U6
900000100528 U Stadtmitte/Leipziger Str.   M48
900000350632 Oderberg, Stadtmitte   873 874 916 463
900000100018 U Stadtmitte/Krausenstr.   265
900000100701 U Stadtmitte U2   U2
require('vbb-stations/full.json')['900000100011']
{ id: '900000100011',
  name: 'U Stadtmitte (Berlin)',
  latitude: 52.511495,
  longitude: 13.389719,
  weight: 5014.25,
  stops: 
   [ { id: '070101006205',
       name: 'U Stadtmitte (Berlin)',
       latitude: 52.511495,
       longitude: 13.389719 },
     { id: '070101007219',
       name: 'U Stadtmitte (Berlin)',
       latitude: 52.511495,
       longitude: 13.389719 },
     { id: '070201063801',
       name: 'U Stadtmitte (Berlin)',
       latitude: 52.511495,
       longitude: 13.389719 },
     { id: '070201063802',
       name: 'U Stadtmitte (Berlin)',
       latitude: 52.511495,
       longitude: 13.389719 } ] }
require('vbb-stations/full.json')['900000100701']
{ id: '900000100701',
  name: 'U Stadtmitte U2 (Berlin)',
  latitude: 52.512169,
  longitude: 13.389711,
  weight: 4182.5,
  stops: 
   [ { id: '070201023101',
       name: 'U Stadtmitte U2 (Berlin)',
       latitude: 52.512169,
       longitude: 13.389711 },
     { id: '070201023102',
       name: 'U Stadtmitte U2 (Berlin)',
       latitude: 52.512169,
       longitude: 13.389711 } ] }

vbb-stations --columns id,name,lines --name alexanderplatz
900000100003 S+U Alexanderplatz   M48 RE2 RB14 RE1 RE1 RE RE7 RE7 EV S7 S5 S5 S…
900000100006 S+U Alexanderplatz/Grunerstr.   U5 S7
900000100005 U Alexanderplatz [Tram]   M4 M5 M6
900000100024 S+U Alexanderplatz/Dircksenstr.   M2
900000100026 S+U Alexanderplatz/Gontardstr.   M4 M5 M6
900000100031 S+U Alexanderplatz/Memhardstr.   100 200 M48 N2 N5 N42 TXL S7
900000100703 S+U Alexanderplatz [U2]   U2
900000100704 S+U Alexanderplatz [U5]   U5
900000100705 S+U Alexanderplatz [U8]   U8
900000100707 U Alexanderplatz [Bus]   N5 N65
900000100708 S+U Alexanderplatz (Bln) [Bus K.-L…   100 200 M48 N5 TXL
require('vbb-stations/full.json')['900000100003']
{ id: '900000100003',
  name: 'S+U Alexanderplatz Bhf (Berlin)',
  latitude: 52.521512,
  longitude: 13.411267,
  weight: 13003.5,
  stops: 
   [ { id: '060100003723',
       name: 'S+U Alexanderplatz Bhf (Berlin)',
       latitude: 52.521512,
       longitude: 13.411267 },
     { id: '060100003724',
       name: 'S+U Alexanderplatz Bhf (Berlin)',
       latitude: 52.521512,
       longitude: 13.411267 },
     { id: '000008011155',
       name: 'S+U Alexanderplatz Bhf (Berlin)',
       latitude: 52.521512,
       longitude: 13.411267 },
     { id: '710009100003',
       name: 'S+U Alexanderplatz Bhf (Berlin)',
       latitude: 52.521512,
       longitude: 13.411267 },
     { id: '070101007155',
       name: 'S+U Alexanderplatz Bhf (Berlin)',
       latitude: 52.521512,
       longitude: 13.411267 } ] }
require('vbb-stations/full.json')['900000100703']
{ id: '900000100703',
  name: 'S+U Alexanderplatz (Berlin) [U2]',
  latitude: 52.522078,
  longitude: 13.413598,
  weight: 4210.5,
  stops: 
   [ { id: '070201022601',
       name: 'S+U Alexanderplatz (Berlin) [U2]',
       latitude: 52.522078,
       longitude: 13.413598 },
     { id: '070201022602',
       name: 'S+U Alexanderplatz (Berlin) [U2]',
       latitude: 52.522078,
       longitude: 13.413598 } ] }
require('vbb-stations/full.json')['900000100704']
{ id: '900000100704',
  name: 'S+U Alexanderplatz (Berlin) [U5]',
  latitude: 52.521607,
  longitude: 13.413111,
  weight: 4564,
  stops: 
   [ { id: '070201054001',
       name: 'S+U Alexanderplatz (Berlin) [U5]',
       latitude: 52.521607,
       longitude: 13.413111 },
     { id: '070201054002',
       name: 'S+U Alexanderplatz (Berlin) [U5]',
       latitude: 52.521607,
       longitude: 13.413111 } ] }
require('vbb-stations/full.json')['900000100705']
{ id: '900000100705',
  name: 'S+U Alexanderplatz (Berlin) [U8]',
  latitude: 52.521619,
  longitude: 13.412125,
  weight: 2520,
  stops: 
   [ { id: '070201083601',
       name: 'S+U Alexanderplatz (Berlin) [U8]',
       latitude: 52.521619,
       longitude: 13.412125 },
     { id: '070201083602',
       name: 'S+U Alexanderplatz (Berlin) [U8]',
       latitude: 52.521619,
       longitude: 13.412125 } ] }

An in-range update of csv-parser is breaking the build 🚨

The devDependency csv-parser was updated from 2.3.0 to 2.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

csv-parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 15 commits.

  • 43c5975 chore(release): 2.3.1
  • 1a4c6a4 chore: update joi
  • f0970ab chore: remove generate-function dep
  • 22cb899 chore: update dependencies
  • b1db54c docs: mapHeaders and mapValues verbosity. fixes #141
  • e3cf330 refactor: remove generate-function, improve perf
  • 2ef1238 chore: data -> fixtures, update benchmarks for node v12
  • 46016da chore: add linting and coverage to ci
  • 55aac1f chore: fix linting errors
  • f45214d chore: update dev dependencies
  • 9863281 chore: update travis node versions
  • 3755ebe chore: Merge branch 'master' of github.com:mafintosh/csv-parser
  • 0e25a77 chore: bump minimum node version
  • bb604b8 test: add test for numeric/index headers
  • 615f591 fix: inverted row/column doc README.md (#130)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Osloer Straße exists twice

curl -s 'https://vbb-gtfs.jannisr.de/2017-06-06/stops.txt' | grep Osloer | grep Str | grep '^90'
900000009202,"","U Osloer Str. (Berlin)",,"52.556938000000","13.373284000000",1,
900000009204,"","Berlin, Osloer Str./Prinzenallee",,"52.555936000000","13.383663000000",1,
900000009272,"","U Osloer  Str. (Berlin)",,"52.558016000000","13.372492000000",1,

Yorckstr. has 4 stops at the same location

I assume this is not intended.

// [email protected]
const s = require('vbb-stations/full.json')
console.log(s['900000057102'].stops)
[ {
	type: 'stop',
	id: '060057102801',
	name: 'S+U Yorckstr. S1 U7 (Berlin)',
	station: '900000057102',
	location: {
		type: 'location',
		latitude: 52.492345,
		longitude: 13.367986
	}
}, {
	type: 'stop',
	id: '060057102802',
	name: 'S+U Yorckstr. S1 U7 (Berlin)',
	station: '900000057102',
	location: {
		type: 'location',
		latitude: 52.492345,
		longitude: 13.367986
	}
}, {
	type: 'stop',
	id: '070101001338',
	name: 'S+U Yorckstr. S1 U7 (Berlin)',
	station: '900000057102',
	location: {
		type: 'location',
		latitude: 52.492345,
		longitude: 13.367986
	}
}, {
	type: 'stop',
	id: '070101004006',
	name: 'S+U Yorckstr. S1 U7 (Berlin)',
	station: '900000057102',
	location: {
		type: 'location',
		latitude: 52.492345,
		longitude: 13.367986
	}
} ]

An in-range update of vbb-parse-line is breaking the build 🚨

Version 0.2.1 of vbb-parse-line just got published.

Branch Build failing 🚨
Dependency vbb-parse-line
Current Version 0.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As vbb-parse-line is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 4 commits .

  • a96e130 0.2.1
  • 69fda3b German national trains
  • 0b88697 5N night bus, 5xx & 7xx buses, tests :white_check_mark:
  • 8d2430a Node 6+ :green_heart:, cleanup

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

missing station "Bulgarische Straße"

The HAFAS API has a station 900190509 called Bulgarische Str. (Berlin) that does not appear in the static data.

curl 'https://vbb-gtfs.jannisr.de/latest/stops.txt' | grep 900190509 # empty result
curl 'https://vbb-gtfs.jannisr.de/latest/stops.txt' | grep -i bulgarische # empty result

An in-range update of csv-parser is breaking the build 🚨

The devDependency csv-parser was updated from 2.0.0 to 2.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

csv-parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v2.1.0

Bugfixes

  • fix: mapHeaders error when using binary. fixes #99 (a22f006)
  • fix: bin version. fixes #98 (2c95c35)

Features

  • feat: maxRowBytes to limit row length (#88)

Updates

  • docs: remove extraneous skipLines. fixes #96 (16944c1)
Commits

The new version differs by 5 commits.

  • 383060e chore(release): 2.1.0
  • a22f006 fix: fixes #99. mapHeaders error when using binary
  • 2c95c35 fix: bin version. fixes #98
  • 5ed860c feat: maxRowBytes to limit row length (#88)
  • 16944c1 docs: remove extraneous skipLines. fixes #96

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.