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

add: mjøsa map in python

parent 6097f35d
No related branches found
No related tags found
1 merge request!3Choropleth map implementation
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -7,6 +7,9 @@ from APIs.get_weather import get_weather
import ssl
import keyboard
import sqlite3
import geopandas as gpd
import matplotlib.pyplot as plt
app = Flask(__name__)
terminate_server = 0
......@@ -63,6 +66,17 @@ def on_key_press(server, event, cursor, conn):
# Start a server on port 8443 using self defined HTTP class
if __name__ == "__main__":
# Load GeoJSON data using geopandas
geo_data = gpd.read_file("server/map/mjosa.geojson")
# Plot choropleth map
geo_data.plot()
plt.title('Test_map')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.show()
try:
# Initialize database connection
conn = sqlite3.connect('server/sql_db/icedb')
......
import geopandas as gpd
import matplotlib.pyplot as plt
def map_test():
# Load GeoJSON data using geopandas
geo_data = gpd.read_file("mjosa.geojson")
# Plot choropleth map
geo_data.plot()
plt.title('Choropleth Map of Mjøsa Lake')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.show()
\ No newline at end of file
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