test v1
Browse files- README.md +3 -47
- notebooks/01_basic.ipynb +56 -4
- notebooks/02_inspector.ipynb +56 -4
- notebooks/03_plotting.ipynb +56 -4
- notebooks/05_timelapse.ipynb +55 -3
- notebooks/06_timeseries.ipynb +55 -3
- notebooks/07_jrc.ipynb +56 -4
- pages/00_home.py +5 -46
- pages/01_basic.py +0 -30
- pages/01_testing_app.py +38 -0
- requirements.txt +1 -3
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🏃
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
|
@@ -9,50 +9,6 @@ license: mit
|
|
| 9 |
app_port: 8765
|
| 10 |
---
|
| 11 |
|
| 12 |
-
## Earth Engine
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
**A collection of Earth Engine web apps developed using [Solara](https://github.com/widgetti/solara) and geemap**
|
| 17 |
-
|
| 18 |
-
- Web App: <https://giswqs-solara-geemap.hf.space>
|
| 19 |
-
- GitHub: <https://github.com/opengeos/solara-geemap>
|
| 20 |
-
- Hugging Face: <https://huggingface.co/spaces/giswqs/solara-geemap>
|
| 21 |
-
|
| 22 |
-
### How to deploy this app on Hugging Face Spaces
|
| 23 |
-
|
| 24 |
-
1. Go to <https://huggingface.co/spaces/giswqs/solara-geemap/tree/main> and duplicate the space to your own space.
|
| 25 |
-
|
| 26 |
-

|
| 27 |
-
|
| 28 |
-
2. You need to set `EARTHENGINE_TOKEN` in order to use Earth Engine. The token value should be copied from the following file depending on your operating system:
|
| 29 |
-
|
| 30 |
-
```text
|
| 31 |
-
Windows: C:\\Users\\USERNAME\\.config\\earthengine\\credentials
|
| 32 |
-
Linux: /home/USERNAME/.config/earthengine/credentials
|
| 33 |
-
MacOS: /Users/USERNAME/.config/earthengine/credentials
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
Simply open the file and copy **ALL** the content to the `EARTHENGINE_TOKEN` environment variable.
|
| 37 |
-
|
| 38 |
-

|
| 39 |
-
|
| 40 |
-

|
| 41 |
-
|
| 42 |
-
Alternatively, you can run the following code to retrieve your Earth Engine token:
|
| 43 |
-
|
| 44 |
-
```python
|
| 45 |
-
import geemap
|
| 46 |
-
geemap.get_ee_token()
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
Copy all the content of the printed token and set it as the `EARTHENGINE_TOKEN` environment variable.
|
| 50 |
-
|
| 51 |
-
3. After the space is built successfully, click the `Embed this Space` menu and find the `Direct URL` for the app, such as <https://giswqs-solara-geemap.hf.space>.
|
| 52 |
-
|
| 53 |
-

|
| 54 |
-
|
| 55 |
-

|
| 56 |
-
|
| 57 |
-
4. Add your own apps (\*.py) to the `pages` folder.
|
| 58 |
-
5. Commit and push your changes to the repository. Wait for the space to be built successfully.
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Test App EE Solara
|
| 3 |
emoji: 🏃
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
|
|
|
| 9 |
app_port: 8765
|
| 10 |
---
|
| 11 |
|
| 12 |
+
## Test App for Earth Engine with Geemap and Solara
|
| 13 |
|
| 14 |
+
By Waleed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
notebooks/01_basic.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -56,9 +56,61 @@
|
|
| 56 |
},
|
| 57 |
{
|
| 58 |
"cell_type": "code",
|
| 59 |
-
"execution_count":
|
| 60 |
"metadata": {},
|
| 61 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"source": [
|
| 63 |
"Page()"
|
| 64 |
]
|
|
@@ -80,7 +132,7 @@
|
|
| 80 |
"name": "python",
|
| 81 |
"nbconvert_exporter": "python",
|
| 82 |
"pygments_lexer": "ipython3",
|
| 83 |
-
"version": "3.
|
| 84 |
}
|
| 85 |
},
|
| 86 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 56 |
},
|
| 57 |
{
|
| 58 |
"cell_type": "code",
|
| 59 |
+
"execution_count": 2,
|
| 60 |
"metadata": {},
|
| 61 |
+
"outputs": [
|
| 62 |
+
{
|
| 63 |
+
"data": {
|
| 64 |
+
"text/html": [
|
| 65 |
+
"\n",
|
| 66 |
+
" <style>\n",
|
| 67 |
+
" .geemap-dark {\n",
|
| 68 |
+
" --jp-widgets-color: white;\n",
|
| 69 |
+
" --jp-widgets-label-color: white;\n",
|
| 70 |
+
" --jp-ui-font-color1: white;\n",
|
| 71 |
+
" --jp-layout-color2: #454545;\n",
|
| 72 |
+
" background-color: #383838;\n",
|
| 73 |
+
" }\n",
|
| 74 |
+
"\n",
|
| 75 |
+
" .geemap-dark .jupyter-button {\n",
|
| 76 |
+
" --jp-layout-color3: #383838;\n",
|
| 77 |
+
" }\n",
|
| 78 |
+
"\n",
|
| 79 |
+
" .geemap-colab {\n",
|
| 80 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 81 |
+
" }\n",
|
| 82 |
+
"\n",
|
| 83 |
+
" .geemap-colab .jupyter-button {\n",
|
| 84 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 85 |
+
" }\n",
|
| 86 |
+
" </style>\n",
|
| 87 |
+
" "
|
| 88 |
+
],
|
| 89 |
+
"text/plain": [
|
| 90 |
+
"<IPython.core.display.HTML object>"
|
| 91 |
+
]
|
| 92 |
+
},
|
| 93 |
+
"metadata": {},
|
| 94 |
+
"output_type": "display_data"
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"data": {
|
| 98 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 99 |
+
"model_id": "10ea2abaa2e94833a8ee4326225e118b",
|
| 100 |
+
"version_major": 2,
|
| 101 |
+
"version_minor": 0
|
| 102 |
+
},
|
| 103 |
+
"text/html": [
|
| 104 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 105 |
+
],
|
| 106 |
+
"text/plain": [
|
| 107 |
+
"Cannot show ipywidgets in text"
|
| 108 |
+
]
|
| 109 |
+
},
|
| 110 |
+
"metadata": {},
|
| 111 |
+
"output_type": "display_data"
|
| 112 |
+
}
|
| 113 |
+
],
|
| 114 |
"source": [
|
| 115 |
"Page()"
|
| 116 |
]
|
|
|
|
| 132 |
"name": "python",
|
| 133 |
"nbconvert_exporter": "python",
|
| 134 |
"pygments_lexer": "ipython3",
|
| 135 |
+
"version": "3.13.2"
|
| 136 |
}
|
| 137 |
},
|
| 138 |
"nbformat": 4,
|
notebooks/02_inspector.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -72,9 +72,61 @@
|
|
| 72 |
},
|
| 73 |
{
|
| 74 |
"cell_type": "code",
|
| 75 |
-
"execution_count":
|
| 76 |
"metadata": {},
|
| 77 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
"source": [
|
| 79 |
"Page()"
|
| 80 |
]
|
|
@@ -96,7 +148,7 @@
|
|
| 96 |
"name": "python",
|
| 97 |
"nbconvert_exporter": "python",
|
| 98 |
"pygments_lexer": "ipython3",
|
| 99 |
-
"version": "3.
|
| 100 |
}
|
| 101 |
},
|
| 102 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 72 |
},
|
| 73 |
{
|
| 74 |
"cell_type": "code",
|
| 75 |
+
"execution_count": 2,
|
| 76 |
"metadata": {},
|
| 77 |
+
"outputs": [
|
| 78 |
+
{
|
| 79 |
+
"data": {
|
| 80 |
+
"text/html": [
|
| 81 |
+
"\n",
|
| 82 |
+
" <style>\n",
|
| 83 |
+
" .geemap-dark {\n",
|
| 84 |
+
" --jp-widgets-color: white;\n",
|
| 85 |
+
" --jp-widgets-label-color: white;\n",
|
| 86 |
+
" --jp-ui-font-color1: white;\n",
|
| 87 |
+
" --jp-layout-color2: #454545;\n",
|
| 88 |
+
" background-color: #383838;\n",
|
| 89 |
+
" }\n",
|
| 90 |
+
"\n",
|
| 91 |
+
" .geemap-dark .jupyter-button {\n",
|
| 92 |
+
" --jp-layout-color3: #383838;\n",
|
| 93 |
+
" }\n",
|
| 94 |
+
"\n",
|
| 95 |
+
" .geemap-colab {\n",
|
| 96 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 97 |
+
" }\n",
|
| 98 |
+
"\n",
|
| 99 |
+
" .geemap-colab .jupyter-button {\n",
|
| 100 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 101 |
+
" }\n",
|
| 102 |
+
" </style>\n",
|
| 103 |
+
" "
|
| 104 |
+
],
|
| 105 |
+
"text/plain": [
|
| 106 |
+
"<IPython.core.display.HTML object>"
|
| 107 |
+
]
|
| 108 |
+
},
|
| 109 |
+
"metadata": {},
|
| 110 |
+
"output_type": "display_data"
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"data": {
|
| 114 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 115 |
+
"model_id": "a5747822682a427f8c376209a73df7d3",
|
| 116 |
+
"version_major": 2,
|
| 117 |
+
"version_minor": 0
|
| 118 |
+
},
|
| 119 |
+
"text/html": [
|
| 120 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 121 |
+
],
|
| 122 |
+
"text/plain": [
|
| 123 |
+
"Cannot show ipywidgets in text"
|
| 124 |
+
]
|
| 125 |
+
},
|
| 126 |
+
"metadata": {},
|
| 127 |
+
"output_type": "display_data"
|
| 128 |
+
}
|
| 129 |
+
],
|
| 130 |
"source": [
|
| 131 |
"Page()"
|
| 132 |
]
|
|
|
|
| 148 |
"name": "python",
|
| 149 |
"nbconvert_exporter": "python",
|
| 150 |
"pygments_lexer": "ipython3",
|
| 151 |
+
"version": "3.13.2"
|
| 152 |
}
|
| 153 |
},
|
| 154 |
"nbformat": 4,
|
notebooks/03_plotting.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -65,9 +65,61 @@
|
|
| 65 |
},
|
| 66 |
{
|
| 67 |
"cell_type": "code",
|
| 68 |
-
"execution_count":
|
| 69 |
"metadata": {},
|
| 70 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
"source": [
|
| 72 |
"Page()"
|
| 73 |
]
|
|
@@ -89,7 +141,7 @@
|
|
| 89 |
"name": "python",
|
| 90 |
"nbconvert_exporter": "python",
|
| 91 |
"pygments_lexer": "ipython3",
|
| 92 |
-
"version": "3.
|
| 93 |
}
|
| 94 |
},
|
| 95 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 65 |
},
|
| 66 |
{
|
| 67 |
"cell_type": "code",
|
| 68 |
+
"execution_count": 2,
|
| 69 |
"metadata": {},
|
| 70 |
+
"outputs": [
|
| 71 |
+
{
|
| 72 |
+
"data": {
|
| 73 |
+
"text/html": [
|
| 74 |
+
"\n",
|
| 75 |
+
" <style>\n",
|
| 76 |
+
" .geemap-dark {\n",
|
| 77 |
+
" --jp-widgets-color: white;\n",
|
| 78 |
+
" --jp-widgets-label-color: white;\n",
|
| 79 |
+
" --jp-ui-font-color1: white;\n",
|
| 80 |
+
" --jp-layout-color2: #454545;\n",
|
| 81 |
+
" background-color: #383838;\n",
|
| 82 |
+
" }\n",
|
| 83 |
+
"\n",
|
| 84 |
+
" .geemap-dark .jupyter-button {\n",
|
| 85 |
+
" --jp-layout-color3: #383838;\n",
|
| 86 |
+
" }\n",
|
| 87 |
+
"\n",
|
| 88 |
+
" .geemap-colab {\n",
|
| 89 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 90 |
+
" }\n",
|
| 91 |
+
"\n",
|
| 92 |
+
" .geemap-colab .jupyter-button {\n",
|
| 93 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 94 |
+
" }\n",
|
| 95 |
+
" </style>\n",
|
| 96 |
+
" "
|
| 97 |
+
],
|
| 98 |
+
"text/plain": [
|
| 99 |
+
"<IPython.core.display.HTML object>"
|
| 100 |
+
]
|
| 101 |
+
},
|
| 102 |
+
"metadata": {},
|
| 103 |
+
"output_type": "display_data"
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"data": {
|
| 107 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 108 |
+
"model_id": "5c6125f4479d4c609addce96721630ba",
|
| 109 |
+
"version_major": 2,
|
| 110 |
+
"version_minor": 0
|
| 111 |
+
},
|
| 112 |
+
"text/html": [
|
| 113 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 114 |
+
],
|
| 115 |
+
"text/plain": [
|
| 116 |
+
"Cannot show ipywidgets in text"
|
| 117 |
+
]
|
| 118 |
+
},
|
| 119 |
+
"metadata": {},
|
| 120 |
+
"output_type": "display_data"
|
| 121 |
+
}
|
| 122 |
+
],
|
| 123 |
"source": [
|
| 124 |
"Page()"
|
| 125 |
]
|
|
|
|
| 141 |
"name": "python",
|
| 142 |
"nbconvert_exporter": "python",
|
| 143 |
"pygments_lexer": "ipython3",
|
| 144 |
+
"version": "3.13.2"
|
| 145 |
}
|
| 146 |
},
|
| 147 |
"nbformat": 4,
|
notebooks/05_timelapse.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -49,7 +49,59 @@
|
|
| 49 |
"cell_type": "code",
|
| 50 |
"execution_count": null,
|
| 51 |
"metadata": {},
|
| 52 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
"source": [
|
| 54 |
"Page()"
|
| 55 |
]
|
|
@@ -71,7 +123,7 @@
|
|
| 71 |
"name": "python",
|
| 72 |
"nbconvert_exporter": "python",
|
| 73 |
"pygments_lexer": "ipython3",
|
| 74 |
-
"version": "3.
|
| 75 |
}
|
| 76 |
},
|
| 77 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 49 |
"cell_type": "code",
|
| 50 |
"execution_count": null,
|
| 51 |
"metadata": {},
|
| 52 |
+
"outputs": [
|
| 53 |
+
{
|
| 54 |
+
"data": {
|
| 55 |
+
"text/html": [
|
| 56 |
+
"\n",
|
| 57 |
+
" <style>\n",
|
| 58 |
+
" .geemap-dark {\n",
|
| 59 |
+
" --jp-widgets-color: white;\n",
|
| 60 |
+
" --jp-widgets-label-color: white;\n",
|
| 61 |
+
" --jp-ui-font-color1: white;\n",
|
| 62 |
+
" --jp-layout-color2: #454545;\n",
|
| 63 |
+
" background-color: #383838;\n",
|
| 64 |
+
" }\n",
|
| 65 |
+
"\n",
|
| 66 |
+
" .geemap-dark .jupyter-button {\n",
|
| 67 |
+
" --jp-layout-color3: #383838;\n",
|
| 68 |
+
" }\n",
|
| 69 |
+
"\n",
|
| 70 |
+
" .geemap-colab {\n",
|
| 71 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 72 |
+
" }\n",
|
| 73 |
+
"\n",
|
| 74 |
+
" .geemap-colab .jupyter-button {\n",
|
| 75 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 76 |
+
" }\n",
|
| 77 |
+
" </style>\n",
|
| 78 |
+
" "
|
| 79 |
+
],
|
| 80 |
+
"text/plain": [
|
| 81 |
+
"<IPython.core.display.HTML object>"
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
"metadata": {},
|
| 85 |
+
"output_type": "display_data"
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"data": {
|
| 89 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 90 |
+
"model_id": "364d8ada633b4ebc99540433fb68cc6e",
|
| 91 |
+
"version_major": 2,
|
| 92 |
+
"version_minor": 0
|
| 93 |
+
},
|
| 94 |
+
"text/html": [
|
| 95 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 96 |
+
],
|
| 97 |
+
"text/plain": [
|
| 98 |
+
"Cannot show ipywidgets in text"
|
| 99 |
+
]
|
| 100 |
+
},
|
| 101 |
+
"metadata": {},
|
| 102 |
+
"output_type": "display_data"
|
| 103 |
+
}
|
| 104 |
+
],
|
| 105 |
"source": [
|
| 106 |
"Page()"
|
| 107 |
]
|
|
|
|
| 123 |
"name": "python",
|
| 124 |
"nbconvert_exporter": "python",
|
| 125 |
"pygments_lexer": "ipython3",
|
| 126 |
+
"version": "3.13.2"
|
| 127 |
}
|
| 128 |
},
|
| 129 |
"nbformat": 4,
|
notebooks/06_timeseries.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -311,7 +311,59 @@
|
|
| 311 |
"cell_type": "code",
|
| 312 |
"execution_count": null,
|
| 313 |
"metadata": {},
|
| 314 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
"source": [
|
| 316 |
"Page()"
|
| 317 |
]
|
|
@@ -340,7 +392,7 @@
|
|
| 340 |
"name": "python",
|
| 341 |
"nbconvert_exporter": "python",
|
| 342 |
"pygments_lexer": "ipython3",
|
| 343 |
-
"version": "3.
|
| 344 |
}
|
| 345 |
},
|
| 346 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 311 |
"cell_type": "code",
|
| 312 |
"execution_count": null,
|
| 313 |
"metadata": {},
|
| 314 |
+
"outputs": [
|
| 315 |
+
{
|
| 316 |
+
"data": {
|
| 317 |
+
"text/html": [
|
| 318 |
+
"\n",
|
| 319 |
+
" <style>\n",
|
| 320 |
+
" .geemap-dark {\n",
|
| 321 |
+
" --jp-widgets-color: white;\n",
|
| 322 |
+
" --jp-widgets-label-color: white;\n",
|
| 323 |
+
" --jp-ui-font-color1: white;\n",
|
| 324 |
+
" --jp-layout-color2: #454545;\n",
|
| 325 |
+
" background-color: #383838;\n",
|
| 326 |
+
" }\n",
|
| 327 |
+
"\n",
|
| 328 |
+
" .geemap-dark .jupyter-button {\n",
|
| 329 |
+
" --jp-layout-color3: #383838;\n",
|
| 330 |
+
" }\n",
|
| 331 |
+
"\n",
|
| 332 |
+
" .geemap-colab {\n",
|
| 333 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 334 |
+
" }\n",
|
| 335 |
+
"\n",
|
| 336 |
+
" .geemap-colab .jupyter-button {\n",
|
| 337 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 338 |
+
" }\n",
|
| 339 |
+
" </style>\n",
|
| 340 |
+
" "
|
| 341 |
+
],
|
| 342 |
+
"text/plain": [
|
| 343 |
+
"<IPython.core.display.HTML object>"
|
| 344 |
+
]
|
| 345 |
+
},
|
| 346 |
+
"metadata": {},
|
| 347 |
+
"output_type": "display_data"
|
| 348 |
+
},
|
| 349 |
+
{
|
| 350 |
+
"data": {
|
| 351 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 352 |
+
"model_id": "c7e7ac2cb9164bafbaa7f98802db3f96",
|
| 353 |
+
"version_major": 2,
|
| 354 |
+
"version_minor": 0
|
| 355 |
+
},
|
| 356 |
+
"text/html": [
|
| 357 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 358 |
+
],
|
| 359 |
+
"text/plain": [
|
| 360 |
+
"Cannot show ipywidgets in text"
|
| 361 |
+
]
|
| 362 |
+
},
|
| 363 |
+
"metadata": {},
|
| 364 |
+
"output_type": "display_data"
|
| 365 |
+
}
|
| 366 |
+
],
|
| 367 |
"source": [
|
| 368 |
"Page()"
|
| 369 |
]
|
|
|
|
| 392 |
"name": "python",
|
| 393 |
"nbconvert_exporter": "python",
|
| 394 |
"pygments_lexer": "ipython3",
|
| 395 |
+
"version": "3.13.2"
|
| 396 |
}
|
| 397 |
},
|
| 398 |
"nbformat": 4,
|
notebooks/07_jrc.ipynb
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
-
"execution_count":
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
@@ -166,9 +166,61 @@
|
|
| 166 |
},
|
| 167 |
{
|
| 168 |
"cell_type": "code",
|
| 169 |
-
"execution_count":
|
| 170 |
"metadata": {},
|
| 171 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
"source": [
|
| 173 |
"Page()"
|
| 174 |
]
|
|
@@ -197,7 +249,7 @@
|
|
| 197 |
"name": "python",
|
| 198 |
"nbconvert_exporter": "python",
|
| 199 |
"pygments_lexer": "ipython3",
|
| 200 |
-
"version": "3.
|
| 201 |
}
|
| 202 |
},
|
| 203 |
"nbformat": 4,
|
|
|
|
| 18 |
},
|
| 19 |
{
|
| 20 |
"cell_type": "code",
|
| 21 |
+
"execution_count": 1,
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
|
|
|
| 166 |
},
|
| 167 |
{
|
| 168 |
"cell_type": "code",
|
| 169 |
+
"execution_count": 2,
|
| 170 |
"metadata": {},
|
| 171 |
+
"outputs": [
|
| 172 |
+
{
|
| 173 |
+
"data": {
|
| 174 |
+
"text/html": [
|
| 175 |
+
"\n",
|
| 176 |
+
" <style>\n",
|
| 177 |
+
" .geemap-dark {\n",
|
| 178 |
+
" --jp-widgets-color: white;\n",
|
| 179 |
+
" --jp-widgets-label-color: white;\n",
|
| 180 |
+
" --jp-ui-font-color1: white;\n",
|
| 181 |
+
" --jp-layout-color2: #454545;\n",
|
| 182 |
+
" background-color: #383838;\n",
|
| 183 |
+
" }\n",
|
| 184 |
+
"\n",
|
| 185 |
+
" .geemap-dark .jupyter-button {\n",
|
| 186 |
+
" --jp-layout-color3: #383838;\n",
|
| 187 |
+
" }\n",
|
| 188 |
+
"\n",
|
| 189 |
+
" .geemap-colab {\n",
|
| 190 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
| 191 |
+
" }\n",
|
| 192 |
+
"\n",
|
| 193 |
+
" .geemap-colab .jupyter-button {\n",
|
| 194 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
| 195 |
+
" }\n",
|
| 196 |
+
" </style>\n",
|
| 197 |
+
" "
|
| 198 |
+
],
|
| 199 |
+
"text/plain": [
|
| 200 |
+
"<IPython.core.display.HTML object>"
|
| 201 |
+
]
|
| 202 |
+
},
|
| 203 |
+
"metadata": {},
|
| 204 |
+
"output_type": "display_data"
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"data": {
|
| 208 |
+
"application/vnd.jupyter.widget-view+json": {
|
| 209 |
+
"model_id": "8542afc07a2c42e2860df07c87eb6b97",
|
| 210 |
+
"version_major": 2,
|
| 211 |
+
"version_minor": 0
|
| 212 |
+
},
|
| 213 |
+
"text/html": [
|
| 214 |
+
"Cannot show widget. You probably want to rerun the code cell above (<i>Click in the code cell, and press Shift+Enter <kbd>⇧</kbd>+<kbd>↩</kbd></i>)."
|
| 215 |
+
],
|
| 216 |
+
"text/plain": [
|
| 217 |
+
"Cannot show ipywidgets in text"
|
| 218 |
+
]
|
| 219 |
+
},
|
| 220 |
+
"metadata": {},
|
| 221 |
+
"output_type": "display_data"
|
| 222 |
+
}
|
| 223 |
+
],
|
| 224 |
"source": [
|
| 225 |
"Page()"
|
| 226 |
]
|
|
|
|
| 249 |
"name": "python",
|
| 250 |
"nbconvert_exporter": "python",
|
| 251 |
"pygments_lexer": "ipython3",
|
| 252 |
+
"version": "3.13.2"
|
| 253 |
}
|
| 254 |
},
|
| 255 |
"nbformat": 4,
|
pages/00_home.py
CHANGED
|
@@ -7,52 +7,11 @@ def Page():
|
|
| 7 |
markdown = """
|
| 8 |
## Earth Engine Web Apps
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
- GitHub: <https://github.com/opengeos/solara-geemap>
|
| 16 |
-
- Hugging Face: <https://huggingface.co/spaces/giswqs/solara-geemap>
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
### How to deploy this app on Hugging Face Spaces
|
| 20 |
-
|
| 21 |
-
1. Go to <https://huggingface.co/spaces/giswqs/solara-geemap/tree/main> and duplicate the space to your own space.
|
| 22 |
-
|
| 23 |
-

|
| 24 |
-
|
| 25 |
-
2. You need to set `EARTHENGINE_TOKEN` in order to use Earth Engine. The token value should be copied from the following file depending on your operating system:
|
| 26 |
-
|
| 27 |
-
```text
|
| 28 |
-
Windows: C:\\Users\\USERNAME\\.config\\earthengine\\credentials
|
| 29 |
-
Linux: /home/USERNAME/.config/earthengine/credentials
|
| 30 |
-
MacOS: /Users/USERNAME/.config/earthengine/credentials
|
| 31 |
-
```
|
| 32 |
-
|
| 33 |
-
Simply open the file and copy **ALL** the content to the `EARTHENGINE_TOKEN` environment variable.
|
| 34 |
-
|
| 35 |
-

|
| 36 |
-
|
| 37 |
-

|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
```python
|
| 41 |
-
import geemap
|
| 42 |
-
geemap.get_ee_token()
|
| 43 |
-
```
|
| 44 |
-
|
| 45 |
-
Copy all the content of the printed token and set it as the `EARTHENGINE_TOKEN` environment variable.
|
| 46 |
-
|
| 47 |
-
3. After the space is built successfully, click the `Embed this Space` menu and find the `Direct URL` for the app, such as <https://giswqs-solara-geemap.hf.space>.
|
| 48 |
-
|
| 49 |
-

|
| 50 |
-
|
| 51 |
-

|
| 52 |
-
|
| 53 |
-
4. Add your own apps (*.py) to the `pages` folder.
|
| 54 |
-
|
| 55 |
-
5. Commit and push your changes to the repository. Wait for the space to be built successfully.
|
| 56 |
|
| 57 |
"""
|
| 58 |
|
|
|
|
| 7 |
markdown = """
|
| 8 |
## Earth Engine Web Apps
|
| 9 |
|
| 10 |
+
This is a simple example of an Earth Engine web app using Solara.
|
| 11 |
+
It demonstrates how to create a map with Earth Engine data and add it to a Solara
|
| 12 |
+
|
| 13 |
+
By Waleed
|
| 14 |
+
[waleedgeo.com](https://waleedgeo.com)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
"""
|
| 17 |
|
pages/01_basic.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import geemap
|
| 2 |
-
import solara
|
| 3 |
-
|
| 4 |
-
zoom = solara.reactive(4)
|
| 5 |
-
center = solara.reactive((40, -100))
|
| 6 |
-
bounds = solara.reactive(None)
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
@solara.component
|
| 10 |
-
def Page():
|
| 11 |
-
# Isolation is required to prevent the map from overlapping navigation (when screen width < 960px)
|
| 12 |
-
with solara.Column(
|
| 13 |
-
style={"min-width": "500px", "height": "780px", "isolation": "isolate"}
|
| 14 |
-
):
|
| 15 |
-
# solara components support reactive variables
|
| 16 |
-
solara.SliderInt(label="Zoom level", value=zoom, min=1, max=20)
|
| 17 |
-
# using 3rd party widget library require wiring up the events manually
|
| 18 |
-
# using zoom.value and zoom.set
|
| 19 |
-
geemap.Map.element( # type: ignore
|
| 20 |
-
zoom=zoom.value,
|
| 21 |
-
on_zoom=zoom.set,
|
| 22 |
-
center=center.value,
|
| 23 |
-
on_center=center.set,
|
| 24 |
-
on_bounds=bounds.set,
|
| 25 |
-
scroll_wheel_zoom=True,
|
| 26 |
-
height="600px",
|
| 27 |
-
)
|
| 28 |
-
solara.Text(f"Zoom: {zoom.value}")
|
| 29 |
-
solara.Text(f"Center: {center.value}")
|
| 30 |
-
solara.Text(f"Bounds: {bounds.value}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pages/01_testing_app.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import ee
|
| 2 |
+
import geemap
|
| 3 |
+
|
| 4 |
+
import solara
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
class Map(geemap.Map):
|
| 8 |
+
def __init__(self, **kwargs):
|
| 9 |
+
super().__init__(**kwargs)
|
| 10 |
+
self.add_ee_data()
|
| 11 |
+
self.add("layer_manager")
|
| 12 |
+
self.add("inspector")
|
| 13 |
+
|
| 14 |
+
def add_ee_data(self):
|
| 15 |
+
# Add Earth Engine dataset
|
| 16 |
+
|
| 17 |
+
table = ee.FeatureCollection("projects/waleedgeo/assets/fabdem_tiles")
|
| 18 |
+
|
| 19 |
+
# rectangle boundaies loaded, now defined color vis
|
| 20 |
+
vis_fc_params = {
|
| 21 |
+
"color": "red",
|
| 22 |
+
"fillColor": "00000000",
|
| 23 |
+
"width": 1,
|
| 24 |
+
"fillOpacity": 0.0,
|
| 25 |
+
"opacity": 1.0,
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
self.addLayer(table, vis_fc_params, "FABDEM Tiles")
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
@solara.component
|
| 32 |
+
def Page():
|
| 33 |
+
with solara.Column(style={"min-width": "500px"}):
|
| 34 |
+
Map.element(
|
| 35 |
+
center=[40, -100],
|
| 36 |
+
zoom=4,
|
| 37 |
+
height="600px",
|
| 38 |
+
)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
geemap
|
| 2 |
geopandas
|
| 3 |
-
solara
|
| 4 |
-
leafmap
|
| 5 |
-
rasterio
|
|
|
|
| 1 |
geemap
|
| 2 |
geopandas
|
| 3 |
+
solara
|
|
|
|
|
|