From d4453186238f0e3cb38fddbb49208a8a404e73d6 Mon Sep 17 00:00:00 2001
From: Sara <sarasdj@stud.ntnu.no>
Date: Thu, 14 Mar 2024 12:30:57 +0100
Subject: [PATCH] update: overpass query instructions

---
 server/lake_relations/overpass_query.txt | 16 +++++++++++++++-
 server/map/get_relation.py               |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/server/lake_relations/overpass_query.txt b/server/lake_relations/overpass_query.txt
index 611940c7..4d011e20 100644
--- a/server/lake_relations/overpass_query.txt
+++ b/server/lake_relations/overpass_query.txt
@@ -1 +1,15 @@
-The following query
\ No newline at end of file
+The following query is used to retrieve the relation(shape) of a lake.
+Go to https://overpass-turbo.eu/#, enter the query in the left field, add
+the name of the lake you want to add, and press 'run'.
+If a text box saying "" appears, press 'continue anyways'. Double check that you have
+the correct lake, then press 'Export'. In the 'Export' menu, download the shape data as
+GeoJson. Once downloaded, name the file the *lakeName.json, and move the file into
+IceMap/server/lake_relations. Once you have added the file, run map division...
+
+[out:json];
+(
+  way["natural"="water"]["name"="lakeName"];
+  relation["natural"="water"]["name"="lakeName"];
+);
+(._;>;);
+out body;
\ No newline at end of file
diff --git a/server/map/get_relation.py b/server/map/get_relation.py
index 58175d85..ab52cfcf 100644
--- a/server/map/get_relation.py
+++ b/server/map/get_relation.py
@@ -104,7 +104,7 @@ def write_json_to_file(path: str, file_name: str, json_data: dict):
     if not os.path.exists(path):
         raise Exception("Directory from path does not exist")
 
-    with open(path + '/' + file_name, 'w') as f:
+    with open(path + '/' + file_name + '_div.json', 'w') as f:
         json.dump(json_data, f)
 
 
-- 
GitLab