From 4311a3c3dd1fb355730a6e1a740ae26ba1390c35 Mon Sep 17 00:00:00 2001
From: Sara <sarasdj@stud.ntnu.no>
Date: Sun, 17 Mar 2024 12:31:05 +0100
Subject: [PATCH] update: minor fixes

---
 app/lib/pages/widgets/cloropleth_map.dart     |   2 +-
 server/consts.py                              |   2 +-
 server/main.py                                |   1 -
 .../__pycache__/get_relation.cpython-311.pyc  | Bin 6071 -> 6073 bytes
 server/map/get_relation.py                    |   7 +++----
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/app/lib/pages/widgets/cloropleth_map.dart b/app/lib/pages/widgets/cloropleth_map.dart
index 9c59c4fd..55afa8df 100644
--- a/app/lib/pages/widgets/cloropleth_map.dart
+++ b/app/lib/pages/widgets/cloropleth_map.dart
@@ -54,7 +54,7 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
             MapShapeLayer(
               source: MapShapeSource.memory( // Map polygon
                 widget.relation, // JSON coordinates from server
-                shapeDataField: 'properties.SubDivID',
+                shapeDataField: 'properties.sub_div_id',
                 dataCount: iceThicknessList.length,
                 primaryValueMapper: (int index) => iceThicknessList[index].subDivID,
                 shapeColorValueMapper: (int index) => iceThicknessList[index].thickness,
diff --git a/server/consts.py b/server/consts.py
index 5653feea..6be29cfb 100644
--- a/server/consts.py
+++ b/server/consts.py
@@ -10,4 +10,4 @@ SSL_KEY_PATH = CERT_DIR + "testKey.key"
 SSL_CERT_PATH = CERT_DIR + "testCert.crt"
 
 # Measurement specs
-AREA_SIZE = 20
\ No newline at end of file
+AREA_SIZE = 20
diff --git a/server/main.py b/server/main.py
index 96c92a65..aeef2812 100644
--- a/server/main.py
+++ b/server/main.py
@@ -5,7 +5,6 @@ from map.get_markers import get_all_markers
 from map.get_relation import get_relation
 from APIs.get_weather import get_weather
 import ssl
-import keyboard
 import sqlite3
 
 app = Flask(__name__)
diff --git a/server/map/__pycache__/get_relation.cpython-311.pyc b/server/map/__pycache__/get_relation.cpython-311.pyc
index c39929327b028a8136b9df0ac343f1ad815472bc..f1c6cf7ea12c878cb3569f08bb47975056cfc912 100644
GIT binary patch
delta 167
zcmdn4zf+%UIWI340|Ntt@3M_t6IhJ-Yk0CGKztC+k_3?;oWcWVGNcI3VXEQDk^+f?
z@aD5D`YeLCxC)B$3sQ?pGE<9-xEUB2HuG}IF{*GRr{<Lu<!7ecVoT1?FG?xCB^V!{
zo|+$@nOBlpl$MyB8Xv#epG%pMamMCi?xT#8?Rcd*IT$2muSn>9;N2X>8_NX%T#_jB

delta 188
zcmdm~zg?eeIWI340|Ntt&XSE>6IhISvLrw}5U$~`;mMK&u|POW3Pgf%3J+Y6Aw_Tw
z)8?}*`YeJ)+zbp1x3~(5@(WUnN-|T6H}i7JF{%j0$ET;}$7kl1q!y(mCa1>7-{MG4
z%_}L&&rG?+mYknolv2FepG%pMaoXl$?xT!KHzZ`PNa#I~)3~9ewnX=elG%pBD@v9h
SSed2yJ}`g?_RTT8v0MNev@wVP

diff --git a/server/map/get_relation.py b/server/map/get_relation.py
index 27b285b6..c51de74d 100644
--- a/server/map/get_relation.py
+++ b/server/map/get_relation.py
@@ -17,8 +17,7 @@ def get_relation(self, body_of_water: str):  # NB: implement body_of_water
     polygons = [Polygon(polygon.exterior) for polygon in polygon_data['geometry']]
 
     if len(polygons) <= 1:
-        print("Failed to convert to polygons")
-        return
+        raise Exception("Failed to convert JSON object to Shapely Polygons")
 
     divided_map = []
 
@@ -54,11 +53,11 @@ def get_relation(self, body_of_water: str):  # NB: implement body_of_water
     for tile in divided_map:
         tile_feature = {
             'type': 'Feature',
-            'geometry': tile.__geo_interface__,
             'properties': {
                 'sub_div_id': sub_div_id,
                 'sub_div_center': tile.centroid.coords[0]
-            }
+            },
+            'geometry': tile.__geo_interface__
         }
         features.append(tile_feature)
         sub_div_id += 1
-- 
GitLab