-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v0.2.6
- Loading branch information
Showing
13 changed files
with
784 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 90% # the required coverage value | ||
patch: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1cb94cfb", | ||
"metadata": {}, | ||
"source": [ | ||
"[](https://githubtocolab.com/dkedar7/fast_dash/blob/docs/docs/Examples/04_land_cover_map_with_geemap.ipynb)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ce363e40", | ||
"metadata": {}, | ||
"source": [ | ||
"This notebook is optimized to run in Google Colab.\n", | ||
"\n", | ||
"We'll use the amazing Geemap library for this demo.\n", | ||
"Learn more about Geemap at https://geemap.org/." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "15601ea1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!pip install fast-dash geemap jupyter_dash" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "2f402652", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import ee\n", | ||
"import geemap.foliumap as geemap\n", | ||
"\n", | ||
"from fast_dash import fastdash, html, Fastify" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "0e6bceca", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Authenticate Google Earth Engine\n", | ||
"ee.Authenticate()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "9153b0d3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Define years over which we'll compare land cover\n", | ||
"years = ['2001', '2004', '2006', '2008', '2011', '2013', '2016', '2019']\n", | ||
"\n", | ||
"# Using Fastify, Fast Dash allows making any Dash component suitable with Fast Dash\n", | ||
"iframe_component = Fastify(component=html.Iframe(height=\"100%\"), \n", | ||
" component_property=\"srcdoc\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "99030b06", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Build and deploy!\n", | ||
"# If running locally, feel free to drop the mode and port arguments.\n", | ||
"\n", | ||
"@fastdash(theme=\"Zephyr\", mode=\"inline\", port=5000)\n", | ||
"def compare_land_cover(year_of_left_layer: str = years, \n", | ||
" year_of_right_layer: str = years) -> iframe_component:\n", | ||
" \"Compare how land cover in the US changed over the years\"\n", | ||
"\n", | ||
" # Geemap code. Ref: https://huggingface.co/spaces/giswqs/geemap/blob/main/app.py\n", | ||
" Map = geemap.Map(center=(40, -100), zoom=4, height=600)\n", | ||
"\n", | ||
" nlcd_left = ee.Image(\n", | ||
" f\"USGS/NLCD_RELEASES/2019_REL/NLCD/{year_of_left_layer}\"\n", | ||
" ).select(\"landcover\")\n", | ||
" nlcd_right = ee.Image(\n", | ||
" f\"USGS/NLCD_RELEASES/2019_REL/NLCD/{year_of_right_layer}\"\n", | ||
" ).select(\"landcover\")\n", | ||
"\n", | ||
" left_layer = geemap.ee_tile_layer(nlcd_left, {}, f\"NLCD {year_of_left_layer}\")\n", | ||
" right_layer = geemap.ee_tile_layer(nlcd_right, {}, f\"NLCD {year_of_right_layer}\")\n", | ||
"\n", | ||
" Map.split_map(left_layer, right_layer)\n", | ||
"\n", | ||
" # Convert to HTML\n", | ||
" land_cover_map = Map.to_html()\n", | ||
"\n", | ||
" return land_cover_map" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.16" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.