Skip to content

oopjot/bus-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bus tracker

Gdansk Open API.

Running

Try it out with Docker

docker run -d -p 8000:8000 oopjot/tracker

Usage

Information about lines X, Y and Z are served via websocket

ws://0.0.0.0:8000/vehicles?lines=X,Y,Z

To test it, just reach the endpoint with ws tool (e. g. wscat).

wscat -c "ws://0.0.0.0:8000/vehicles?lines=10,100,111"

Data

Then, JSON is emmited.

type Vehicle struct {
  DataGenerated string
  Line string
  Route string
  VehicleCode string
  VehicleService string
  Id int
  Speed: int 
  Delay int
  Lat float64
  Lon float64
  GpsQuality int
  B float64
}

B is a calculated bearing angle.

Todo

  • emit batch of data on connection
  • move port number to some config file, or use env variable
  • integrate other APIs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published