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}%Kw+sHM6#hAZ_Crbjv2Z1a}2+hEd!UJbAqzKMo0;-aN$!$K% zqR%3Di>sh0zaX`!Br~<Rh#M%knU_<JQH3KpHLs*7KQrYPTXKGWQA+VG!T9*})cp9& uypq(Sw8Z4p`1sBKT*{1$Gd34<A7z|u$1Bar!5}GnMMCcb@8&4pSS|ouk|^^4 delta 188 zcmdm~zg?eeIWI340}$ve*~m44#h52c0>lG>8vYudEJ+BPfgwu@#!BIV3o@h#&SBbo zmPMaMu!tKde~YW2D8C@Js3bGBcr!1j9HWY0e0+Lpetc$LNorAAVsdJH{4I{;)Vz|S z{LGYFY{~igMJdIb{kfDG8K-S7=03`(bVEYsiiF++IgJ}iYD;vlD4A_2yrN|Jft6XB P?*jvfVBZ|W8_NX%8niKp 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