Compare commits
9
Commits
25e604ea21
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79c893eb2b | ||
|
|
33f340d4b3 | ||
|
|
b32b6a1714 | ||
|
|
02a03ffb39 | ||
|
|
06d0ce534a | ||
|
|
726d4bdadf | ||
|
|
dee81a1a16 | ||
|
|
9af1789781 | ||
|
|
dd343e7f88 |
-16
@@ -1,16 +0,0 @@
|
||||
pipeline:
|
||||
deploy:
|
||||
image: appleboy/drone-ssh
|
||||
host: sgeboers.nl
|
||||
user: webapps
|
||||
password:
|
||||
from_secret: password
|
||||
script:
|
||||
- cd /home/webapps/gtfs/code
|
||||
- git pull
|
||||
- cd ..
|
||||
- python3 -m venv env
|
||||
- source env/bin/activate
|
||||
- cd code
|
||||
- pip install -r requirements.txt
|
||||
- bokeh serve main.py
|
||||
@@ -1 +1,2 @@
|
||||
gtfs-data/
|
||||
!gtfs-data/routes.txt
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# GTFS-RT: following transit vehicles in real time
|
||||
This repository contains a script that can be used to host a bokeh server.
|
||||
This bokeh server will show the live locations of busses, trams, metros, and ferrys in the Netherlands (updated every 30 seconds).
|
||||
Note that unfortunately only the data that is provided is shown, which means that some agencies are not shown.
|
||||
|
||||
# Prerequisites
|
||||
One should have a folder called gtfs-data, containing a file called routes.txt.
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ansible-playbook -i inventory.ini deploy.yaml
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
- name: deploy gtfs application
|
||||
hosts: sgeboers.nl
|
||||
remote_user: webapps
|
||||
|
||||
tasks:
|
||||
- name: make directories
|
||||
ansible.builtin.git:
|
||||
repo: https://git.sgeboers.nl/sgeboers/gtfs.git
|
||||
dest: ~/gtfs/code
|
||||
clone: yes
|
||||
force: yes
|
||||
- name: install virtualenv
|
||||
ansible.builtin.pip:
|
||||
name: virtualenv
|
||||
executable: pip3
|
||||
- name: install correct packages
|
||||
ansible.builtin.pip:
|
||||
requirements: ~/gtfs/code/requirements.txt
|
||||
virtualenv: ~/gtfs/env
|
||||
- name: stop old script
|
||||
ansible.builtin.shell:
|
||||
cmd: kill $(ps aux | grep "bokeh serve" | grep -v grep | awk '{print $2}') || true
|
||||
- name: start script
|
||||
ansible.builtin.shell:
|
||||
cmd: . ~/gtfs/env/bin/activate; cd ~/gtfs/code; nohup bokeh serve main.py --allow-websocket-origin=sgeboers.nl:5006 --allow-websocket-origin=gtfs.sgeboers.nl &
|
||||
@@ -0,0 +1 @@
|
||||
sgeboers.nl
|
||||
+309
-269
File diff suppressed because it is too large
Load Diff
@@ -21,7 +21,7 @@ def lonlattowebmercator(df, lon="LON", lat="LAT"):
|
||||
def getPositions():
|
||||
## Get the live locations of the vehicles
|
||||
feed = gtfs_realtime_pb2.FeedMessage()
|
||||
response = requests.get('https://gtfs.ovapi.nl/nl/vehiclePositions.pb')
|
||||
response = requests.get('http://gtfs.ovapi.nl/nl/vehiclePositions.pb')
|
||||
feed.ParseFromString(response.content)
|
||||
vehicle_positions = []
|
||||
|
||||
@@ -72,7 +72,7 @@ my_hover=HoverTool()
|
||||
my_hover.tooltips=[('Type','@route_type_long'),('Route id','@route_short_name'),('Route','@route_long_name')]
|
||||
|
||||
p.add_tools(my_hover)
|
||||
p.circle('x', 'y', source=Source, legend_field='route_type_long', color='color')
|
||||
p.circle('x', 'y', source=Source, legend_field='route_type_long', color='color', size=10)
|
||||
curdoc().add_root(p)
|
||||
curdoc().add_periodic_callback(update,5000)
|
||||
p.legend.location = "top_left"
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ charset-normalizer==2.1.0
|
||||
click==8.1.3
|
||||
click-plugins==1.1.1
|
||||
cligj==0.7.2
|
||||
Fiona==1.8.21
|
||||
Fiona==1.9.3
|
||||
gtfs-realtime-bindings==0.0.7
|
||||
idna==3.3
|
||||
Jinja2==3.1.2
|
||||
|
||||
Reference in New Issue
Block a user