vancouver-datajam / gis-interpolation Goto Github PK
View Code? Open in Web Editor NEWHackathon project for Datajam 2023 that will focus on interpolation of spatial data and displaying the data through a plotly dashboard.
License: MIT License
Hackathon project for Datajam 2023 that will focus on interpolation of spatial data and displaying the data through a plotly dashboard.
License: MIT License
Implement Kriging interpolation to estimate climate values at unobserved locations.
Evaluate the accuracy and performance of the Kriging model.
Create continuous climate surfaces for precipitation and temperature across British Columbia.
pip install plotly dash pandas geopandas
Guide on creating a geospatial dashboard in Python using Plotly:
# Step 4: Import necessary libraries
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import geopandas as gpd
# Step 5: Create a Dash app
app = dash.Dash(__name__)
# Step 6: Load your geospatial data
gdf = gpd.read_file('path_to_your_shapefile.shp')
# Step 7: Define the layout of your dashboard
app.layout = html.Div([
html.H1("Geospatial Dashboard"),
# Dropdown for selecting a variable to visualize
dcc.Dropdown(
id='variable-dropdown',
options=[
{'label': column, 'value': column} for column in gdf.columns
],
value=gdf.columns[0], # Default selection
multi=False
),
# Geospatial map
dcc.Graph(
id='geo-map'
)
])
# Step 8: Create callback function to update the map
@app.callback(
Output('geo-map', 'figure'),
Input('variable-dropdown', 'value')
)
def update_map(selected_variable):
fig = px.choropleth(
gdf,
geojson=gdf.geometry,
locations=gdf.index,
color=selected_variable,
projection="mercator"
)
fig.update_geos(fitbounds="locations", visible=False)
fig.update_layout(
title=f"{selected_variable} Distribution",
coloraxis_showscale=True
)
return fig
# Step 9: Run the app
if __name__ == '__main__':
app.run_server(debug=True)
Here's what each step does:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.