Giter VIP home page Giter VIP logo

hafas-linked-connections-server's Introduction

hafas-linked-connections-server

Create a Linked Connections endpoint from a HAFAS client. Very hacky & slow.

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

Installation

npm install hafas-linked-connections-server

Usage

'use strict'

const createHafasClient = require('hafas-client')
const vbbProfile = require('hafas-client/p/vbb')
const createServer = require('hafas-linked-connections-server.')

const hafasClient = createHafasClient(vbbProfile, 'my awesome program')

const baseUrl = 'https://my-linked-connections-endpoint/'
const bbox = { // Berlin
	north: 52.53,
	west: 13.355,
	south: 52.5,
	east: 13.43
}

const server = createServer(baseUrl, hafasClient, bbox)
server.listen(3000)

Note: Because linked open data tools tend to re-fetch resources often, I strongly recommend to use hafas-linked-connections-server with cached-hafas-client. example.js shows how to do it.

Contributing

If you have a question or need support using hafas-linked-connections-server, 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.

hafas-linked-connections-server's People

Contributors

derhuerst avatar hdelva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hafas-linked-connections-server's Issues

Geospatial tiling of all of hafas

Nice to have idea:

Now you can configure the server on a specific bbox. What if we’d extend the URI template to this:

https://example.org/{z}/{x}/{y}/{connections|stops}/{?t}

With z the zoom level, x the longitude of the tile and y the latitude? You can of course disable zoom levels that would be too difficult to handle on the server-side.

You can describe this interface with hypermedia in the same way as the Routable Tiles spec: https://openplanner.team/specs/2018-11-routable-tiles.html

Open questions: how to handle this in planner.js.org? What extra metadata do we need to know what viewport to download for getting a complete answer to a route planning question? (These questions are currently being tackled by my team)

List of stops in a bbox

Could another endpoint be added to fetch the stops in the configured bbox? That way, we’d be able to visualize the stops on a map, as well as snap it to OSM to calculate transfers between stops automatically.

An example of what we need: https://graph.irail.be/sncb/stops

@id, name, longitude and latitude would be great to be able to visualize the stop!

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.