Compare commits

...
9 Commits
Author SHA1 Message Date
sgeboers 79c893eb2b Merge branch 'main' of git.sgeboers.nl:sgeboers/gtfs 2023-05-09 21:30:07 +02:00
sgeboers 33f340d4b3 updated routes.txt and included ansible directory 2023-05-09 21:29:38 +02:00
sgeboers b32b6a1714 updated routes.txt 2023-05-09 20:41:21 +02:00
sgeboers 02a03ffb39 disabled https 2023-05-09 17:28:20 +02:00
sgeboers 06d0ce534a update routes.txt 2023-03-24 13:55:27 +01:00
sgeboers 726d4bdadf updated routes.txt, ansible script 2023-03-09 16:32:00 +01:00
sgeboers dee81a1a16 some more information for missing data
continuous-integration/drone/push Build is failing
2023-03-09 16:21:55 +01:00
sgeboers 9af1789781 circle size
continuous-integration/drone/push Build is failing
2023-02-11 14:12:31 +01:00
sgeboers dd343e7f88 ansible directory 2023-02-07 13:28:07 +01:00
9 changed files with 343 additions and 288 deletions
-16
View File
@@ -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
View File
@@ -1 +1,2 @@
gtfs-data/ gtfs-data/
!gtfs-data/routes.txt
+1
View File
@@ -1,6 +1,7 @@
# GTFS-RT: following transit vehicles in real time # GTFS-RT: following transit vehicles in real time
This repository contains a script that can be used to host a bokeh server. 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). 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 # Prerequisites
One should have a folder called gtfs-data, containing a file called routes.txt. One should have a folder called gtfs-data, containing a file called routes.txt.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
ansible-playbook -i inventory.ini deploy.yaml
+26
View File
@@ -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 &
+1
View File
@@ -0,0 +1 @@
sgeboers.nl
+309 -269
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -21,7 +21,7 @@ def lonlattowebmercator(df, lon="LON", lat="LAT"):
def getPositions(): def getPositions():
## Get the live locations of the vehicles ## Get the live locations of the vehicles
feed = gtfs_realtime_pb2.FeedMessage() 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) feed.ParseFromString(response.content)
vehicle_positions = [] 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')] my_hover.tooltips=[('Type','@route_type_long'),('Route id','@route_short_name'),('Route','@route_long_name')]
p.add_tools(my_hover) 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_root(p)
curdoc().add_periodic_callback(update,5000) curdoc().add_periodic_callback(update,5000)
p.legend.location = "top_left" p.legend.location = "top_left"
+1 -1
View File
@@ -5,7 +5,7 @@ charset-normalizer==2.1.0
click==8.1.3 click==8.1.3
click-plugins==1.1.1 click-plugins==1.1.1
cligj==0.7.2 cligj==0.7.2
Fiona==1.8.21 Fiona==1.9.3
gtfs-realtime-bindings==0.0.7 gtfs-realtime-bindings==0.0.7
idna==3.3 idna==3.3
Jinja2==3.1.2 Jinja2==3.1.2