Skip to content
Snippets Groups Projects
Commit 4311a3c3 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: minor fixes

parent b30bff8c
No related branches found
No related tags found
1 merge request!7Clhp map
...@@ -54,7 +54,7 @@ class _ChoroplethMapState extends State<ChoroplethMap> { ...@@ -54,7 +54,7 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
MapShapeLayer( MapShapeLayer(
source: MapShapeSource.memory( // Map polygon source: MapShapeSource.memory( // Map polygon
widget.relation, // JSON coordinates from server widget.relation, // JSON coordinates from server
shapeDataField: 'properties.SubDivID', shapeDataField: 'properties.sub_div_id',
dataCount: iceThicknessList.length, dataCount: iceThicknessList.length,
primaryValueMapper: (int index) => iceThicknessList[index].subDivID, primaryValueMapper: (int index) => iceThicknessList[index].subDivID,
shapeColorValueMapper: (int index) => iceThicknessList[index].thickness, shapeColorValueMapper: (int index) => iceThicknessList[index].thickness,
......
...@@ -10,4 +10,4 @@ SSL_KEY_PATH = CERT_DIR + "testKey.key" ...@@ -10,4 +10,4 @@ SSL_KEY_PATH = CERT_DIR + "testKey.key"
SSL_CERT_PATH = CERT_DIR + "testCert.crt" SSL_CERT_PATH = CERT_DIR + "testCert.crt"
# Measurement specs # Measurement specs
AREA_SIZE = 20 AREA_SIZE = 20
\ No newline at end of file
...@@ -5,7 +5,6 @@ from map.get_markers import get_all_markers ...@@ -5,7 +5,6 @@ from map.get_markers import get_all_markers
from map.get_relation import get_relation from map.get_relation import get_relation
from APIs.get_weather import get_weather from APIs.get_weather import get_weather
import ssl import ssl
import keyboard
import sqlite3 import sqlite3
app = Flask(__name__) app = Flask(__name__)
......
No preview for this file type
...@@ -17,8 +17,7 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water ...@@ -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']] polygons = [Polygon(polygon.exterior) for polygon in polygon_data['geometry']]
if len(polygons) <= 1: if len(polygons) <= 1:
print("Failed to convert to polygons") raise Exception("Failed to convert JSON object to Shapely Polygons")
return
divided_map = [] divided_map = []
...@@ -54,11 +53,11 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water ...@@ -54,11 +53,11 @@ def get_relation(self, body_of_water: str): # NB: implement body_of_water
for tile in divided_map: for tile in divided_map:
tile_feature = { tile_feature = {
'type': 'Feature', 'type': 'Feature',
'geometry': tile.__geo_interface__,
'properties': { 'properties': {
'sub_div_id': sub_div_id, 'sub_div_id': sub_div_id,
'sub_div_center': tile.centroid.coords[0] 'sub_div_center': tile.centroid.coords[0]
} },
'geometry': tile.__geo_interface__
} }
features.append(tile_feature) features.append(tile_feature)
sub_div_id += 1 sub_div_id += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment