Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hjälpCreate tramdata.py #16

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
214a18d
Create tramnetwork.json
felixarv Nov 12, 2024
26caec0
Create tramdata.py
filiplarsen231 Nov 12, 2024
088c579
Merge branch 'main' of https://github.com/felixarv/chalmers-advanced-…
filiplarsen231 Nov 12, 2024
9298eba
Update tramdata.py
filiplarsen231 Nov 12, 2024
d16edfa
Update tramdata.py
felixarv Nov 12, 2024
bec7b51
Merge branch 'main' of https://github.com/felixarv/chalmers-advanced-…
felixarv Nov 12, 2024
4a94e01
Update tramdata.py
felixarv Nov 12, 2024
1d02a1b
Update tramdata.py
felixarv Nov 12, 2024
11b5fa1
Update tramdata.py
felixarv Nov 12, 2024
0962df8
Update tramdata.py
felixarv Nov 12, 2024
f217e7e
Update tramdata.py
felixarv Nov 12, 2024
de8b49e
Create tramdata.py
viktorwaller Nov 12, 2024
f369d91
Merge branch 'main' of https://github.com/felixarv/chalmers-advanced-…
filiplarsen231 Nov 12, 2024
2e32aeb
Update tramdata.py
filiplarsen231 Nov 12, 2024
1429c80
Create tramnetwork.json
filiplarsen231 Nov 12, 2024
5a863a1
Merge branch 'filip'
filiplarsen231 Nov 12, 2024
bca6982
Merge branch 'main' into Viktors
viktorwaller Nov 12, 2024
96645e8
Update tramdata.py
viktorwaller Nov 12, 2024
2e45c3c
Merge branch 'main' of https://github.com/felixarv/chalmers-advanced-…
viktorwaller Nov 12, 2024
9aa121e
Merge branch 'main' into Viktors
viktorwaller Nov 12, 2024
61ce804
Update tramdata.py
viktorwaller Nov 12, 2024
d92efae
Update tramdata.py
viktorwaller Nov 12, 2024
ac0ceab
Update tramdata.py
viktorwaller Nov 12, 2024
2f39d60
Update tramdata.py
viktorwaller Nov 12, 2024
a6f4939
Merge branch 'main' into Viktors
viktorwaller Nov 12, 2024
f3edc21
Update tramdata.py
viktorwaller Nov 12, 2024
6c3e9d1
Update tramdata.py
viktorwaller Nov 12, 2024
7863846
Update tramdata.py
viktorwaller Nov 12, 2024
44d1270
Tramstops fixad
filiplarsen231 Nov 12, 2024
cb5bf33
Update tramdata.py
viktorwaller Nov 12, 2024
98aeea8
Merge branch 'main' into Viktors
viktorwaller Nov 12, 2024
c51a6bc
Update tramdata.py
viktorwaller Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions labs/lab1/tramdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import json

TRAM_STOP_FILE = "labs/data/tramstops.json"
with open(TRAM_STOP_FILE, 'r') as fromFile:
data = json.load(fromFile)

#print(json.dumps(data, indent=2, ensure_ascii=False))

def build_tram_stops(jsonobject):

stopdict = {x: {"lat":jsonobject[x]['position'][0], "lon":jsonobject[x]['position'][1]} for x in jsonobject}

return stopdict

print(build_tram_stops(data))

def build_tram_lines(lines):
pass

def build_tram_network(stopfile, linefile):
pass

def lines_via_stop(linedict, stop):
pass

def lines_between_stops(linedict, stop1, stop2):
pass

def time_between_stops(linedict, timedict, line, stop1, stop2):
pass

def distance_between_stops(stopdict, stop1, stop2):
pass

def dialogue(tramfile):
pass
Empty file added labs/lab1/tramnetwork.json
Empty file.
Loading