diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 12:36:30 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2020-11-20 17:24:18 +0100 |
| commit | 8dc4ab65266cfd0f3d0605a52fa118c70cf2f9ac (patch) | |
| tree | 50846c09b46ca9873448477b6eeefa5a7bdbdda5 /server.py | |
| parent | 4ca646cd6a1207f084a9d56df0ba90c8fdbf13f5 (diff) | |
| download | tdde25-8dc4ab65266cfd0f3d0605a52fa118c70cf2f9ac.tar.gz | |
use grid-search when finding closest nodegrid-search
Diffstat (limited to 'server.py')
| -rw-r--r-- | server.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -20,8 +20,8 @@ def index(): @post('/shortest-path') def shortest_path(body): body = json.loads(body) - source_id = algorithms.get_closest_node_id(nodes, store.Node(-1, body['lat1'], body['lng1'])) - target_id = algorithms.get_closest_node_id(nodes, store.Node(-1, body['lat2'], body['lng2'])) + source_id = algorithms.get_closest_node_id(nodes, grid, store.Node(-1, body['lat1'], body['lng1'])) + target_id = algorithms.get_closest_node_id(nodes, grid, store.Node(-1, body['lat2'], body['lng2'])) path = algorithms.find_shortest_path(nodes, source_id, target_id) print(path) |
