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

update: sql schema and db

parent 4390f258
No related branches found
No related tags found
Loading
File added
......@@ -28,8 +28,8 @@ def get_weather(self):
url = f"https://api.met.no/weatherapi/locationforecast/2.0/compact?lat={lat}&lon={lng}"
response = requests.get(url)
if response.status_code == 200: # Extract data from response
data = response.json()
if response.status_code == 200:
data = response.json() # Extract data from response
timeseries = data['properties']['timeseries']
# Get data for current time and append to weather_data
......@@ -56,5 +56,5 @@ def get_weather(self):
self.send_header("Content-type", "application/json")
self.end_headers()
# Write weather_data to the response object
# Write weather_data to response object
self.wfile.write(json.dumps(weather_data).encode('utf-8'))
No preview for this file type
No preview for this file type
......@@ -94,6 +94,6 @@ def get_all_markers(self, cursor, valid: bool):
self.send_header("Content-type", "application/json")
self.end_headers()
# Write marker data to the response object
# Write marker data to response object
self.wfile.write(marker_data.encode('utf-8'))
No preview for this file type
......@@ -43,10 +43,10 @@ INSERT INTO Sensor (SensorID, SensorType, Active) VALUES
(2, 'Magnetic', 1),
(3, 'Other', 0);
INSERT INTO Measurement (MeasurementID, SensorID, TimeMeasured) VALUES
(1, 2, '2024-01-01 10:00:00'),
(2, 2, '2024-02-04 11:00:00'),
(3, 1, '2024-02-13 12:00:00');
INSERT INTO Measurement (MeasurementID, SensorID, TimeMeasured, WaterBodyName) VALUES
(1, 2, '2024-01-01 10:00:00', 'Mjosa'),
(2, 2, '2024-02-04 11:00:00', 'Mjosa'),
(3, 1, '2024-02-13 12:00:00', 'Mjosa');
-- Measurement 1
INSERT INTO Data (MeasurementID, Latitude, Longitude, IceTop, IceBottom, CalculatedThickness, Accuracy) VALUES
......@@ -93,3 +93,4 @@ INSERT INTO Corner (CornerID, MeasurementID, CornerLatitude, CornerLongitude) VA
INSERT INTO BodyOfWater(Name) VALUES
('Mjosa');
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