diff options
| author | Max Bringemo <maxbr167@student.liu.se> | 2020-12-14 21:08:59 +0100 |
|---|---|---|
| committer | Stefan Hansson <steha708@student.liu.se> | 2020-12-14 21:08:59 +0100 |
| commit | 325f2078c37bc073fff964946a2ce643d181fa3d (patch) | |
| tree | ba07a6e94989ef44335619f1547e521280461a61 /server.py | |
| parent | 542aa50ad4bae5e719bcffc9265a15824a444284 (diff) | |
| download | tdde25-325f2078c37bc073fff964946a2ce643d181fa3d.tar.gz | |
Grid search
Diffstat (limited to 'server.py')
| -rw-r--r-- | server.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -4,13 +4,17 @@ import algorithms import store from lib import run_server, get, post, read_html +grid = None nodes = None @get('/') def index(): global nodes - nodes = store.extract_osm_nodes("university.osm") + global grid + + nodes, grid = store.extract_osm_nodes("university.osm") + return read_html('templates/index.html') @@ -43,7 +47,8 @@ def shortest_path(body): path = algorithms.find_shortest_path(nodes, source_id, target_id) print(path) - response = {"path": [(nodes[node].lat, nodes[node].lng) for node in path]} + response = { + "path": [(nodes[node].lat, nodes[node].lng) for node in path]} return json.dumps(response) |
