Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vbb-shapes

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vbb-shapes

Shapes of VBB lines.

  • 4.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35
increased by337.5%
Maintainers
0
Weekly downloads
 
Created
Source

vbb-shapes

Shapes of lines of the Berlin Brandenburg public transport service (VBB), computed from open GTFS data.

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

Installing

Warning: This module contains JSON files with a total size of roughly 60mb.

npm install vbb-shapes

Usage

Let's assume you read trips from vbb-trips. Each trip has a shapeId associated.

const shapes = require('vbb-shapes')

shapes('1269')
.then(console.log)
[
	[52.48607, 13.4245],
	[52.48756, 13.42648],
	// …
	[52.5135, 13.52988],
	[52.51373, 13.52003]
]

You can also read all shapes from a readable stream in object mode, emitting one shape (as shown above) at once.

const allShapes = require('vbb-shapes/all')

allShapes()
.on('data', console.log)
.on('error', console.error)

GeoJSON encoded result

By adding the optional param formatAsLineString = true you'll receive a GeoJSON encoded result set.

const shapes = require('vbb-shapes')

shapes('1269', true)
.then(console.log)
{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [13.4245, 52.48607],
                    [13.42648, 52.48756],
                    // …
                    [13.52988, 52.5135],
                    [13.52003, 52.51373]
                ]
            },
            "properties": {}
        }
    ]
}

For all shapes:

const allShapes = require('vbb-shapes/all')

allShapes(true)
.on('data', console.log)
.on('error', console.error)

Contributing

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

Keywords

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc