rhamon-garcia
commited on
Upload 29 files
Browse files- .gitattributes +35 -35
- .github/workflows/sync-hf.yml +20 -0
- .gitignore +161 -0
- .pre-commit-config.yaml +33 -0
- CSVs/ARR_projects.csv +0 -0
- Dockerfile +21 -0
- LICENSE +21 -0
- README.md +58 -12
- notebooks/01_basic.ipynb +88 -0
- notebooks/02_inspector.ipynb +104 -0
- notebooks/03_plotting.ipynb +97 -0
- notebooks/04_split_map.ipynb +115 -0
- notebooks/05_timelapse.ipynb +79 -0
- notebooks/06_timeseries.ipynb +348 -0
- notebooks/07_jrc.ipynb +205 -0
- notebooks/08_compare.ipynb +335 -0
- notebooks/09_teste.ipynb +352 -0
- notebooks/esa_stats_ucs_rj2.csv +41 -0
- pages/00_home.py +80 -0
- pages/01_ARR 1º.py +102 -0
- pages/02_ARR 2º.py +100 -0
- pages/03_ARR 3°.py +100 -0
- pages/04_ARR 4º.py +102 -0
- pages/05_ARR 5º.py +103 -0
- pages/06_ARR 6º.py +103 -0
- pages/07_ARR 7º.py +103 -0
- pages/08_ARR 8º.py +102 -0
- pages/09_ARR 9º.py +103 -0
- requirements.txt +5 -0
.gitattributes
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
.github/workflows/sync-hf.yml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
sync-to-hub:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
steps:
|
13 |
+
- uses: actions/checkout@v3
|
14 |
+
with:
|
15 |
+
fetch-depth: 0
|
16 |
+
lfs: true
|
17 |
+
- name: Push to hub
|
18 |
+
env:
|
19 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
20 |
+
run: git push --force https://giswqs:[email protected]/spaces/giswqs/solara-geemap main
|
.gitignore
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
+
|
6 |
+
# C extensions
|
7 |
+
*.so
|
8 |
+
|
9 |
+
# Distribution / packaging
|
10 |
+
.Python
|
11 |
+
build/
|
12 |
+
develop-eggs/
|
13 |
+
dist/
|
14 |
+
downloads/
|
15 |
+
eggs/
|
16 |
+
.eggs/
|
17 |
+
lib/
|
18 |
+
lib64/
|
19 |
+
parts/
|
20 |
+
sdist/
|
21 |
+
var/
|
22 |
+
wheels/
|
23 |
+
share/python-wheels/
|
24 |
+
*.egg-info/
|
25 |
+
.installed.cfg
|
26 |
+
*.egg
|
27 |
+
MANIFEST
|
28 |
+
private/
|
29 |
+
|
30 |
+
# PyInstaller
|
31 |
+
# Usually these files are written by a python script from a template
|
32 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
33 |
+
*.manifest
|
34 |
+
*.spec
|
35 |
+
|
36 |
+
# Installer logs
|
37 |
+
pip-log.txt
|
38 |
+
pip-delete-this-directory.txt
|
39 |
+
|
40 |
+
# Unit test / coverage reports
|
41 |
+
htmlcov/
|
42 |
+
.tox/
|
43 |
+
.nox/
|
44 |
+
.coverage
|
45 |
+
.coverage.*
|
46 |
+
.cache
|
47 |
+
nosetests.xml
|
48 |
+
coverage.xml
|
49 |
+
*.cover
|
50 |
+
*.py,cover
|
51 |
+
.hypothesis/
|
52 |
+
.pytest_cache/
|
53 |
+
cover/
|
54 |
+
|
55 |
+
# Translations
|
56 |
+
*.mo
|
57 |
+
*.pot
|
58 |
+
|
59 |
+
# Django stuff:
|
60 |
+
*.log
|
61 |
+
local_settings.py
|
62 |
+
db.sqlite3
|
63 |
+
db.sqlite3-journal
|
64 |
+
|
65 |
+
# Flask stuff:
|
66 |
+
instance/
|
67 |
+
.webassets-cache
|
68 |
+
|
69 |
+
# Scrapy stuff:
|
70 |
+
.scrapy
|
71 |
+
|
72 |
+
# Sphinx documentation
|
73 |
+
docs/_build/
|
74 |
+
|
75 |
+
# PyBuilder
|
76 |
+
.pybuilder/
|
77 |
+
target/
|
78 |
+
|
79 |
+
# Jupyter Notebook
|
80 |
+
.ipynb_checkpoints
|
81 |
+
|
82 |
+
# IPython
|
83 |
+
profile_default/
|
84 |
+
ipython_config.py
|
85 |
+
|
86 |
+
# pyenv
|
87 |
+
# For a library or package, you might want to ignore these files since the code is
|
88 |
+
# intended to run in multiple environments; otherwise, check them in:
|
89 |
+
# .python-version
|
90 |
+
|
91 |
+
# pipenv
|
92 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
93 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
94 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
95 |
+
# install all needed dependencies.
|
96 |
+
#Pipfile.lock
|
97 |
+
|
98 |
+
# poetry
|
99 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
100 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
101 |
+
# commonly ignored for libraries.
|
102 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
103 |
+
#poetry.lock
|
104 |
+
|
105 |
+
# pdm
|
106 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
107 |
+
#pdm.lock
|
108 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
109 |
+
# in version control.
|
110 |
+
# https://pdm.fming.dev/#use-with-ide
|
111 |
+
.pdm.toml
|
112 |
+
|
113 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
114 |
+
__pypackages__/
|
115 |
+
|
116 |
+
# Celery stuff
|
117 |
+
celerybeat-schedule
|
118 |
+
celerybeat.pid
|
119 |
+
|
120 |
+
# SageMath parsed files
|
121 |
+
*.sage.py
|
122 |
+
|
123 |
+
# Environments
|
124 |
+
.env
|
125 |
+
.venv
|
126 |
+
env/
|
127 |
+
venv/
|
128 |
+
ENV/
|
129 |
+
env.bak/
|
130 |
+
venv.bak/
|
131 |
+
|
132 |
+
# Spyder project settings
|
133 |
+
.spyderproject
|
134 |
+
.spyproject
|
135 |
+
|
136 |
+
# Rope project settings
|
137 |
+
.ropeproject
|
138 |
+
|
139 |
+
# mkdocs documentation
|
140 |
+
/site
|
141 |
+
|
142 |
+
# mypy
|
143 |
+
.mypy_cache/
|
144 |
+
.dmypy.json
|
145 |
+
dmypy.json
|
146 |
+
|
147 |
+
# Pyre type checker
|
148 |
+
.pyre/
|
149 |
+
|
150 |
+
# pytype static type analyzer
|
151 |
+
.pytype/
|
152 |
+
|
153 |
+
# Cython debug symbols
|
154 |
+
cython_debug/
|
155 |
+
|
156 |
+
# PyCharm
|
157 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
158 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
159 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
160 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
161 |
+
#.idea/
|
.pre-commit-config.yaml
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
repos:
|
2 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
3 |
+
rev: v5.0.0
|
4 |
+
hooks:
|
5 |
+
- id: check-toml
|
6 |
+
- id: check-yaml
|
7 |
+
- id: end-of-file-fixer
|
8 |
+
types: [python]
|
9 |
+
- id: trailing-whitespace
|
10 |
+
- id: requirements-txt-fixer
|
11 |
+
- id: check-added-large-files
|
12 |
+
args: ["--maxkb=500"]
|
13 |
+
|
14 |
+
- repo: https://github.com/psf/black
|
15 |
+
rev: 24.10.0
|
16 |
+
hooks:
|
17 |
+
- id: black-jupyter
|
18 |
+
language_version: python3
|
19 |
+
|
20 |
+
- repo: https://github.com/codespell-project/codespell
|
21 |
+
rev: v2.3.0
|
22 |
+
hooks:
|
23 |
+
- id: codespell
|
24 |
+
args:
|
25 |
+
[
|
26 |
+
"--ignore-words-list=gis,timeseries,sav,slowy",
|
27 |
+
"--skip=*.json,*.csv",
|
28 |
+
]
|
29 |
+
|
30 |
+
- repo: https://github.com/kynan/nbstripout
|
31 |
+
rev: 0.7.1
|
32 |
+
hooks:
|
33 |
+
- id: nbstripout
|
CSVs/ARR_projects.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM jupyter/base-notebook:latest
|
2 |
+
|
3 |
+
RUN mamba install -c conda-forge leafmap geopandas localtileserver -y && \
|
4 |
+
fix-permissions "${CONDA_DIR}" && \
|
5 |
+
fix-permissions "/home/${NB_USER}"
|
6 |
+
|
7 |
+
COPY requirements.txt .
|
8 |
+
RUN pip install -r requirements.txt
|
9 |
+
|
10 |
+
RUN mkdir ./pages
|
11 |
+
COPY /pages ./pages
|
12 |
+
|
13 |
+
ENV PROJ_LIB='/opt/conda/share/proj'
|
14 |
+
|
15 |
+
USER root
|
16 |
+
RUN chown -R ${NB_UID} ${HOME}
|
17 |
+
USER ${NB_USER}
|
18 |
+
|
19 |
+
EXPOSE 8765
|
20 |
+
|
21 |
+
CMD ["solara", "run", "./pages", "--host=0.0.0.0"]
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2023 Open Geospatial Solutions
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
README.md
CHANGED
@@ -1,12 +1,58 @@
|
|
1 |
-
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
-
sdk: docker
|
7 |
-
pinned: false
|
8 |
-
license: mit
|
9 |
-
|
10 |
-
---
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Solara Geemap
|
3 |
+
emoji: 🏃
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: purple
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
license: mit
|
9 |
+
app_port: 8765
|
10 |
+
---
|
11 |
+
|
12 |
+
## Earth Engine Web Apps
|
13 |
+
|
14 |
+
### Introduction
|
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 |
+
![](https://i.imgur.com/gTg4V2x.png)
|
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 |
+
![](https://i.imgur.com/i04gzyH.png)
|
39 |
+
|
40 |
+
![](https://i.imgur.com/Ex37Ut7.png)
|
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 |
+
![](https://i.imgur.com/DNM36sk.png)
|
54 |
+
|
55 |
+
![](https://i.imgur.com/KX82lSf.png)
|
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.
|
notebooks/01_basic.ipynb
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/01_basic.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import geemap\n",
|
26 |
+
"import solara\n",
|
27 |
+
"\n",
|
28 |
+
"zoom = solara.reactive(4)\n",
|
29 |
+
"center = solara.reactive((40, -100))\n",
|
30 |
+
"bounds = solara.reactive(None)\n",
|
31 |
+
"\n",
|
32 |
+
"\n",
|
33 |
+
"@solara.component\n",
|
34 |
+
"def Page():\n",
|
35 |
+
" # Isolation is required to prevent the map from overlapping navigation (when screen width < 960px)\n",
|
36 |
+
" with solara.Column(\n",
|
37 |
+
" style={\"min-width\": \"500px\", \"height\": \"780px\", \"isolation\": \"isolate\"}\n",
|
38 |
+
" ):\n",
|
39 |
+
" # solara components support reactive variables\n",
|
40 |
+
" solara.SliderInt(label=\"Zoom level\", value=zoom, min=1, max=20)\n",
|
41 |
+
" # using 3rd party widget library require wiring up the events manually\n",
|
42 |
+
" # using zoom.value and zoom.set\n",
|
43 |
+
" geemap.Map.element( # type: ignore\n",
|
44 |
+
" zoom=zoom.value,\n",
|
45 |
+
" on_zoom=zoom.set,\n",
|
46 |
+
" center=center.value,\n",
|
47 |
+
" on_center=center.set,\n",
|
48 |
+
" on_bounds=bounds.set,\n",
|
49 |
+
" scroll_wheel_zoom=True,\n",
|
50 |
+
" height=\"600px\",\n",
|
51 |
+
" )\n",
|
52 |
+
" solara.Text(f\"Zoom: {zoom.value}\")\n",
|
53 |
+
" solara.Text(f\"Center: {center.value}\")\n",
|
54 |
+
" solara.Text(f\"Bounds: {bounds.value}\")"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"cell_type": "code",
|
59 |
+
"execution_count": null,
|
60 |
+
"metadata": {},
|
61 |
+
"outputs": [],
|
62 |
+
"source": [
|
63 |
+
"Page()"
|
64 |
+
]
|
65 |
+
}
|
66 |
+
],
|
67 |
+
"metadata": {
|
68 |
+
"kernelspec": {
|
69 |
+
"display_name": "geo",
|
70 |
+
"language": "python",
|
71 |
+
"name": "python3"
|
72 |
+
},
|
73 |
+
"language_info": {
|
74 |
+
"codemirror_mode": {
|
75 |
+
"name": "ipython",
|
76 |
+
"version": 3
|
77 |
+
},
|
78 |
+
"file_extension": ".py",
|
79 |
+
"mimetype": "text/x-python",
|
80 |
+
"name": "python",
|
81 |
+
"nbconvert_exporter": "python",
|
82 |
+
"pygments_lexer": "ipython3",
|
83 |
+
"version": "3.11.8"
|
84 |
+
}
|
85 |
+
},
|
86 |
+
"nbformat": 4,
|
87 |
+
"nbformat_minor": 2
|
88 |
+
}
|
notebooks/02_inspector.ipynb
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/02_inspector.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import ee\n",
|
26 |
+
"import geemap\n",
|
27 |
+
"import solara\n",
|
28 |
+
"\n",
|
29 |
+
"\n",
|
30 |
+
"class Map(geemap.Map):\n",
|
31 |
+
" def __init__(self, **kwargs):\n",
|
32 |
+
" super().__init__(**kwargs)\n",
|
33 |
+
" self.add_ee_data()\n",
|
34 |
+
" self.add(\"layer_manager\")\n",
|
35 |
+
" self.add(\"inspector\")\n",
|
36 |
+
"\n",
|
37 |
+
" def add_ee_data(self):\n",
|
38 |
+
" # Add Earth Engine dataset\n",
|
39 |
+
" dem = ee.Image(\"USGS/SRTMGL1_003\")\n",
|
40 |
+
" landsat7 = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\").select(\n",
|
41 |
+
" [\"B1\", \"B2\", \"B3\", \"B4\", \"B5\", \"B7\"]\n",
|
42 |
+
" )\n",
|
43 |
+
" states = ee.FeatureCollection(\"TIGER/2018/States\")\n",
|
44 |
+
"\n",
|
45 |
+
" # Set visualization parameters.\n",
|
46 |
+
" vis_params = {\n",
|
47 |
+
" \"min\": 0,\n",
|
48 |
+
" \"max\": 4000,\n",
|
49 |
+
" \"palette\": [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"],\n",
|
50 |
+
" }\n",
|
51 |
+
"\n",
|
52 |
+
" # Add Earth Engine layers to Map\n",
|
53 |
+
" self.addLayer(\n",
|
54 |
+
" landsat7,\n",
|
55 |
+
" {\"bands\": [\"B4\", \"B3\", \"B2\"], \"min\": 20, \"max\": 200, \"gamma\": 2.0},\n",
|
56 |
+
" \"Landsat 7\",\n",
|
57 |
+
" True,\n",
|
58 |
+
" )\n",
|
59 |
+
" self.addLayer(dem, vis_params, \"SRTM DEM\", True, 1)\n",
|
60 |
+
" self.addLayer(states, {}, \"US States\")\n",
|
61 |
+
"\n",
|
62 |
+
"\n",
|
63 |
+
"@solara.component\n",
|
64 |
+
"def Page():\n",
|
65 |
+
" with solara.Column(style={\"min-width\": \"500px\", \"isolation\": \"isolate\"}):\n",
|
66 |
+
" Map.element(\n",
|
67 |
+
" center=[40, -100],\n",
|
68 |
+
" zoom=4,\n",
|
69 |
+
" height=\"600px\",\n",
|
70 |
+
" )"
|
71 |
+
]
|
72 |
+
},
|
73 |
+
{
|
74 |
+
"cell_type": "code",
|
75 |
+
"execution_count": null,
|
76 |
+
"metadata": {},
|
77 |
+
"outputs": [],
|
78 |
+
"source": [
|
79 |
+
"Page()"
|
80 |
+
]
|
81 |
+
}
|
82 |
+
],
|
83 |
+
"metadata": {
|
84 |
+
"kernelspec": {
|
85 |
+
"display_name": "geo",
|
86 |
+
"language": "python",
|
87 |
+
"name": "python3"
|
88 |
+
},
|
89 |
+
"language_info": {
|
90 |
+
"codemirror_mode": {
|
91 |
+
"name": "ipython",
|
92 |
+
"version": 3
|
93 |
+
},
|
94 |
+
"file_extension": ".py",
|
95 |
+
"mimetype": "text/x-python",
|
96 |
+
"name": "python",
|
97 |
+
"nbconvert_exporter": "python",
|
98 |
+
"pygments_lexer": "ipython3",
|
99 |
+
"version": "3.11.8"
|
100 |
+
}
|
101 |
+
},
|
102 |
+
"nbformat": 4,
|
103 |
+
"nbformat_minor": 2
|
104 |
+
}
|
notebooks/03_plotting.ipynb
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/03_plotting.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import ee\n",
|
26 |
+
"import geemap\n",
|
27 |
+
"import solara\n",
|
28 |
+
"\n",
|
29 |
+
"\n",
|
30 |
+
"class Map(geemap.Map):\n",
|
31 |
+
" def __init__(self, **kwargs):\n",
|
32 |
+
" super().__init__(**kwargs)\n",
|
33 |
+
" self.add_ee_data()\n",
|
34 |
+
" self.add_plot_gui()\n",
|
35 |
+
"\n",
|
36 |
+
" def add_ee_data(self):\n",
|
37 |
+
" landsat7 = ee.Image(\"LANDSAT/LE7_TOA_5YEAR/1999_2003\").select(\n",
|
38 |
+
" [\"B1\", \"B2\", \"B3\", \"B4\", \"B5\", \"B7\"]\n",
|
39 |
+
" )\n",
|
40 |
+
"\n",
|
41 |
+
" landsat_vis = {\"bands\": [\"B4\", \"B3\", \"B2\"], \"gamma\": 1.4}\n",
|
42 |
+
" self.addLayer(landsat7, landsat_vis, \"Landsat\")\n",
|
43 |
+
"\n",
|
44 |
+
" hyperion = ee.ImageCollection(\"EO1/HYPERION\").filter(\n",
|
45 |
+
" ee.Filter.date(\"2016-01-01\", \"2017-03-01\")\n",
|
46 |
+
" )\n",
|
47 |
+
"\n",
|
48 |
+
" hyperion_vis = {\n",
|
49 |
+
" \"min\": 1000.0,\n",
|
50 |
+
" \"max\": 14000.0,\n",
|
51 |
+
" \"gamma\": 2.5,\n",
|
52 |
+
" }\n",
|
53 |
+
" self.addLayer(hyperion, hyperion_vis, \"Hyperion\")\n",
|
54 |
+
"\n",
|
55 |
+
"\n",
|
56 |
+
"@solara.component\n",
|
57 |
+
"def Page():\n",
|
58 |
+
" with solara.Column(style={\"min-width\": \"500px\", \"isolation\": \"isolate\"}):\n",
|
59 |
+
" Map.element(\n",
|
60 |
+
" center=[40, -100],\n",
|
61 |
+
" zoom=4,\n",
|
62 |
+
" height=\"600px\",\n",
|
63 |
+
" )"
|
64 |
+
]
|
65 |
+
},
|
66 |
+
{
|
67 |
+
"cell_type": "code",
|
68 |
+
"execution_count": null,
|
69 |
+
"metadata": {},
|
70 |
+
"outputs": [],
|
71 |
+
"source": [
|
72 |
+
"Page()"
|
73 |
+
]
|
74 |
+
}
|
75 |
+
],
|
76 |
+
"metadata": {
|
77 |
+
"kernelspec": {
|
78 |
+
"display_name": "geo",
|
79 |
+
"language": "python",
|
80 |
+
"name": "python3"
|
81 |
+
},
|
82 |
+
"language_info": {
|
83 |
+
"codemirror_mode": {
|
84 |
+
"name": "ipython",
|
85 |
+
"version": 3
|
86 |
+
},
|
87 |
+
"file_extension": ".py",
|
88 |
+
"mimetype": "text/x-python",
|
89 |
+
"name": "python",
|
90 |
+
"nbconvert_exporter": "python",
|
91 |
+
"pygments_lexer": "ipython3",
|
92 |
+
"version": "3.11.8"
|
93 |
+
}
|
94 |
+
},
|
95 |
+
"nbformat": 4,
|
96 |
+
"nbformat_minor": 2
|
97 |
+
}
|
notebooks/04_split_map.ipynb
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/04_split_map.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import ee\n",
|
26 |
+
"import geemap\n",
|
27 |
+
"import solara\n",
|
28 |
+
"\n",
|
29 |
+
"\n",
|
30 |
+
"class Map(geemap.Map):\n",
|
31 |
+
" def __init__(self, **kwargs):\n",
|
32 |
+
" super().__init__(**kwargs)\n",
|
33 |
+
" self.add_ee_data()\n",
|
34 |
+
"\n",
|
35 |
+
" def add_ee_data(self):\n",
|
36 |
+
" # Select the eight NLCD epochs after 2000.\n",
|
37 |
+
" years = [\"2001\", \"2004\", \"2006\", \"2008\", \"2011\", \"2013\", \"2016\", \"2019\"]\n",
|
38 |
+
"\n",
|
39 |
+
" # Get an NLCD image by year.\n",
|
40 |
+
" def getNLCD(year):\n",
|
41 |
+
" # Import the NLCD collection.\n",
|
42 |
+
" dataset = ee.ImageCollection(\"USGS/NLCD_RELEASES/2019_REL/NLCD\")\n",
|
43 |
+
"\n",
|
44 |
+
" # Filter the collection by year.\n",
|
45 |
+
" nlcd = dataset.filter(ee.Filter.eq(\"system:index\", year)).first()\n",
|
46 |
+
"\n",
|
47 |
+
" # Select the land cover band.\n",
|
48 |
+
" landcover = nlcd.select(\"landcover\")\n",
|
49 |
+
" return landcover\n",
|
50 |
+
"\n",
|
51 |
+
" ## Create an NLCD image collection for the selected years.\n",
|
52 |
+
" collection = ee.ImageCollection(ee.List(years).map(lambda year: getNLCD(year)))\n",
|
53 |
+
"\n",
|
54 |
+
" # Create a list of labels to populate the dropdown list.\n",
|
55 |
+
" labels = [f\"NLCD {year}\" for year in years]\n",
|
56 |
+
"\n",
|
57 |
+
" # Add a split-panel map for visualizing NLCD land cover change.\n",
|
58 |
+
" self.ts_inspector(\n",
|
59 |
+
" left_ts=collection,\n",
|
60 |
+
" right_ts=collection,\n",
|
61 |
+
" left_names=labels,\n",
|
62 |
+
" right_names=labels,\n",
|
63 |
+
" )\n",
|
64 |
+
"\n",
|
65 |
+
" # Add the NLCD legend to the map.\n",
|
66 |
+
" self.add_legend(\n",
|
67 |
+
" title=\"NLCD Land Cover Type\",\n",
|
68 |
+
" builtin_legend=\"NLCD\",\n",
|
69 |
+
" height=\"460px\",\n",
|
70 |
+
" add_header=False,\n",
|
71 |
+
" )\n",
|
72 |
+
"\n",
|
73 |
+
"\n",
|
74 |
+
"@solara.component\n",
|
75 |
+
"def Page():\n",
|
76 |
+
" with solara.Column(style={\"min-width\": \"500px\", \"isolation\": \"isolate\"}):\n",
|
77 |
+
" Map.element(\n",
|
78 |
+
" center=[40, -100],\n",
|
79 |
+
" zoom=4,\n",
|
80 |
+
" height=\"600px\",\n",
|
81 |
+
" )"
|
82 |
+
]
|
83 |
+
},
|
84 |
+
{
|
85 |
+
"cell_type": "code",
|
86 |
+
"execution_count": null,
|
87 |
+
"metadata": {},
|
88 |
+
"outputs": [],
|
89 |
+
"source": [
|
90 |
+
"Page()"
|
91 |
+
]
|
92 |
+
}
|
93 |
+
],
|
94 |
+
"metadata": {
|
95 |
+
"kernelspec": {
|
96 |
+
"display_name": "geo",
|
97 |
+
"language": "python",
|
98 |
+
"name": "python3"
|
99 |
+
},
|
100 |
+
"language_info": {
|
101 |
+
"codemirror_mode": {
|
102 |
+
"name": "ipython",
|
103 |
+
"version": 3
|
104 |
+
},
|
105 |
+
"file_extension": ".py",
|
106 |
+
"mimetype": "text/x-python",
|
107 |
+
"name": "python",
|
108 |
+
"nbconvert_exporter": "python",
|
109 |
+
"pygments_lexer": "ipython3",
|
110 |
+
"version": "3.11.8"
|
111 |
+
}
|
112 |
+
},
|
113 |
+
"nbformat": 4,
|
114 |
+
"nbformat_minor": 2
|
115 |
+
}
|
notebooks/05_timelapse.ipynb
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/05_timelapse.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import geemap\n",
|
26 |
+
"import solara\n",
|
27 |
+
"\n",
|
28 |
+
"\n",
|
29 |
+
"class Map(geemap.Map):\n",
|
30 |
+
" def __init__(self, **kwargs):\n",
|
31 |
+
" super().__init__(**kwargs)\n",
|
32 |
+
" self.add_basemap(\"Esri.WorldImagery\")\n",
|
33 |
+
" self.add_gui(\"timelapse\", basemap=None)\n",
|
34 |
+
"\n",
|
35 |
+
"\n",
|
36 |
+
"@solara.component\n",
|
37 |
+
"def Page():\n",
|
38 |
+
" with solara.Column(style={\"min-width\": \"500px\", \"isolation\": \"isolate\"}):\n",
|
39 |
+
" Map.element(\n",
|
40 |
+
" center=[20, -0],\n",
|
41 |
+
" zoom=2,\n",
|
42 |
+
" height=\"750px\",\n",
|
43 |
+
" zoom_ctrl=False,\n",
|
44 |
+
" measure_ctrl=False,\n",
|
45 |
+
" )"
|
46 |
+
]
|
47 |
+
},
|
48 |
+
{
|
49 |
+
"cell_type": "code",
|
50 |
+
"execution_count": null,
|
51 |
+
"metadata": {},
|
52 |
+
"outputs": [],
|
53 |
+
"source": [
|
54 |
+
"Page()"
|
55 |
+
]
|
56 |
+
}
|
57 |
+
],
|
58 |
+
"metadata": {
|
59 |
+
"kernelspec": {
|
60 |
+
"display_name": "geo",
|
61 |
+
"language": "python",
|
62 |
+
"name": "python3"
|
63 |
+
},
|
64 |
+
"language_info": {
|
65 |
+
"codemirror_mode": {
|
66 |
+
"name": "ipython",
|
67 |
+
"version": 3
|
68 |
+
},
|
69 |
+
"file_extension": ".py",
|
70 |
+
"mimetype": "text/x-python",
|
71 |
+
"name": "python",
|
72 |
+
"nbconvert_exporter": "python",
|
73 |
+
"pygments_lexer": "ipython3",
|
74 |
+
"version": "3.11.8"
|
75 |
+
}
|
76 |
+
},
|
77 |
+
"nbformat": 4,
|
78 |
+
"nbformat_minor": 2
|
79 |
+
}
|
notebooks/06_timeseries.ipynb
ADDED
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/06_timeseries.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import geemap\n",
|
26 |
+
"import ipywidgets as widgets\n",
|
27 |
+
"import solara\n",
|
28 |
+
"from geemap import get_current_year, jslink_slider_label\n",
|
29 |
+
"\n",
|
30 |
+
"\n",
|
31 |
+
"class Map(geemap.Map):\n",
|
32 |
+
" def __init__(self, **kwargs):\n",
|
33 |
+
" super().__init__(**kwargs)\n",
|
34 |
+
" self.add_basemap(\"Esri.WorldImagery\")\n",
|
35 |
+
" self.add_ts_gui(position=\"topright\")\n",
|
36 |
+
"\n",
|
37 |
+
" def clean_up(self):\n",
|
38 |
+
" if hasattr(self, \"slider_ctrl\") and self.slider_ctrl is not None:\n",
|
39 |
+
" self.remove(self.slider_ctrl)\n",
|
40 |
+
" delattr(self, \"slider_ctrl\")\n",
|
41 |
+
"\n",
|
42 |
+
" layer = self.find_layer(\"Time series\")\n",
|
43 |
+
" if layer is not None:\n",
|
44 |
+
" self.remove(layer)\n",
|
45 |
+
" layer = self.find_layer(\"Image X\")\n",
|
46 |
+
" if layer is not None:\n",
|
47 |
+
" self.remove(layer)\n",
|
48 |
+
"\n",
|
49 |
+
" draw_layer = self.find_layer(\"Drawn Features\")\n",
|
50 |
+
" if draw_layer is not None:\n",
|
51 |
+
" self.remove(draw_layer)\n",
|
52 |
+
"\n",
|
53 |
+
" def add_ts_gui(self, position=\"topright\", **kwargs):\n",
|
54 |
+
"\n",
|
55 |
+
" widget_width = \"350px\"\n",
|
56 |
+
" padding = \"0px 0px 0px 5px\" # upper, right, bottom, left\n",
|
57 |
+
" style = {\"description_width\": \"initial\"}\n",
|
58 |
+
" current_year = get_current_year()\n",
|
59 |
+
"\n",
|
60 |
+
" collection = widgets.Dropdown(\n",
|
61 |
+
" options=[\n",
|
62 |
+
" \"Landsat TM-ETM-OLI Surface Reflectance\",\n",
|
63 |
+
" ],\n",
|
64 |
+
" value=\"Landsat TM-ETM-OLI Surface Reflectance\",\n",
|
65 |
+
" description=\"Collection:\",\n",
|
66 |
+
" layout=widgets.Layout(width=widget_width, padding=padding),\n",
|
67 |
+
" style=style,\n",
|
68 |
+
" )\n",
|
69 |
+
" bands = widgets.Dropdown(\n",
|
70 |
+
" description=\"Bands:\",\n",
|
71 |
+
" options=[\n",
|
72 |
+
" \"Red/Green/Blue\",\n",
|
73 |
+
" \"NIR/Red/Green\",\n",
|
74 |
+
" \"SWIR2/SWIR1/NIR\",\n",
|
75 |
+
" \"NIR/SWIR1/Red\",\n",
|
76 |
+
" \"SWIR2/NIR/Red\",\n",
|
77 |
+
" \"SWIR2/SWIR1/Red\",\n",
|
78 |
+
" \"SWIR1/NIR/Blue\",\n",
|
79 |
+
" \"NIR/SWIR1/Blue\",\n",
|
80 |
+
" \"SWIR2/NIR/Green\",\n",
|
81 |
+
" \"SWIR1/NIR/Red\",\n",
|
82 |
+
" ],\n",
|
83 |
+
" value=\"SWIR1/NIR/Red\",\n",
|
84 |
+
" style=style,\n",
|
85 |
+
" layout=widgets.Layout(width=\"195px\", padding=padding),\n",
|
86 |
+
" )\n",
|
87 |
+
"\n",
|
88 |
+
" frequency = widgets.Dropdown(\n",
|
89 |
+
" description=\"Frequency:\",\n",
|
90 |
+
" options=[\"year\", \"quarter\", \"month\"],\n",
|
91 |
+
" value=\"year\",\n",
|
92 |
+
" style=style,\n",
|
93 |
+
" layout=widgets.Layout(width=\"150px\", padding=padding),\n",
|
94 |
+
" )\n",
|
95 |
+
"\n",
|
96 |
+
" start_year = widgets.IntSlider(\n",
|
97 |
+
" description=\"Start Year:\",\n",
|
98 |
+
" value=1984,\n",
|
99 |
+
" min=1984,\n",
|
100 |
+
" max=current_year,\n",
|
101 |
+
" readout=False,\n",
|
102 |
+
" style=style,\n",
|
103 |
+
" layout=widgets.Layout(width=\"138px\", padding=padding),\n",
|
104 |
+
" )\n",
|
105 |
+
"\n",
|
106 |
+
" start_year_label = widgets.Label(\"1984\")\n",
|
107 |
+
" jslink_slider_label(start_year, start_year_label)\n",
|
108 |
+
"\n",
|
109 |
+
" end_year = widgets.IntSlider(\n",
|
110 |
+
" description=\"End Year:\",\n",
|
111 |
+
" value=current_year,\n",
|
112 |
+
" min=1984,\n",
|
113 |
+
" max=current_year,\n",
|
114 |
+
" readout=False,\n",
|
115 |
+
" style=style,\n",
|
116 |
+
" layout=widgets.Layout(width=\"138px\", padding=padding),\n",
|
117 |
+
" )\n",
|
118 |
+
" end_year_label = widgets.Label(str(current_year))\n",
|
119 |
+
" jslink_slider_label(end_year, end_year_label)\n",
|
120 |
+
"\n",
|
121 |
+
" start_month = widgets.IntSlider(\n",
|
122 |
+
" description=\"Start Month:\",\n",
|
123 |
+
" value=5,\n",
|
124 |
+
" min=1,\n",
|
125 |
+
" max=12,\n",
|
126 |
+
" readout=False,\n",
|
127 |
+
" style=style,\n",
|
128 |
+
" layout=widgets.Layout(width=\"145px\", padding=padding),\n",
|
129 |
+
" )\n",
|
130 |
+
"\n",
|
131 |
+
" start_month_label = widgets.Label(\n",
|
132 |
+
" \"5\",\n",
|
133 |
+
" layout=widgets.Layout(width=\"20px\", padding=padding),\n",
|
134 |
+
" )\n",
|
135 |
+
" jslink_slider_label(start_month, start_month_label)\n",
|
136 |
+
"\n",
|
137 |
+
" end_month = widgets.IntSlider(\n",
|
138 |
+
" description=\"End Month:\",\n",
|
139 |
+
" value=10,\n",
|
140 |
+
" min=1,\n",
|
141 |
+
" max=12,\n",
|
142 |
+
" readout=False,\n",
|
143 |
+
" style=style,\n",
|
144 |
+
" layout=widgets.Layout(width=\"155px\", padding=padding),\n",
|
145 |
+
" )\n",
|
146 |
+
"\n",
|
147 |
+
" end_month_label = widgets.Label(\"10\")\n",
|
148 |
+
" jslink_slider_label(end_month, end_month_label)\n",
|
149 |
+
"\n",
|
150 |
+
" output = widgets.Output()\n",
|
151 |
+
"\n",
|
152 |
+
" button_width = \"113px\"\n",
|
153 |
+
" apply_btn = widgets.Button(\n",
|
154 |
+
" description=\"Time slider\",\n",
|
155 |
+
" button_style=\"primary\",\n",
|
156 |
+
" tooltip=\"Click to create timeseries\",\n",
|
157 |
+
" style=style,\n",
|
158 |
+
" layout=widgets.Layout(padding=\"0px\", width=button_width),\n",
|
159 |
+
" )\n",
|
160 |
+
"\n",
|
161 |
+
" split_btn = widgets.Button(\n",
|
162 |
+
" description=\"Split map\",\n",
|
163 |
+
" button_style=\"primary\",\n",
|
164 |
+
" tooltip=\"Click to create timeseries\",\n",
|
165 |
+
" style=style,\n",
|
166 |
+
" layout=widgets.Layout(padding=\"0px\", width=button_width),\n",
|
167 |
+
" )\n",
|
168 |
+
"\n",
|
169 |
+
" reset_btn = widgets.Button(\n",
|
170 |
+
" description=\"Reset\",\n",
|
171 |
+
" button_style=\"primary\",\n",
|
172 |
+
" style=style,\n",
|
173 |
+
" layout=widgets.Layout(padding=\"0px\", width=button_width),\n",
|
174 |
+
" )\n",
|
175 |
+
"\n",
|
176 |
+
" vbox = widgets.VBox(\n",
|
177 |
+
" [\n",
|
178 |
+
" collection,\n",
|
179 |
+
" widgets.HBox([bands, frequency]),\n",
|
180 |
+
" widgets.HBox([start_year, start_year_label, end_year, end_year_label]),\n",
|
181 |
+
" widgets.HBox(\n",
|
182 |
+
" [start_month, start_month_label, end_month, end_month_label]\n",
|
183 |
+
" ),\n",
|
184 |
+
" widgets.HBox([apply_btn, split_btn, reset_btn]),\n",
|
185 |
+
" output,\n",
|
186 |
+
" ]\n",
|
187 |
+
" )\n",
|
188 |
+
" self.add_widget(vbox, position=position, add_header=True)\n",
|
189 |
+
"\n",
|
190 |
+
" def apply_btn_click(change):\n",
|
191 |
+
"\n",
|
192 |
+
" if hasattr(self, \"slider_ctrl\") and self.slider_ctrl is not None:\n",
|
193 |
+
" self.remove(self.slider_ctrl)\n",
|
194 |
+
" delattr(self, \"slider_ctrl\")\n",
|
195 |
+
"\n",
|
196 |
+
" with output:\n",
|
197 |
+
" output.clear_output()\n",
|
198 |
+
" if self.user_roi is None:\n",
|
199 |
+
" output.append_stdout(\"Please draw a ROI first.\")\n",
|
200 |
+
" else:\n",
|
201 |
+
" output.append_stdout(\"Creating time series...\")\n",
|
202 |
+
" collection = geemap.landsat_timeseries(\n",
|
203 |
+
" roi=self.user_roi,\n",
|
204 |
+
" start_year=start_year.value,\n",
|
205 |
+
" end_year=end_year.value,\n",
|
206 |
+
" start_date=str(start_month.value).zfill(2) + \"-01\",\n",
|
207 |
+
" end_date=str(end_month.value).zfill(2) + \"-01\",\n",
|
208 |
+
" frequency=frequency.value,\n",
|
209 |
+
" )\n",
|
210 |
+
" vis_params = {\n",
|
211 |
+
" \"bands\": bands.value.split(\"/\"),\n",
|
212 |
+
" \"min\": 0,\n",
|
213 |
+
" \"max\": 0.4,\n",
|
214 |
+
" }\n",
|
215 |
+
"\n",
|
216 |
+
" if frequency.value == \"year\":\n",
|
217 |
+
" date_format = \"YYYY\"\n",
|
218 |
+
" elif frequency.value == \"quarter\":\n",
|
219 |
+
" date_format = \"YYYY-MM\"\n",
|
220 |
+
" elif frequency.value == \"month\":\n",
|
221 |
+
" date_format = \"YYYY-MM\"\n",
|
222 |
+
"\n",
|
223 |
+
" self.add_time_slider(\n",
|
224 |
+
" collection,\n",
|
225 |
+
" region=self.user_roi,\n",
|
226 |
+
" vis_params=vis_params,\n",
|
227 |
+
" date_format=date_format,\n",
|
228 |
+
" )\n",
|
229 |
+
" self._draw_control.clear()\n",
|
230 |
+
" draw_layer = self.find_layer(\"Drawn Features\")\n",
|
231 |
+
" if draw_layer is not None:\n",
|
232 |
+
" self.remove(draw_layer)\n",
|
233 |
+
" output.clear_output()\n",
|
234 |
+
"\n",
|
235 |
+
" apply_btn.on_click(apply_btn_click)\n",
|
236 |
+
"\n",
|
237 |
+
" def split_btn_click(change):\n",
|
238 |
+
"\n",
|
239 |
+
" if hasattr(self, \"slider_ctrl\") and self.slider_ctrl is not None:\n",
|
240 |
+
" self.remove(self.slider_ctrl)\n",
|
241 |
+
" delattr(self, \"slider_ctrl\")\n",
|
242 |
+
"\n",
|
243 |
+
" with output:\n",
|
244 |
+
" output.clear_output()\n",
|
245 |
+
" if self.user_roi is None:\n",
|
246 |
+
" output.append_stdout(\"Please draw a ROI first.\")\n",
|
247 |
+
" else:\n",
|
248 |
+
" output.append_stdout(\"Creating time series...\")\n",
|
249 |
+
" collection = geemap.landsat_timeseries(\n",
|
250 |
+
" roi=self.user_roi,\n",
|
251 |
+
" start_year=start_year.value,\n",
|
252 |
+
" end_year=end_year.value,\n",
|
253 |
+
" start_date=str(start_month.value).zfill(2) + \"-01\",\n",
|
254 |
+
" end_date=str(end_month.value).zfill(2) + \"-01\",\n",
|
255 |
+
" frequency=frequency.value,\n",
|
256 |
+
" )\n",
|
257 |
+
" vis_params = {\n",
|
258 |
+
" \"bands\": bands.value.split(\"/\"),\n",
|
259 |
+
" \"min\": 0,\n",
|
260 |
+
" \"max\": 0.4,\n",
|
261 |
+
" }\n",
|
262 |
+
"\n",
|
263 |
+
" if frequency.value == \"year\":\n",
|
264 |
+
" date_format = \"YYYY\"\n",
|
265 |
+
" dates = geemap.image_dates(collection, date_format).getInfo()\n",
|
266 |
+
" elif frequency.value == \"quarter\":\n",
|
267 |
+
" date_format = \"YYYY-MM\"\n",
|
268 |
+
" dates = geemap.image_dates(collection, date_format).getInfo()\n",
|
269 |
+
" elif frequency.value == \"month\":\n",
|
270 |
+
" date_format = \"YYYY-MM\"\n",
|
271 |
+
" dates = geemap.image_dates(collection, date_format).getInfo()\n",
|
272 |
+
"\n",
|
273 |
+
" self.ts_inspector(\n",
|
274 |
+
" collection,\n",
|
275 |
+
" left_names=dates,\n",
|
276 |
+
" left_vis=vis_params,\n",
|
277 |
+
" add_close_button=True,\n",
|
278 |
+
" )\n",
|
279 |
+
" output.clear_output()\n",
|
280 |
+
"\n",
|
281 |
+
" try:\n",
|
282 |
+
" self._draw_control.clear()\n",
|
283 |
+
" draw_layer = self.find_layer(\"Drawn Features\")\n",
|
284 |
+
" if draw_layer is not None:\n",
|
285 |
+
" self.remove(draw_layer)\n",
|
286 |
+
" except Exception as e:\n",
|
287 |
+
" print(e)\n",
|
288 |
+
"\n",
|
289 |
+
" split_btn.on_click(split_btn_click)\n",
|
290 |
+
"\n",
|
291 |
+
" def reset_btn_click(change):\n",
|
292 |
+
" output.clear_output()\n",
|
293 |
+
" self.clean_up()\n",
|
294 |
+
"\n",
|
295 |
+
" reset_btn.on_click(reset_btn_click)\n",
|
296 |
+
"\n",
|
297 |
+
"\n",
|
298 |
+
"@solara.component\n",
|
299 |
+
"def Page():\n",
|
300 |
+
" with solara.Column(style={\"min-width\": \"500px\"}):\n",
|
301 |
+
" Map.element(\n",
|
302 |
+
" center=[20, -0],\n",
|
303 |
+
" zoom=2,\n",
|
304 |
+
" height=\"750px\",\n",
|
305 |
+
" zoom_ctrl=False,\n",
|
306 |
+
" measure_ctrl=False,\n",
|
307 |
+
" )"
|
308 |
+
]
|
309 |
+
},
|
310 |
+
{
|
311 |
+
"cell_type": "code",
|
312 |
+
"execution_count": null,
|
313 |
+
"metadata": {},
|
314 |
+
"outputs": [],
|
315 |
+
"source": [
|
316 |
+
"Page()"
|
317 |
+
]
|
318 |
+
},
|
319 |
+
{
|
320 |
+
"cell_type": "code",
|
321 |
+
"execution_count": null,
|
322 |
+
"metadata": {},
|
323 |
+
"outputs": [],
|
324 |
+
"source": []
|
325 |
+
}
|
326 |
+
],
|
327 |
+
"metadata": {
|
328 |
+
"kernelspec": {
|
329 |
+
"display_name": "geo",
|
330 |
+
"language": "python",
|
331 |
+
"name": "python3"
|
332 |
+
},
|
333 |
+
"language_info": {
|
334 |
+
"codemirror_mode": {
|
335 |
+
"name": "ipython",
|
336 |
+
"version": 3
|
337 |
+
},
|
338 |
+
"file_extension": ".py",
|
339 |
+
"mimetype": "text/x-python",
|
340 |
+
"name": "python",
|
341 |
+
"nbconvert_exporter": "python",
|
342 |
+
"pygments_lexer": "ipython3",
|
343 |
+
"version": "3.11.8"
|
344 |
+
}
|
345 |
+
},
|
346 |
+
"nbformat": 4,
|
347 |
+
"nbformat_minor": 2
|
348 |
+
}
|
notebooks/07_jrc.ipynb
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/07_jrc.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import ee\n",
|
26 |
+
"import geemap\n",
|
27 |
+
"import ipywidgets as widgets\n",
|
28 |
+
"from IPython.display import display\n",
|
29 |
+
"import solara\n",
|
30 |
+
"\n",
|
31 |
+
"\n",
|
32 |
+
"class Map(geemap.Map):\n",
|
33 |
+
" def __init__(self, **kwargs):\n",
|
34 |
+
" super().__init__(**kwargs)\n",
|
35 |
+
" self.add_basemap(\"Esri.WorldImagery\")\n",
|
36 |
+
" self.add_ee_data()\n",
|
37 |
+
" self.add_buttons(add_header=True)\n",
|
38 |
+
"\n",
|
39 |
+
" def add_ee_data(self):\n",
|
40 |
+
"\n",
|
41 |
+
" dataset = ee.Image(\"JRC/GSW1_4/GlobalSurfaceWater\")\n",
|
42 |
+
" image = dataset.select([\"occurrence\"])\n",
|
43 |
+
" vis_params = {\n",
|
44 |
+
" \"min\": 0.0,\n",
|
45 |
+
" \"max\": 100.0,\n",
|
46 |
+
" \"palette\": [\"ffffff\", \"ffbbbb\", \"0000ff\"],\n",
|
47 |
+
" }\n",
|
48 |
+
" self.addLayer(image, vis_params, \"Occurrence\")\n",
|
49 |
+
" self.add_colorbar(\n",
|
50 |
+
" vis_params, label=\"Water occurrence (%)\", layer_name=\"Occurrence\"\n",
|
51 |
+
" )\n",
|
52 |
+
"\n",
|
53 |
+
" def add_buttons(self, position=\"topright\", **kwargs):\n",
|
54 |
+
" padding = \"0px 5px 0px 5px\"\n",
|
55 |
+
" widget = widgets.VBox(layout=widgets.Layout(padding=padding))\n",
|
56 |
+
" layout = widgets.Layout(width=\"auto\")\n",
|
57 |
+
" style = {\"description_width\": \"initial\"}\n",
|
58 |
+
" hist_btn = widgets.Button(description=\"Occurrence\", layout=layout)\n",
|
59 |
+
" bar_btn = widgets.Button(description=\"Monthly history\", layout=layout)\n",
|
60 |
+
" reset_btn = widgets.Button(description=\"Reset\", layout=layout)\n",
|
61 |
+
" scale = widgets.IntSlider(\n",
|
62 |
+
" min=30, max=1000, value=90, description=\"Scale\", layout=layout, style=style\n",
|
63 |
+
" )\n",
|
64 |
+
" month_slider = widgets.IntRangeSlider(\n",
|
65 |
+
" description=\"Months\",\n",
|
66 |
+
" value=[5, 10],\n",
|
67 |
+
" min=1,\n",
|
68 |
+
" max=12,\n",
|
69 |
+
" step=1,\n",
|
70 |
+
" layout=layout,\n",
|
71 |
+
" style=style,\n",
|
72 |
+
" )\n",
|
73 |
+
" widget.children = [\n",
|
74 |
+
" widgets.HBox([hist_btn, bar_btn, reset_btn]),\n",
|
75 |
+
" month_slider,\n",
|
76 |
+
" scale,\n",
|
77 |
+
" ]\n",
|
78 |
+
" self.add_widget(widget, position=position, **kwargs)\n",
|
79 |
+
" output = widgets.Output()\n",
|
80 |
+
" self.add_widget(output, position=\"bottomleft\", add_header=False)\n",
|
81 |
+
"\n",
|
82 |
+
" def hist_btn_click(b):\n",
|
83 |
+
" region = self.user_roi\n",
|
84 |
+
" if region is not None:\n",
|
85 |
+
" output.clear_output()\n",
|
86 |
+
" output.append_stdout(\"Computing histogram...\")\n",
|
87 |
+
" image = ee.Image(\"JRC/GSW1_4/GlobalSurfaceWater\").select([\"occurrence\"])\n",
|
88 |
+
" self.default_style = {\"cursor\": \"wait\"}\n",
|
89 |
+
" hist = geemap.image_histogram(\n",
|
90 |
+
" image,\n",
|
91 |
+
" region,\n",
|
92 |
+
" scale=scale.value,\n",
|
93 |
+
" height=350,\n",
|
94 |
+
" width=550,\n",
|
95 |
+
" x_label=\"Water Occurrence (%)\",\n",
|
96 |
+
" y_label=\"Pixel Count\",\n",
|
97 |
+
" layout_args={\n",
|
98 |
+
" \"title\": dict(x=0.5),\n",
|
99 |
+
" \"margin\": dict(l=0, r=0, t=10, b=0),\n",
|
100 |
+
" },\n",
|
101 |
+
" return_df=False,\n",
|
102 |
+
" )\n",
|
103 |
+
"\n",
|
104 |
+
" with output:\n",
|
105 |
+
" output.clear_output()\n",
|
106 |
+
" display(hist)\n",
|
107 |
+
" self.default_style = {\"cursor\": \"default\"}\n",
|
108 |
+
" else:\n",
|
109 |
+
" output.clear_output()\n",
|
110 |
+
" with output:\n",
|
111 |
+
" output.append_stdout(\"Please draw a region of interest first.\")\n",
|
112 |
+
"\n",
|
113 |
+
" hist_btn.on_click(hist_btn_click)\n",
|
114 |
+
"\n",
|
115 |
+
" def bar_btn_click(b):\n",
|
116 |
+
" region = self.user_roi\n",
|
117 |
+
" if region is not None:\n",
|
118 |
+
" self.default_style = {\"cursor\": \"wait\"}\n",
|
119 |
+
" output.clear_output()\n",
|
120 |
+
" output.append_stdout(\"Computing monthly history...\")\n",
|
121 |
+
" bar = geemap.jrc_hist_monthly_history(\n",
|
122 |
+
" region=region,\n",
|
123 |
+
" scale=scale.value,\n",
|
124 |
+
" height=350,\n",
|
125 |
+
" width=550,\n",
|
126 |
+
" layout_args={\n",
|
127 |
+
" \"title\": dict(x=0.5),\n",
|
128 |
+
" \"margin\": dict(l=0, r=0, t=10, b=0),\n",
|
129 |
+
" },\n",
|
130 |
+
" frequency=\"month\",\n",
|
131 |
+
" start_month=month_slider.value[0],\n",
|
132 |
+
" end_month=month_slider.value[1],\n",
|
133 |
+
" denominator=1e4,\n",
|
134 |
+
" y_label=\"Area (ha)\",\n",
|
135 |
+
" )\n",
|
136 |
+
"\n",
|
137 |
+
" with output:\n",
|
138 |
+
" output.clear_output()\n",
|
139 |
+
" display(bar)\n",
|
140 |
+
" self.default_style = {\"cursor\": \"default\"}\n",
|
141 |
+
" else:\n",
|
142 |
+
" output.clear_output()\n",
|
143 |
+
" with output:\n",
|
144 |
+
" output.append_stdout(\"Please draw a region of interest first.\")\n",
|
145 |
+
"\n",
|
146 |
+
" bar_btn.on_click(bar_btn_click)\n",
|
147 |
+
"\n",
|
148 |
+
" def reset_btn_click(b):\n",
|
149 |
+
" self._draw_control.clear()\n",
|
150 |
+
" output.clear_output()\n",
|
151 |
+
"\n",
|
152 |
+
" reset_btn.on_click(reset_btn_click)\n",
|
153 |
+
"\n",
|
154 |
+
"\n",
|
155 |
+
"@solara.component\n",
|
156 |
+
"def Page():\n",
|
157 |
+
" with solara.Column(style={\"min-width\": \"500px\"}):\n",
|
158 |
+
" Map.element(\n",
|
159 |
+
" center=[20, -0],\n",
|
160 |
+
" zoom=2,\n",
|
161 |
+
" height=\"750px\",\n",
|
162 |
+
" zoom_ctrl=False,\n",
|
163 |
+
" measure_ctrl=False,\n",
|
164 |
+
" )"
|
165 |
+
]
|
166 |
+
},
|
167 |
+
{
|
168 |
+
"cell_type": "code",
|
169 |
+
"execution_count": null,
|
170 |
+
"metadata": {},
|
171 |
+
"outputs": [],
|
172 |
+
"source": [
|
173 |
+
"Page()"
|
174 |
+
]
|
175 |
+
},
|
176 |
+
{
|
177 |
+
"cell_type": "code",
|
178 |
+
"execution_count": null,
|
179 |
+
"metadata": {},
|
180 |
+
"outputs": [],
|
181 |
+
"source": []
|
182 |
+
}
|
183 |
+
],
|
184 |
+
"metadata": {
|
185 |
+
"kernelspec": {
|
186 |
+
"display_name": "geo",
|
187 |
+
"language": "python",
|
188 |
+
"name": "python3"
|
189 |
+
},
|
190 |
+
"language_info": {
|
191 |
+
"codemirror_mode": {
|
192 |
+
"name": "ipython",
|
193 |
+
"version": 3
|
194 |
+
},
|
195 |
+
"file_extension": ".py",
|
196 |
+
"mimetype": "text/x-python",
|
197 |
+
"name": "python",
|
198 |
+
"nbconvert_exporter": "python",
|
199 |
+
"pygments_lexer": "ipython3",
|
200 |
+
"version": "3.11.8"
|
201 |
+
}
|
202 |
+
},
|
203 |
+
"nbformat": 4,
|
204 |
+
"nbformat_minor": 2
|
205 |
+
}
|
notebooks/08_compare.ipynb
ADDED
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"metadata": {},
|
6 |
+
"source": [
|
7 |
+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/solara-geemap/blob/main/notebooks/08_compare.ipynb)"
|
8 |
+
]
|
9 |
+
},
|
10 |
+
{
|
11 |
+
"cell_type": "code",
|
12 |
+
"execution_count": null,
|
13 |
+
"metadata": {},
|
14 |
+
"outputs": [],
|
15 |
+
"source": [
|
16 |
+
"# %pip install -U geemap solara"
|
17 |
+
]
|
18 |
+
},
|
19 |
+
{
|
20 |
+
"cell_type": "code",
|
21 |
+
"execution_count": null,
|
22 |
+
"metadata": {},
|
23 |
+
"outputs": [],
|
24 |
+
"source": [
|
25 |
+
"import ee\n",
|
26 |
+
"import geemap\n",
|
27 |
+
"import ipywidgets as widgets\n",
|
28 |
+
"import solara\n",
|
29 |
+
"from datetime import date\n",
|
30 |
+
"\n",
|
31 |
+
"\n",
|
32 |
+
"class Map(geemap.Map):\n",
|
33 |
+
" def __init__(self, **kwargs):\n",
|
34 |
+
" super().__init__(**kwargs)\n",
|
35 |
+
" self.add_basemap(\"Esri.WorldImagery\")\n",
|
36 |
+
" self.add_gui_widget(add_header=True)\n",
|
37 |
+
"\n",
|
38 |
+
" def clean_up(self):\n",
|
39 |
+
"\n",
|
40 |
+
" layers = [\n",
|
41 |
+
" \"Pre-event Image\",\n",
|
42 |
+
" \"Post-event Image\",\n",
|
43 |
+
" \"Pre-event NDWI\",\n",
|
44 |
+
" \"Post-event NDWI\",\n",
|
45 |
+
" \"Pre-event Water\",\n",
|
46 |
+
" \"Post-event Water\",\n",
|
47 |
+
" \"Disappeared Water\",\n",
|
48 |
+
" \"New Water\",\n",
|
49 |
+
" ]\n",
|
50 |
+
" for layer_name in layers:\n",
|
51 |
+
" layer = self.find_layer(layer_name)\n",
|
52 |
+
" if layer is not None:\n",
|
53 |
+
" self.remove(layer)\n",
|
54 |
+
"\n",
|
55 |
+
" def add_gui_widget(self, position=\"topright\", **kwargs):\n",
|
56 |
+
"\n",
|
57 |
+
" widget = widgets.VBox(layout=widgets.Layout(padding=\"0px 5px 0px 5px\"))\n",
|
58 |
+
" pre_widget = widgets.HBox()\n",
|
59 |
+
" post_widget = widgets.HBox()\n",
|
60 |
+
" layout = widgets.Layout(width=\"auto\")\n",
|
61 |
+
" style = {\"description_width\": \"initial\"}\n",
|
62 |
+
" padding = \"0px 5px 0px 5px\"\n",
|
63 |
+
" pre_start_date = widgets.DatePicker(\n",
|
64 |
+
" description=\"Start\",\n",
|
65 |
+
" value=date(2014, 1, 1),\n",
|
66 |
+
" style=style,\n",
|
67 |
+
" layout=widgets.Layout(padding=padding, width=\"160px\"),\n",
|
68 |
+
" )\n",
|
69 |
+
" pre_end_date = widgets.DatePicker(\n",
|
70 |
+
" description=\"End\",\n",
|
71 |
+
" value=date(2014, 12, 31),\n",
|
72 |
+
" style=style,\n",
|
73 |
+
" layout=widgets.Layout(padding=padding, width=\"160px\"),\n",
|
74 |
+
" )\n",
|
75 |
+
" pre_cloud_cover = widgets.IntSlider(\n",
|
76 |
+
" description=\"Cloud\",\n",
|
77 |
+
" min=0,\n",
|
78 |
+
" max=100,\n",
|
79 |
+
" value=25,\n",
|
80 |
+
" step=1,\n",
|
81 |
+
" readout=False,\n",
|
82 |
+
" style=style,\n",
|
83 |
+
" layout=widgets.Layout(padding=padding, width=\"130px\"),\n",
|
84 |
+
" )\n",
|
85 |
+
" pre_cloud_label = widgets.Label(value=str(pre_cloud_cover.value))\n",
|
86 |
+
" geemap.jslink_slider_label(pre_cloud_cover, pre_cloud_label)\n",
|
87 |
+
" pre_widget.children = [\n",
|
88 |
+
" pre_start_date,\n",
|
89 |
+
" pre_end_date,\n",
|
90 |
+
" pre_cloud_cover,\n",
|
91 |
+
" pre_cloud_label,\n",
|
92 |
+
" ]\n",
|
93 |
+
" post_start_date = widgets.DatePicker(\n",
|
94 |
+
" description=\"Start\",\n",
|
95 |
+
" value=date(2024, 1, 1),\n",
|
96 |
+
" style=style,\n",
|
97 |
+
" layout=widgets.Layout(padding=padding, width=\"160px\"),\n",
|
98 |
+
" )\n",
|
99 |
+
" post_end_date = widgets.DatePicker(\n",
|
100 |
+
" description=\"End\",\n",
|
101 |
+
" value=date(2024, 12, 31),\n",
|
102 |
+
" style=style,\n",
|
103 |
+
" layout=widgets.Layout(padding=padding, width=\"160px\"),\n",
|
104 |
+
" )\n",
|
105 |
+
" post_cloud_cover = widgets.IntSlider(\n",
|
106 |
+
" description=\"Cloud\",\n",
|
107 |
+
" min=0,\n",
|
108 |
+
" max=100,\n",
|
109 |
+
" value=30,\n",
|
110 |
+
" step=1,\n",
|
111 |
+
" readout=False,\n",
|
112 |
+
" style=style,\n",
|
113 |
+
" layout=widgets.Layout(padding=padding, width=\"130px\"),\n",
|
114 |
+
" )\n",
|
115 |
+
" post_cloud_label = widgets.Label(value=str(post_cloud_cover.value))\n",
|
116 |
+
" geemap.jslink_slider_label(post_cloud_cover, post_cloud_label)\n",
|
117 |
+
" post_widget.children = [\n",
|
118 |
+
" post_start_date,\n",
|
119 |
+
" post_end_date,\n",
|
120 |
+
" post_cloud_cover,\n",
|
121 |
+
" post_cloud_label,\n",
|
122 |
+
" ]\n",
|
123 |
+
"\n",
|
124 |
+
" apply_btn = widgets.Button(description=\"Apply\", layout=layout)\n",
|
125 |
+
" reset_btn = widgets.Button(description=\"Reset\", layout=layout)\n",
|
126 |
+
" buttons = widgets.HBox([apply_btn, reset_btn])\n",
|
127 |
+
" output = widgets.Output()\n",
|
128 |
+
"\n",
|
129 |
+
" use_split = widgets.Checkbox(\n",
|
130 |
+
" value=False,\n",
|
131 |
+
" description=\"Split map\",\n",
|
132 |
+
" style=style,\n",
|
133 |
+
" layout=widgets.Layout(padding=padding, width=\"100px\"),\n",
|
134 |
+
" )\n",
|
135 |
+
"\n",
|
136 |
+
" use_ndwi = widgets.Checkbox(\n",
|
137 |
+
" value=False,\n",
|
138 |
+
" description=\"Compute NDWI\",\n",
|
139 |
+
" style=style,\n",
|
140 |
+
" layout=widgets.Layout(padding=padding, width=\"160px\"),\n",
|
141 |
+
" )\n",
|
142 |
+
"\n",
|
143 |
+
" ndwi_threhold = widgets.FloatSlider(\n",
|
144 |
+
" description=\"Threshold\",\n",
|
145 |
+
" min=-1,\n",
|
146 |
+
" max=1,\n",
|
147 |
+
" value=0,\n",
|
148 |
+
" step=0.05,\n",
|
149 |
+
" readout=True,\n",
|
150 |
+
" style=style,\n",
|
151 |
+
" layout=widgets.Layout(padding=padding, width=\"230px\"),\n",
|
152 |
+
" )\n",
|
153 |
+
"\n",
|
154 |
+
" options = widgets.HBox(\n",
|
155 |
+
" [\n",
|
156 |
+
" use_split,\n",
|
157 |
+
" use_ndwi,\n",
|
158 |
+
" ndwi_threhold,\n",
|
159 |
+
" ]\n",
|
160 |
+
" )\n",
|
161 |
+
"\n",
|
162 |
+
" widget.children = [pre_widget, post_widget, options, buttons, output]\n",
|
163 |
+
" self.add_widget(widget, position=position, **kwargs)\n",
|
164 |
+
"\n",
|
165 |
+
" def apply_btn_click(b):\n",
|
166 |
+
"\n",
|
167 |
+
" marker_layer = self.find_layer(\"Search location\")\n",
|
168 |
+
" if marker_layer is not None:\n",
|
169 |
+
" self.remove(marker_layer)\n",
|
170 |
+
" self.clean_up()\n",
|
171 |
+
"\n",
|
172 |
+
" if self.user_roi is None:\n",
|
173 |
+
" output.clear_output()\n",
|
174 |
+
" output.append_stdout(\"Please draw a ROI first.\")\n",
|
175 |
+
" elif (\n",
|
176 |
+
" pre_start_date.value is None\n",
|
177 |
+
" or pre_end_date.value is None\n",
|
178 |
+
" or post_start_date.value is None\n",
|
179 |
+
" or post_end_date.value is None\n",
|
180 |
+
" ):\n",
|
181 |
+
" output.clear_output()\n",
|
182 |
+
" output.append_stdout(\"Please select start and end dates.\")\n",
|
183 |
+
"\n",
|
184 |
+
" elif self.user_roi is not None:\n",
|
185 |
+
" output.clear_output()\n",
|
186 |
+
" output.append_stdout(\"Computing... Please wait.\")\n",
|
187 |
+
" roi = ee.FeatureCollection(self.user_roi)\n",
|
188 |
+
" vis_params = {\"bands\": [\"B6\", \"B5\", \"B4\"], \"min\": 0, \"max\": 0.4}\n",
|
189 |
+
" if pre_start_date.value.strftime(\"%Y-%m-%d\") < \"2013-04-11\":\n",
|
190 |
+
" pre_col = geemap.landsat_timeseries(\n",
|
191 |
+
" roi,\n",
|
192 |
+
" start_year=pre_start_date.value.year,\n",
|
193 |
+
" end_year=pre_end_date.value.year,\n",
|
194 |
+
" ).select([\"SWIR1\", \"NIR\", \"Red\", \"Green\"], [\"B6\", \"B5\", \"B4\", \"B3\"])\n",
|
195 |
+
" else:\n",
|
196 |
+
" pre_col = (\n",
|
197 |
+
" ee.ImageCollection(\"NASA/HLS/HLSL30/v002\")\n",
|
198 |
+
" .filterBounds(roi)\n",
|
199 |
+
" .filterDate(\n",
|
200 |
+
" pre_start_date.value.strftime(\"%Y-%m-%d\"),\n",
|
201 |
+
" pre_end_date.value.strftime(\"%Y-%m-%d\"),\n",
|
202 |
+
" )\n",
|
203 |
+
" .filter(ee.Filter.lt(\"CLOUD_COVERAGE\", pre_cloud_cover.value))\n",
|
204 |
+
" )\n",
|
205 |
+
"\n",
|
206 |
+
" if post_start_date.value.strftime(\"%Y-%m-%d\") < \"2013-04-11\":\n",
|
207 |
+
" post_col = geemap.landsat_timeseries(\n",
|
208 |
+
" roi,\n",
|
209 |
+
" start_year=post_start_date.value.year,\n",
|
210 |
+
" end_year=post_end_date.value.year,\n",
|
211 |
+
" ).select([\"SWIR1\", \"NIR\", \"Red\", \"Green\"], [\"B6\", \"B5\", \"B4\", \"B3\"])\n",
|
212 |
+
" else:\n",
|
213 |
+
" post_col = (\n",
|
214 |
+
" ee.ImageCollection(\"NASA/HLS/HLSL30/v002\")\n",
|
215 |
+
" .filterBounds(roi)\n",
|
216 |
+
" .filterDate(\n",
|
217 |
+
" post_start_date.value.strftime(\"%Y-%m-%d\"),\n",
|
218 |
+
" post_end_date.value.strftime(\"%Y-%m-%d\"),\n",
|
219 |
+
" )\n",
|
220 |
+
" .filter(ee.Filter.lt(\"CLOUD_COVERAGE\", post_cloud_cover.value))\n",
|
221 |
+
" )\n",
|
222 |
+
"\n",
|
223 |
+
" pre_img = pre_col.median().clip(roi)\n",
|
224 |
+
" post_img = post_col.median().clip(roi)\n",
|
225 |
+
"\n",
|
226 |
+
" if use_split.value:\n",
|
227 |
+
" left_layer = geemap.ee_tile_layer(\n",
|
228 |
+
" pre_img, vis_params, \"Pre-event Image\"\n",
|
229 |
+
" )\n",
|
230 |
+
" right_layer = geemap.ee_tile_layer(\n",
|
231 |
+
" post_img, vis_params, \"Post-event Image\"\n",
|
232 |
+
" )\n",
|
233 |
+
" self.split_map(\n",
|
234 |
+
" left_layer,\n",
|
235 |
+
" right_layer,\n",
|
236 |
+
" add_close_button=True,\n",
|
237 |
+
" left_label=\"Pre-event\",\n",
|
238 |
+
" right_label=\"Post-event\",\n",
|
239 |
+
" )\n",
|
240 |
+
" else:\n",
|
241 |
+
" pre_img = pre_col.median().clip(roi)\n",
|
242 |
+
" post_img = post_col.median().clip(roi)\n",
|
243 |
+
" self.add_layer(pre_img, vis_params, \"Pre-event Image\")\n",
|
244 |
+
" self.add_layer(post_img, vis_params, \"Post-event Image\")\n",
|
245 |
+
"\n",
|
246 |
+
" if use_ndwi.value and (not use_split.value):\n",
|
247 |
+
" pre_ndwi = pre_img.normalizedDifference([\"B3\", \"B6\"]).rename(\"NDWI\")\n",
|
248 |
+
" post_ndwi = post_img.normalizedDifference([\"B3\", \"B6\"]).rename(\n",
|
249 |
+
" \"NDWI\"\n",
|
250 |
+
" )\n",
|
251 |
+
" ndwi_vis = {\"min\": -1, \"max\": 1, \"palette\": \"ndwi\"}\n",
|
252 |
+
" self.add_layer(pre_ndwi, ndwi_vis, \"Pre-event NDWI\", False)\n",
|
253 |
+
" self.add_layer(post_ndwi, ndwi_vis, \"Post-event NDWI\", False)\n",
|
254 |
+
"\n",
|
255 |
+
" pre_water = pre_ndwi.gt(ndwi_threhold.value)\n",
|
256 |
+
" post_water = post_ndwi.gt(ndwi_threhold.value)\n",
|
257 |
+
" self.add_layer(\n",
|
258 |
+
" pre_water.selfMask(), {\"palette\": \"blue\"}, \"Pre-event Water\"\n",
|
259 |
+
" )\n",
|
260 |
+
" self.add_layer(\n",
|
261 |
+
" post_water.selfMask(), {\"palette\": \"red\"}, \"Post-event Water\"\n",
|
262 |
+
" )\n",
|
263 |
+
" new_water = post_water.subtract(pre_water).gt(0)\n",
|
264 |
+
" disappear_water = pre_water.subtract(post_water).gt(0)\n",
|
265 |
+
" self.add_layer(\n",
|
266 |
+
" disappear_water.selfMask(),\n",
|
267 |
+
" {\"palette\": \"brown\"},\n",
|
268 |
+
" \"Disappeared Water\",\n",
|
269 |
+
" )\n",
|
270 |
+
" self.add_layer(\n",
|
271 |
+
" new_water.selfMask(), {\"palette\": \"cyan\"}, \"New Water\"\n",
|
272 |
+
" )\n",
|
273 |
+
"\n",
|
274 |
+
" with output:\n",
|
275 |
+
" output.clear_output()\n",
|
276 |
+
"\n",
|
277 |
+
" output.clear_output()\n",
|
278 |
+
"\n",
|
279 |
+
" apply_btn.on_click(apply_btn_click)\n",
|
280 |
+
"\n",
|
281 |
+
" def reset_btn_click(b):\n",
|
282 |
+
" self.clean_up()\n",
|
283 |
+
" self._draw_control.clear()\n",
|
284 |
+
" draw_layer = self.find_layer(\"Drawn Features\")\n",
|
285 |
+
" if draw_layer is not None:\n",
|
286 |
+
" self.remove(draw_layer)\n",
|
287 |
+
" output.clear_output()\n",
|
288 |
+
"\n",
|
289 |
+
" reset_btn.on_click(reset_btn_click)\n",
|
290 |
+
"\n",
|
291 |
+
"\n",
|
292 |
+
"@solara.component\n",
|
293 |
+
"def Page():\n",
|
294 |
+
" with solara.Column(style={\"min-width\": \"500px\"}):\n",
|
295 |
+
" Map.element(\n",
|
296 |
+
" center=[20, -0],\n",
|
297 |
+
" zoom=2,\n",
|
298 |
+
" height=\"750px\",\n",
|
299 |
+
" zoom_ctrl=False,\n",
|
300 |
+
" measure_ctrl=False,\n",
|
301 |
+
" )"
|
302 |
+
]
|
303 |
+
},
|
304 |
+
{
|
305 |
+
"cell_type": "code",
|
306 |
+
"execution_count": null,
|
307 |
+
"metadata": {},
|
308 |
+
"outputs": [],
|
309 |
+
"source": [
|
310 |
+
"Page()"
|
311 |
+
]
|
312 |
+
}
|
313 |
+
],
|
314 |
+
"metadata": {
|
315 |
+
"kernelspec": {
|
316 |
+
"display_name": "geo",
|
317 |
+
"language": "python",
|
318 |
+
"name": "python3"
|
319 |
+
},
|
320 |
+
"language_info": {
|
321 |
+
"codemirror_mode": {
|
322 |
+
"name": "ipython",
|
323 |
+
"version": 3
|
324 |
+
},
|
325 |
+
"file_extension": ".py",
|
326 |
+
"mimetype": "text/x-python",
|
327 |
+
"name": "python",
|
328 |
+
"nbconvert_exporter": "python",
|
329 |
+
"pygments_lexer": "ipython3",
|
330 |
+
"version": "3.11.8"
|
331 |
+
}
|
332 |
+
},
|
333 |
+
"nbformat": 4,
|
334 |
+
"nbformat_minor": 2
|
335 |
+
}
|
notebooks/09_teste.ipynb
ADDED
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 11,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"data": {
|
10 |
+
"text/html": [
|
11 |
+
"\n",
|
12 |
+
" <style>\n",
|
13 |
+
" .geemap-dark {\n",
|
14 |
+
" --jp-widgets-color: white;\n",
|
15 |
+
" --jp-widgets-label-color: white;\n",
|
16 |
+
" --jp-ui-font-color1: white;\n",
|
17 |
+
" --jp-layout-color2: #454545;\n",
|
18 |
+
" background-color: #383838;\n",
|
19 |
+
" }\n",
|
20 |
+
"\n",
|
21 |
+
" .geemap-dark .jupyter-button {\n",
|
22 |
+
" --jp-layout-color3: #383838;\n",
|
23 |
+
" }\n",
|
24 |
+
"\n",
|
25 |
+
" .geemap-colab {\n",
|
26 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
27 |
+
" }\n",
|
28 |
+
"\n",
|
29 |
+
" .geemap-colab .jupyter-button {\n",
|
30 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
31 |
+
" }\n",
|
32 |
+
" </style>\n",
|
33 |
+
" "
|
34 |
+
],
|
35 |
+
"text/plain": [
|
36 |
+
"<IPython.core.display.HTML object>"
|
37 |
+
]
|
38 |
+
},
|
39 |
+
"metadata": {},
|
40 |
+
"output_type": "display_data"
|
41 |
+
}
|
42 |
+
],
|
43 |
+
"source": [
|
44 |
+
"import geemap\n",
|
45 |
+
"import ee\n",
|
46 |
+
"import plotly.express as px"
|
47 |
+
]
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"cell_type": "code",
|
51 |
+
"execution_count": 3,
|
52 |
+
"metadata": {},
|
53 |
+
"outputs": [
|
54 |
+
{
|
55 |
+
"data": {
|
56 |
+
"text/html": [
|
57 |
+
"\n",
|
58 |
+
" <style>\n",
|
59 |
+
" .geemap-dark {\n",
|
60 |
+
" --jp-widgets-color: white;\n",
|
61 |
+
" --jp-widgets-label-color: white;\n",
|
62 |
+
" --jp-ui-font-color1: white;\n",
|
63 |
+
" --jp-layout-color2: #454545;\n",
|
64 |
+
" background-color: #383838;\n",
|
65 |
+
" }\n",
|
66 |
+
"\n",
|
67 |
+
" .geemap-dark .jupyter-button {\n",
|
68 |
+
" --jp-layout-color3: #383838;\n",
|
69 |
+
" }\n",
|
70 |
+
"\n",
|
71 |
+
" .geemap-colab {\n",
|
72 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
73 |
+
" }\n",
|
74 |
+
"\n",
|
75 |
+
" .geemap-colab .jupyter-button {\n",
|
76 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
77 |
+
" }\n",
|
78 |
+
" </style>\n",
|
79 |
+
" "
|
80 |
+
],
|
81 |
+
"text/plain": [
|
82 |
+
"<IPython.core.display.HTML object>"
|
83 |
+
]
|
84 |
+
},
|
85 |
+
"metadata": {},
|
86 |
+
"output_type": "display_data"
|
87 |
+
}
|
88 |
+
],
|
89 |
+
"source": [
|
90 |
+
"geemap.ee_initialize()"
|
91 |
+
]
|
92 |
+
},
|
93 |
+
{
|
94 |
+
"cell_type": "code",
|
95 |
+
"execution_count": 6,
|
96 |
+
"metadata": {},
|
97 |
+
"outputs": [
|
98 |
+
{
|
99 |
+
"data": {
|
100 |
+
"text/html": [
|
101 |
+
"\n",
|
102 |
+
" <style>\n",
|
103 |
+
" .geemap-dark {\n",
|
104 |
+
" --jp-widgets-color: white;\n",
|
105 |
+
" --jp-widgets-label-color: white;\n",
|
106 |
+
" --jp-ui-font-color1: white;\n",
|
107 |
+
" --jp-layout-color2: #454545;\n",
|
108 |
+
" background-color: #383838;\n",
|
109 |
+
" }\n",
|
110 |
+
"\n",
|
111 |
+
" .geemap-dark .jupyter-button {\n",
|
112 |
+
" --jp-layout-color3: #383838;\n",
|
113 |
+
" }\n",
|
114 |
+
"\n",
|
115 |
+
" .geemap-colab {\n",
|
116 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
117 |
+
" }\n",
|
118 |
+
"\n",
|
119 |
+
" .geemap-colab .jupyter-button {\n",
|
120 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
121 |
+
" }\n",
|
122 |
+
" </style>\n",
|
123 |
+
" "
|
124 |
+
],
|
125 |
+
"text/plain": [
|
126 |
+
"<IPython.core.display.HTML object>"
|
127 |
+
]
|
128 |
+
},
|
129 |
+
"metadata": {},
|
130 |
+
"output_type": "display_data"
|
131 |
+
}
|
132 |
+
],
|
133 |
+
"source": [
|
134 |
+
"esa = ee.ImageCollection('ESA/WorldCover/v200').first()\n",
|
135 |
+
"\n",
|
136 |
+
"ucs = ee.FeatureCollection(\"projects/ee-curso-gee-rhamon/assets/ucs_estaduais_rj\")\n",
|
137 |
+
"\n",
|
138 |
+
" \n",
|
139 |
+
"esa = esa.clipToCollection(ucs)"
|
140 |
+
]
|
141 |
+
},
|
142 |
+
{
|
143 |
+
"cell_type": "code",
|
144 |
+
"execution_count": 7,
|
145 |
+
"metadata": {},
|
146 |
+
"outputs": [
|
147 |
+
{
|
148 |
+
"data": {
|
149 |
+
"text/html": [
|
150 |
+
"\n",
|
151 |
+
" <style>\n",
|
152 |
+
" .geemap-dark {\n",
|
153 |
+
" --jp-widgets-color: white;\n",
|
154 |
+
" --jp-widgets-label-color: white;\n",
|
155 |
+
" --jp-ui-font-color1: white;\n",
|
156 |
+
" --jp-layout-color2: #454545;\n",
|
157 |
+
" background-color: #383838;\n",
|
158 |
+
" }\n",
|
159 |
+
"\n",
|
160 |
+
" .geemap-dark .jupyter-button {\n",
|
161 |
+
" --jp-layout-color3: #383838;\n",
|
162 |
+
" }\n",
|
163 |
+
"\n",
|
164 |
+
" .geemap-colab {\n",
|
165 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
166 |
+
" }\n",
|
167 |
+
"\n",
|
168 |
+
" .geemap-colab .jupyter-button {\n",
|
169 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
170 |
+
" }\n",
|
171 |
+
" </style>\n",
|
172 |
+
" "
|
173 |
+
],
|
174 |
+
"text/plain": [
|
175 |
+
"<IPython.core.display.HTML object>"
|
176 |
+
]
|
177 |
+
},
|
178 |
+
"metadata": {},
|
179 |
+
"output_type": "display_data"
|
180 |
+
},
|
181 |
+
{
|
182 |
+
"name": "stdout",
|
183 |
+
"output_type": "stream",
|
184 |
+
"text": [
|
185 |
+
"Computing ... \n",
|
186 |
+
"Generating URL ...\n",
|
187 |
+
"Downloading data from https://earthengine.googleapis.com/v1/projects/346107197273/tables/60f4e2523a74ad9da945ec21ae745a37-75ffe80c0d13be48ca8789157bb6c245:getFeatures\n",
|
188 |
+
"Please wait ...\n",
|
189 |
+
"Data downloaded to c:\\Users\\Rhamon\\Desktop\\Solara\\solara-geemap\\notebooks\\esa_stats_ucs_rj.csv\n"
|
190 |
+
]
|
191 |
+
}
|
192 |
+
],
|
193 |
+
"source": [
|
194 |
+
"esa_stats = 'esa_stats_ucs_rj.csv'\n",
|
195 |
+
"\n",
|
196 |
+
"geemap.zonal_stats_by_group(\n",
|
197 |
+
" esa,\n",
|
198 |
+
" ucs,\n",
|
199 |
+
" esa_stats,\n",
|
200 |
+
" statistics_type='PERCENTAGE',\n",
|
201 |
+
" denominator=1e6,\n",
|
202 |
+
" decimal_places=2,\n",
|
203 |
+
")"
|
204 |
+
]
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"cell_type": "code",
|
208 |
+
"execution_count": 9,
|
209 |
+
"metadata": {},
|
210 |
+
"outputs": [
|
211 |
+
{
|
212 |
+
"name": "stderr",
|
213 |
+
"output_type": "stream",
|
214 |
+
"text": [
|
215 |
+
"<>:1: SyntaxWarning: invalid escape sequence '\\e'\n",
|
216 |
+
"<>:1: SyntaxWarning: invalid escape sequence '\\e'\n"
|
217 |
+
]
|
218 |
+
},
|
219 |
+
{
|
220 |
+
"data": {
|
221 |
+
"text/html": [
|
222 |
+
"\n",
|
223 |
+
" <style>\n",
|
224 |
+
" .geemap-dark {\n",
|
225 |
+
" --jp-widgets-color: white;\n",
|
226 |
+
" --jp-widgets-label-color: white;\n",
|
227 |
+
" --jp-ui-font-color1: white;\n",
|
228 |
+
" --jp-layout-color2: #454545;\n",
|
229 |
+
" background-color: #383838;\n",
|
230 |
+
" }\n",
|
231 |
+
"\n",
|
232 |
+
" .geemap-dark .jupyter-button {\n",
|
233 |
+
" --jp-layout-color3: #383838;\n",
|
234 |
+
" }\n",
|
235 |
+
"\n",
|
236 |
+
" .geemap-colab {\n",
|
237 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
238 |
+
" }\n",
|
239 |
+
"\n",
|
240 |
+
" .geemap-colab .jupyter-button {\n",
|
241 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
242 |
+
" }\n",
|
243 |
+
" </style>\n",
|
244 |
+
" "
|
245 |
+
],
|
246 |
+
"text/plain": [
|
247 |
+
"<IPython.core.display.HTML object>"
|
248 |
+
]
|
249 |
+
},
|
250 |
+
"metadata": {},
|
251 |
+
"output_type": "display_data"
|
252 |
+
},
|
253 |
+
{
|
254 |
+
"name": "stderr",
|
255 |
+
"output_type": "stream",
|
256 |
+
"text": [
|
257 |
+
"C:\\Users\\Rhamon\\AppData\\Local\\Temp\\ipykernel_21848\\2857369937.py:1: SyntaxWarning: invalid escape sequence '\\e'\n",
|
258 |
+
" df = 'CSVs\\esa_stats_ucs_rj.csv'\n"
|
259 |
+
]
|
260 |
+
}
|
261 |
+
],
|
262 |
+
"source": [
|
263 |
+
"df = 'CSVs\\esa_stats_ucs_rj.csv'"
|
264 |
+
]
|
265 |
+
},
|
266 |
+
{
|
267 |
+
"cell_type": "code",
|
268 |
+
"execution_count": 13,
|
269 |
+
"metadata": {},
|
270 |
+
"outputs": [
|
271 |
+
{
|
272 |
+
"data": {
|
273 |
+
"text/html": [
|
274 |
+
"\n",
|
275 |
+
" <style>\n",
|
276 |
+
" .geemap-dark {\n",
|
277 |
+
" --jp-widgets-color: white;\n",
|
278 |
+
" --jp-widgets-label-color: white;\n",
|
279 |
+
" --jp-ui-font-color1: white;\n",
|
280 |
+
" --jp-layout-color2: #454545;\n",
|
281 |
+
" background-color: #383838;\n",
|
282 |
+
" }\n",
|
283 |
+
"\n",
|
284 |
+
" .geemap-dark .jupyter-button {\n",
|
285 |
+
" --jp-layout-color3: #383838;\n",
|
286 |
+
" }\n",
|
287 |
+
"\n",
|
288 |
+
" .geemap-colab {\n",
|
289 |
+
" background-color: var(--colab-primary-surface-color, white);\n",
|
290 |
+
" }\n",
|
291 |
+
"\n",
|
292 |
+
" .geemap-colab .jupyter-button {\n",
|
293 |
+
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
|
294 |
+
" }\n",
|
295 |
+
" </style>\n",
|
296 |
+
" "
|
297 |
+
],
|
298 |
+
"text/plain": [
|
299 |
+
"<IPython.core.display.HTML object>"
|
300 |
+
]
|
301 |
+
},
|
302 |
+
"metadata": {},
|
303 |
+
"output_type": "display_data"
|
304 |
+
},
|
305 |
+
{
|
306 |
+
"ename": "ValueError",
|
307 |
+
"evalue": "DataFrame constructor not properly called!",
|
308 |
+
"output_type": "error",
|
309 |
+
"traceback": [
|
310 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
311 |
+
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
|
312 |
+
"\u001b[1;32m~\\AppData\\Local\\Temp\\ipykernel_21848\\385931256.py\u001b[0m in \u001b[0;36m?\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mfig\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpx\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpie\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdf\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'Class_10'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcolor\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m\"nome\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtitle\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'Cobertura Florestal UCs Estaduais RJ'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mfig\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
313 |
+
"\u001b[1;32mc:\\Users\\Rhamon\\miniconda3\\envs\\geo\\Lib\\site-packages\\plotly\\express\\_chart_types.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(data_frame, names, values, color, facet_row, facet_col, facet_col_wrap, facet_row_spacing, facet_col_spacing, color_discrete_sequence, color_discrete_map, hover_name, hover_data, custom_data, category_orders, labels, title, template, width, height, opacity, hole)\u001b[0m\n\u001b[0;32m 1478\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mcolor_discrete_sequence\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1479\u001b[0m \u001b[0mlayout_patch\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;34m\"piecolorway\"\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mcolor_discrete_sequence\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1480\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1481\u001b[0m \u001b[0mlayout_patch\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1482\u001b[1;33m return make_figure(\n\u001b[0m\u001b[0;32m 1483\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mlocals\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1484\u001b[0m \u001b[0mconstructor\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPie\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1485\u001b[0m \u001b[0mtrace_patch\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mshowlegend\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnames\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhole\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mhole\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
314 |
+
"\u001b[1;32mc:\\Users\\Rhamon\\miniconda3\\envs\\geo\\Lib\\site-packages\\plotly\\express\\_core.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(args, constructor, trace_patch, layout_patch)\u001b[0m\n\u001b[0;32m 2086\u001b[0m \u001b[0mtrace_patch\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtrace_patch\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2087\u001b[0m \u001b[0mlayout_patch\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mlayout_patch\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2088\u001b[0m \u001b[0mapply_default_cascade\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2089\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2090\u001b[1;33m \u001b[0margs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mbuild_dataframe\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mconstructor\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2091\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mconstructor\u001b[0m \u001b[1;32min\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mTreemap\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mSunburst\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mIcicle\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"path\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2092\u001b[0m \u001b[0margs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mprocess_dataframe_hierarchy\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2093\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mconstructor\u001b[0m \u001b[1;32min\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mgo\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPie\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
315 |
+
"\u001b[1;32mc:\\Users\\Rhamon\\miniconda3\\envs\\geo\\Lib\\site-packages\\plotly\\express\\_core.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(args, constructor)\u001b[0m\n\u001b[0;32m 1344\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m\"to_pandas_df\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1345\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mto_pandas_df\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1346\u001b[0m \u001b[0mcolumns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1347\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1348\u001b[1;33m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1349\u001b[0m \u001b[0mcolumns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1350\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mdf_provided\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1351\u001b[0m \u001b[0mcolumns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"data_frame\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
316 |
+
"\u001b[1;32mc:\\Users\\Rhamon\\miniconda3\\envs\\geo\\Lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36m?\u001b[1;34m(self, data, index, columns, dtype, copy)\u001b[0m\n\u001b[0;32m 882\u001b[0m \u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 883\u001b[0m \u001b[1;31m# For data is scalar\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 884\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 885\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mindex\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mcolumns\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 886\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"DataFrame constructor not properly called!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 887\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 888\u001b[0m \u001b[0mindex\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mensure_index\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 889\u001b[0m \u001b[0mcolumns\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mensure_index\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
|
317 |
+
"\u001b[1;31mValueError\u001b[0m: DataFrame constructor not properly called!"
|
318 |
+
]
|
319 |
+
}
|
320 |
+
],
|
321 |
+
"source": []
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"cell_type": "code",
|
325 |
+
"execution_count": null,
|
326 |
+
"metadata": {},
|
327 |
+
"outputs": [],
|
328 |
+
"source": []
|
329 |
+
}
|
330 |
+
],
|
331 |
+
"metadata": {
|
332 |
+
"kernelspec": {
|
333 |
+
"display_name": "geo",
|
334 |
+
"language": "python",
|
335 |
+
"name": "python3"
|
336 |
+
},
|
337 |
+
"language_info": {
|
338 |
+
"codemirror_mode": {
|
339 |
+
"name": "ipython",
|
340 |
+
"version": 3
|
341 |
+
},
|
342 |
+
"file_extension": ".py",
|
343 |
+
"mimetype": "text/x-python",
|
344 |
+
"name": "python",
|
345 |
+
"nbconvert_exporter": "python",
|
346 |
+
"pygments_lexer": "ipython3",
|
347 |
+
"version": "3.12.3"
|
348 |
+
}
|
349 |
+
},
|
350 |
+
"nbformat": 4,
|
351 |
+
"nbformat_minor": 2
|
352 |
+
}
|
notebooks/esa_stats_ucs_rj2.csv
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Class_60,Class_50,Class_40,Class_95,Class_30,Class_20,Class_10,Class_sum,Class_90,Class_80,num_mapa_1,tipo,categoria,jurisdicao,nome,area_ha,criacao,shape_leng,amortecime,shape_area,plano_mane,num_mapa,rotulo,ogc_fid,escala,system:index
|
2 |
+
0,0,0,0,23.95,0,54.07,78.02,0,0,3.0,PROTECAO INTEGRAL,MONA,ESTADUAL,MONUMENTO NATURAL DA SERRA DA MARIA COMPRIDA,7803.43358398,2023,1.62790463007,N�O,0.00684311649,N�O,40,MONA DA SERRA DA MARIA COMPRIDA,39,1:25.000,00000000000000000026
|
3 |
+
0.06,0.86,0.1,0,38.93,0,57.04,111.28,0,14.29,19.0,PROTECAO INTEGRAL,REVIS,ESTADUAL,REFUGIO DA VIDA SILVESTRE ESTADUAL DO MEDIO PARAIBA,11137.1971838,2016,6.13493591535,N�O,0.00976335248,N�O,21,REVIS MEDIO PARAIBA,2,1:25.000,00000000000000000001
|
4 |
+
0.08,0.03,0,0.45,0.98,0,94.76,99.67000000000002,0.01,3.36,24.0,PROTECAO INTEGRAL,RESEC,ESTADUAL,RESERVA ECOLOGICA ESTADUAL DA JUATINGA,9967.24995917,1992,0.71060414957,N�O,0.0087980555,N�O,4,RESEC DA JUATINGA,19,Sem Info,00000000000000000012
|
5 |
+
0.0,0,0,0,2.93,0,41.05,43.98,0,0,16.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DO MENDANHA,4399.10221912,2013,0.51140355655,N�O,0.00386942761,N�O,20,PE DO MENDANHA,28,1:25.000,0000000000000000001b
|
6 |
+
1.65,0.15,0.04,0,26.1,0,1.85,82.49000000000001,39.14,13.56,9.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA LAGOA DO ACU,8249.12246907,2012,0.83549660297,N�O,0.0072137959,N�O,19,PE DA LAGOA DO ACU,29,Sem info,0000000000000000001c
|
7 |
+
0,0,0,0,10.51,0,44.24,54.75,0,0,2.0,PROTECAO INTEGRAL,MONA,ESTADUAL,MONUMENTO NATURAL DA SERRA DA BELEZA,5476.83546917,2017,1.13386248167,N�O,0.00480016717,N�O,2,MONA SERRA DA BELEZA,36,1:25.000,00000000000000000023
|
8 |
+
0,0.0,0,0,2.61,0,4.14,6.75,0,0,4.0,PROTECAO INTEGRAL,MONA,ESTADUAL,MONUMENTO NATURAL DA SERRA DOS MASCATES,675.057144348,2017,0.18707531907,N�O,5.9145591E-4,N�O,3,MONA SERRA DOS MASCATES,37,1:25.000,00000000000000000024
|
9 |
+
0,0.03,0,0,0.73,0,47.31,48.09,0,0.02,18.0,PROTECAO INTEGRAL,REVIS,ESTADUAL,REFUGIO DA VIDA SILVESTRE ESTADUAL DA SERRA DA ESTRELA,4811.73100649,2017,1.19033062973,SIM,0.00422505577,N�O,23,REVIS SERRA DA ESTRELA,1,1:25.000,00000000000000000000
|
10 |
+
0,0.02,0,0,1.97,0,0.36,2.69,0.21,0.13,20.0,PROTECAO INTEGRAL,REVIS,ESTADUAL,REFUGIO DA VIDA SILVESTRE ESTADUAL LAGOA DA TURFEIRA,269.493133194,2016,0.15745976676,SIM,2.3640802E-4,N�O,22,REVIS LAGOA DA TURFEIRA,18,1:25.000,00000000000000000011
|
11 |
+
0.14,0.0,0,0,0.05,0,32.11,33.11,0.06,0.75,21.0,PROTECAO INTEGRAL,REBIO,ESTADUAL,RESERVA BIOLOGICA ESTADUAL DA PRAIA DO SUL,3311.84134657,2014,0.42874875901,SIM,0.00292054795,N�O,5,REBIO PRAIA DO SUL,20,1:50.000,00000000000000000013
|
12 |
+
0.85,0.18,0,18.4,1.82,0,1.88,33.61,4.37,6.11,23.0,PROTECAO INTEGRAL,REBIO,ESTADUAL,RESERVA BIOLOGICA ESTADUAL DE GUARATIBA,3361.18585618,1974,0.57256120811,SIM,0.00296089188,SIM,6,REBIO DE GUARATIBA,21,1:10.000,00000000000000000014
|
13 |
+
0,0,0,0,5.46,0.01,32.91,38.379999999999995,0,0,22.0,PROTECAO INTEGRAL,REBIO,ESTADUAL,RESERVA BIOLOGICA ESTADUAL DE ARARAS,3837.86536952,1977,0.46092656765,SIM,0.00336699397,SIM,7,REBIO DE ARARAS,22,1:50.000,00000000000000000015
|
14 |
+
0,0.01,0.01,0,21.27,0,629.29,650.5899999999999,0,0.01,17.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DOS TRES PICOS,65080.4867347,2002,9.10823446005,SIM,0.05708718834,SIM,12,PE DOS TRES PICOS,23,1:25.000 ; 1:50.000,00000000000000000016
|
15 |
+
0.08,0.09,0,0,1.55,0,30.19,34.31,0.38,2.02,13.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA SERRA DA TIRIRICA,3433.85726444,1991,1.42936381133,SIM,0.00302301907,SIM,13,PE SERRA DA TIRIRICA,24,1:10.000,00000000000000000017
|
16 |
+
0,0.02,0.01,0,8.02,0,51.45,59.52,0,0.02,12.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA SERRA DA CONCORDIA,5952.58474185,2016,1.45942906837,SIM,0.00521852499,N�O,11,PE SERRA DA CONCORDIA,25,1:25.000,00000000000000000018
|
17 |
+
0,0.0,0.02,0,2.12,0.02,78.25,80.41,0,0,11.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA PEDRA SELADA,8041.49819897,2012,1.66658109283,SIM,0.00704996872,SIM,18,PE DA PEDRA SELADA,26,1:25.000,00000000000000000019
|
18 |
+
0.0,0.1,0,0,10.83,0,113.97,124.91999999999999,0,0.02,10.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA PEDRA BRANCA,12494.2417207,1974,1.8845293254,SIM,0.01100042314,SIM,10,PE DA PEDRA BRANCA,27,Sem Info,0000000000000000001a
|
19 |
+
0,0.02,0,0,0.02,0,0.51,0.55,0,0,15.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DO GRAJAU,54.7290261485,1978,0.05699572081,SIM,4.817604E-5,SIM,14,PE DO GRAJAU,30,Sem Info,0000000000000000001d
|
20 |
+
0,0,0,0,8.76,0,204.47,213.23,0,0,14.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DO DESENGANO,21325.7388368,1970,1.75405439943,SIM,0.01863237605,SIM,16,PE DO DESENGANO,31,Sem info,0000000000000000001e
|
21 |
+
0,0,0,0,12.87,0,364.62,380.73,0,3.24,5.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL CUNHAMBEBE,38076.6666531,2008,4.36267236111,SIM,0.03351297978,SIM,8,PE CUNHAMBEBE,32,Sem info,0000000000000000001f
|
22 |
+
4.26,1.4,0.03,0,22.11,0.04,44.33,98.27000000000001,14.65,11.45,7.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA COSTA DO SOL,9828.61554842,2011,3.29315109101,SIM,0.0086502762,SIM,17,PE DA COSTA DO SOL,33,1:25.000,00000000000000000020
|
23 |
+
0,0.0,0,0,0,0,0.04,0.04,0,0,6.0,PROTECAO INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA CHACRINHA,3.71173380368,1969,0.00787836058,SIM,3.26827E-6,SIM,15,PE DA CHACRINHA,34,Sem Info,00000000000000000021
|
24 |
+
0,0.0,0.51,0,10.26,0,16.53,32.58,4.81,0.47,1.0,PROTECAO INTEGRAL,EEE,ESTADUAL,ESTACAO ECOLOGICA ESTADUAL DE GUAXINDIBA,3259.22390746,2002,0.47132646001,SIM,0.00283886233,SIM,1,EEE DE GUAXINDIBA,35,1:50.000,00000000000000000022
|
25 |
+
0.15,0.05,0,0,0.63,0,118.68,120.89,0.02,1.36,8.0,PROTE��O INTEGRAL,PARQUE,ESTADUAL,PARQUE ESTADUAL DA ILHA GRANDE,12083.7871718,1971,1.47283767448,SIM,0.01066040264,SIM,8,PE DA ILHA GRANDE,40,1:50.000 - IBGE,00000000000000000027
|
26 |
+
0.37,8.45,0.37,0,62.51,0,142.49,221.10999999999999,5.25,1.67,35.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DO ALTO IGUACU,22111.9931221,2013,0.78497409664,N�O SE APLICA,0.01942446261,SIM,36,APA DO ALTO IGUACU,3,1:25.000,00000000000000000002
|
27 |
+
0.04,2.96,2.66,1.57,49.86,0,130.79,194.67,6.49,0.3,25.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DA BACIA DO RIO MACACU,19502.1400409,2002,33.798675024,N�O SE APLICA,0.01711874796,N�O,27,APA DA BACIA DO RIO MACACU,4,Sem Info,00000000000000000003
|
28 |
+
0,0,0.13,0,11.13,0,17.46,28.720000000000002,0,0.0,26.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DA BACIA DOS FRADES,2871.72642178,1990,0.59921403936,N�O SE APLICA,0.0025174733,N�O,31,APA DOS FRADES,5,1:25.000 ; 1:50.000,00000000000000000004
|
29 |
+
0,0.32,0.02,0,25.23,0,324.44,350.01,0,0,29.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE MACAE DE CIMA,35003.0809078,2001,1.03394504309,N�O SE APLICA,0.03069270346,SIM,30,APA DE MACAE DE CIMA,6,1:50.000,00000000000000000005
|
30 |
+
0.04,0.05,0,0,14.7,0,64.94,79.75,0,0.02,28.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE GERICINO-MENDANHA,7974.14336908,2005,0.66988583505,N�O SE APLICA,0.00701359206,N�O,25,APA DE GERICINO-MENDANHA,7,Sem Info,00000000000000000006
|
31 |
+
0,0.35,0,0.99,10.44,0,241.09,253.09,0.05,0.17,30.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE MANGARATIBA,25312.3537777,1987,2.73219986964,N�O SE APLICA,0.02228427968,SIM,24,APA DE MANGARATIBA,8,1:20.000,00000000000000000007
|
32 |
+
1.37,0.36,0,0,2.99,0.01,4.11,9.690000000000001,0.47,0.38,31.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE MARICA,969.239448931,1984,0.30140385146,N�O SE APLICA,8.5341915E-4,SIM,33,APA DE MARICA,9,Sem info,00000000000000000008
|
33 |
+
0.62,8.76,0.02,0,27.58,0,23.12,91.25,18.32,12.83,32.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE MASSAMBABA,9124.45193908,2011,0.8822736963,N�O SE APLICA,0.00803179984,SIM,32,APA DE MASSAMBABA,10,1:50.000,00000000000000000009
|
34 |
+
0.69,2.28,0,0,4.17,0,18.42,103.52000000000001,1.7,76.26,36.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DO PAU-BRASIL,10353.1623171,2002,0.42686675166,N�O SE APLICA,0.00910866994,SIM,28,APA PAU BRASIL,11,1:50.000,0000000000000000000a
|
35 |
+
0.26,6.66,0.28,0,29.88,0,21.28,59.53999999999999,0.5,0.68,27.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DA SERRA DE SAPIATIBA,5955.22943195,1990,0.34376268569,N�O SE APLICA,0.00523829411,SIM,29,APA DA SERRA DE SAPIATIBA,12,1:50.000,0000000000000000000b
|
36 |
+
0.14,12.69,1.29,0,264.0,0,456.92,742.91,0.81,7.06,37.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DO RIO GUANDU,74295.2023405,2007,3.89480581005,N�O SE APLICA,0.06525411525,N�O,26,APA DO RIO GUANDU,13,1:50.000,0000000000000000000c
|
37 |
+
0,0.0,0,0,0.01,0,0.25,0.29000000000000004,0,0.03,38.0,USO SUSTENTAVEL,FLOR,ESTADUAL,FLORESTA ESTADUAL JOSE ZAGO,29.1364229911,2016,0.02136871955,N�O SE APLICA,2.549498E-5,N�O,37,FLOE JOSE ZAGO,14,1:25.000,0000000000000000000d
|
38 |
+
0.03,0.12,0,0,0.56,0,0.96,1.7200000000000002,0.05,0,33.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE SEPETIBA II,171.666213409,2004,0.05801156773,N�O SE APLICA,1.5116278E-4,N�O,34,APA DE SEPETIBA II,15,1:10.000,0000000000000000000e
|
39 |
+
0.13,0,0,0,0.02,0,1.16,18.99,0,17.68,39.0,USO SUSTENTAVEL,RDS,ESTADUAL,RESERVA DE DESENVOLVIMENTO SUSTENTAVEL DO AVENTUREIRO,1899.91188332,2014,0.21453857684,N�O SE APLICA,0.00167576192,N�O,39,RDS DO AVENTUREIRO,16,1:50.000,0000000000000000000f
|
40 |
+
0.22,0.01,0,0,0.1,0,0.1,39.42,0.04,38.95,40.0,USO SUSTENTAVEL,RESEX,ESTADUAL,RESERVA EXTRATIVISTA MARINHA DE ITAIPU,3942.53457822,2013,0.4358579572,N�O SE APLICA,0.00347203423,N�O,38,RESEX MARINHA DE ITAIPU,17,1:25.000,00000000000000000010
|
41 |
+
0.54,6.03,0,3.98,3.28,0,200.16,225.33999999999997,0.32,11.03,34.0,USO SUSTENTAVEL,APA,ESTADUAL,AREA DE PROTECAO AMBIENTAL DE TAMOIOS,22545.1793314,1986,6.34858345439,N�O SE APLICA,0.01987470585,SIM,35,APA DE TAMOIOS,38,Sem info,00000000000000000025
|
pages/00_home.py
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import solara
|
2 |
+
|
3 |
+
|
4 |
+
@solara.component
|
5 |
+
def Page():
|
6 |
+
with solara.Column(align="center"):
|
7 |
+
markdown = """
|
8 |
+
## Projetos de Carbono: Arborização, Reflorestamento e Restauração (ARR)
|
9 |
+
|
10 |
+
### Introdução
|
11 |
+
|
12 |
+
**Uma visão geral dos projetos de carbono focados em Arborização, Reflorestamento e Restauração (ARR), seu impacto global e seu papel nos esforços de sustentabilidade do Brasil.**
|
13 |
+
|
14 |
+
Os projetos de carbono do tipo ARR têm como objetivo aumentar a cobertura florestal e restaurar terras degradadas, contribuindo para a captura de carbono e o combate às mudanças climáticas. Essas iniciativas estão alinhadas a marcos globais como o Acordo de Paris e são essenciais para alcançar metas de emissões líquidas zero.
|
15 |
+
|
16 |
+
- Saiba mais: <https://www.ipcc.ch/reports/>
|
17 |
+
- Explore metodologias ARR: <https://verra.org/methodologies/>
|
18 |
+
- Confira projetos ARR no Brasil: <https://www.forestcarbonpartnership.org/>
|
19 |
+
|
20 |
+
### Impacto Global dos Projetos ARR
|
21 |
+
|
22 |
+
Os projetos ARR ganharam destaque globalmente como uma estratégia econômica para mitigação climática. Esses projetos oferecem múltiplos benefícios:
|
23 |
+
|
24 |
+
- Captura de CO₂ atmosférico por meio do sequestro de carbono em biomassa e solo.
|
25 |
+
- Apoio à biodiversidade por meio da restauração de ecossistemas nativos.
|
26 |
+
- Melhoria das condições de vida em comunidades rurais e indígenas.
|
27 |
+
|
28 |
+
De acordo com o [Global Forest Watch](https://www.globalforestwatch.org/), milhares de hectares estão envolvidos em projetos ARR, com contribuições significativas de nações em desenvolvimento em regiões tropicais.
|
29 |
+
|
30 |
+
![Mapa Global ARR](https://i.imgur.com/hyEMbuq.png)
|
31 |
+
|
32 |
+
## ARR no Brasil: Um Exemplo de Liderança
|
33 |
+
|
34 |
+
O Brasil ocupa uma posição estratégica em iniciativas ARR devido às suas vastas paisagens florestais, especialmente na Amazônia, Mata Atlântica e Cerrado. Com programas como o Fundo Amazônia e políticas estaduais, o país demonstra seu compromisso com a restauração florestal:
|
35 |
+
|
36 |
+
- **Fundo Amazônia**: Financia projetos que previnem o desmatamento e promovem o desenvolvimento sustentável. Saiba mais: <http://www.amazonfund.gov.br/>
|
37 |
+
- **Pacto pela Mata Atlântica**: Busca restaurar 15 milhões de hectares até 2050. Detalhes: <https://www.pactomataatlantica.org.br/>
|
38 |
+
|
39 |
+
#### Principais Estatísticas, em estudo do BNDES, envolvendo a possibilidade de Projetos ARR em Terras Públicas no Brasil:
|
40 |
+
#### (Fonte: [BNDES](https://agenciadenoticias.bndes.gov.br/blogdodesenvolvimento/detalhe/Potencial-de-florestas-publicas-em-projetos-de-pagamento-por-servicos-ambientais/))
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
- O estudo foi realizado em 273 UCs federais e 1.451 Glebas Arrecadadas, em todos os biomas,e utilizando dados georreferenciados disponíveis na base oficial do MMA e na base do Cadastro Nacional de Florestas Públicas.
|
45 |
+
Da área total analisada, foram identificados 2.477.992 hectares de área elegível e aplicável para o desenvolvimento de projetos de ARR. Cerca de 79(%) desse total está localizado em Glebas, seguido pelas UCs federais de uso sustentável do tipo Flona e Resex, com
|
46 |
+
7(%) e 5(%) das áreas elegíveis e aplicáveis, respectivamente.
|
47 |
+
|
48 |
+
![Quantitativo de áreas viáveis para projetos de ARR em diferentes categorias de terras públicas](https://i.imgur.com/UzVxUh9.png)
|
49 |
+
|
50 |
+
- Quanto aos biomas que possuem maior número de áreas elegíveis, a Amazônia detém 77,7(%) de todas as áreas públicas elegíveis para projetos de ARR, seguida por Cerrado
|
51 |
+
e Pantanal. Também vale destacar que os estados com maior número de áreas elegíveis são Pará (45,7%), Rondônia (14,4%) e Mato Grosso (10,7%)
|
52 |
+
|
53 |
+
![Quantitativo de áreas viáveis para projetos de ARR nas terras públicas por estados e biomas](https://i.imgur.com/qcqM73U.png)
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
# Projetos de ARR no Brasil avaliados nesta aplicação:
|
58 |
+
|
59 |
+
- 1º: Reforestation Grouped Project at Pratigi Environmental Protection Area
|
60 |
+
- 2º: Corridors for Life ARR Grouped Project
|
61 |
+
- 3º: Fazenda Nascente Do Luar Agroforestry Project
|
62 |
+
- 4º: Fazenda Sao Paulo Agroforestry
|
63 |
+
- 5º: The ARR Horizonte Carbon Project
|
64 |
+
- 6º: The Amazon Reforestation Consortium Project
|
65 |
+
- 7º: Carbon Project in the Emas-Taquari Biodiversity Corridor
|
66 |
+
- 8º: The ARR Cerrado Carbon Project
|
67 |
+
- 9º: Multi-Species Reforestation in Mato Grosso, Brazil
|
68 |
+
|
69 |
+
**Fonte**: Karnik, A., Kilbride, J., Goodbody, T., Rachel, R., & Ayrey, E. (2024). A global database of nature-based carbon offset project boundaries [Data set]. Zenodo. https://doi.org/10.5281/zenodo.11459391
|
70 |
+
|
71 |
+
|
72 |
+
### Conclusão
|
73 |
+
|
74 |
+
Os projetos ARR são indispensáveis para alcançar as metas climáticas globais. Como um dos líderes em esforços ARR, o Brasil demonstra o potencial de combinar políticas públicas, tecnologia e engajamento comunitário para enfrentar os desafios climáticos enquanto promove benefícios socioeconômicos.
|
75 |
+
|
76 |
+
![](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExYmlieWYzdjdpb3ZlaGJocnUxbDk3eGo0eWU2Mmpndm1wanY2N3o3cSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/RCtKcMeeIlIFskmH7C/giphy.webp)
|
77 |
+
|
78 |
+
"""
|
79 |
+
|
80 |
+
solara.Markdown(markdown)
|
pages/01_ARR 1º.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[0]
|
13 |
+
project_name= df['Project Na'].iloc[0]
|
14 |
+
project_start = df['Project St'].iloc[0]
|
15 |
+
project_end = df['Project En'].iloc[0]
|
16 |
+
project_ID = df['ProjectID'].iloc[0]
|
17 |
+
registry = df['Registry N'].iloc[0]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(0)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=14)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict, add_header=False)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
@solara.component
|
98 |
+
def Page():
|
99 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
100 |
+
Map.element(
|
101 |
+
height="600px",
|
102 |
+
)
|
pages/02_ARR 2º.py
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[1]
|
13 |
+
project_name= df['Project Na'].iloc[1]
|
14 |
+
project_start = df['Project St'].iloc[1]
|
15 |
+
project_end = df['Project En'].iloc[1]
|
16 |
+
project_ID = df['ProjectID'].iloc[1]
|
17 |
+
registry = df['Registry N'].iloc[1]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(1)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=11)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
@solara.component
|
96 |
+
def Page():
|
97 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
98 |
+
Map.element(
|
99 |
+
height="600px",
|
100 |
+
)
|
pages/03_ARR 3°.py
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[2]
|
13 |
+
project_name= df['Project Na'].iloc[2]
|
14 |
+
project_start = df['Project St'].iloc[2]
|
15 |
+
project_end = df['Project En'].iloc[2]
|
16 |
+
project_ID = df['ProjectID'].iloc[2]
|
17 |
+
registry = df['Registry N'].iloc[2]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(2)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=13)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
@solara.component
|
96 |
+
def Page():
|
97 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
98 |
+
Map.element(
|
99 |
+
height="600px",
|
100 |
+
)
|
pages/04_ARR 4º.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[3]
|
13 |
+
project_name= df['Project Na'].iloc[3]
|
14 |
+
project_start = df['Project St'].iloc[3]
|
15 |
+
project_end = df['Project En'].iloc[3]
|
16 |
+
project_ID = df['ProjectID'].iloc[3]
|
17 |
+
registry = df['Registry N'].iloc[3]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(3)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=13)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
@solara.component
|
98 |
+
def Page():
|
99 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
100 |
+
Map.element(
|
101 |
+
height="600px",
|
102 |
+
)
|
pages/05_ARR 5º.py
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[4]
|
13 |
+
project_name= df['Project Na'].iloc[4]
|
14 |
+
project_start = df['Project St'].iloc[4]
|
15 |
+
project_end = df['Project En'].iloc[4]
|
16 |
+
project_ID = df['ProjectID'].iloc[4]
|
17 |
+
registry = df['Registry N'].iloc[4]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(4)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=9)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
@solara.component
|
99 |
+
def Page():
|
100 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
101 |
+
Map.element(
|
102 |
+
height="600px",
|
103 |
+
)
|
pages/06_ARR 6º.py
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[5]
|
13 |
+
project_name= df['Project Na'].iloc[5]
|
14 |
+
project_start = df['Project St'].iloc[5]
|
15 |
+
project_end = df['Project En'].iloc[5]
|
16 |
+
project_ID = df['ProjectID'].iloc[5]
|
17 |
+
registry = df['Registry N'].iloc[5]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(5)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=11)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
@solara.component
|
99 |
+
def Page():
|
100 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
101 |
+
Map.element(
|
102 |
+
height="600px",
|
103 |
+
)
|
pages/07_ARR 7º.py
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[6]
|
13 |
+
project_name= df['Project Na'].iloc[6]
|
14 |
+
project_start = df['Project St'].iloc[6]
|
15 |
+
project_end = df['Project En'].iloc[6]
|
16 |
+
project_ID = df['ProjectID'].iloc[6]
|
17 |
+
registry = df['Registry N'].iloc[6]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_ee_data()
|
23 |
+
self.add_basemap("Esri.WorldImagery")
|
24 |
+
self.add_ee_data()
|
25 |
+
|
26 |
+
def add_ee_data(self):
|
27 |
+
# Add Earth Engine dataset
|
28 |
+
|
29 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
30 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
31 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(6)
|
32 |
+
|
33 |
+
ARR_project= ee.Feature(ARR_project_list)
|
34 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
35 |
+
|
36 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
37 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
38 |
+
|
39 |
+
#26- Ano de 2023
|
40 |
+
|
41 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
42 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
43 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
44 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
45 |
+
|
46 |
+
|
47 |
+
#38-Ano de 2023
|
48 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
49 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
50 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
51 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
52 |
+
|
53 |
+
legend_dict = {
|
54 |
+
'3 - Formação Florestal ': '#1f8d49',
|
55 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
56 |
+
'15 - Pastagem ': '#edde8e',
|
57 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
58 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
59 |
+
"26 - Corpo D'água": '#2532e4',
|
60 |
+
}
|
61 |
+
|
62 |
+
vis_params = {
|
63 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
64 |
+
#'min': 3,
|
65 |
+
#'max': 26,
|
66 |
+
}
|
67 |
+
|
68 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
69 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
# Add Earth Engine layers to Map
|
74 |
+
|
75 |
+
self.centerObject(ARR_project, zoom=13)
|
76 |
+
|
77 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
78 |
+
|
79 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
80 |
+
|
81 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
82 |
+
|
83 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
84 |
+
|
85 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
86 |
+
|
87 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
88 |
+
|
89 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
90 |
+
|
91 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
@solara.component
|
99 |
+
def Page():
|
100 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
101 |
+
Map.element(
|
102 |
+
height="600px",
|
103 |
+
)
|
pages/08_ARR 8º.py
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[7]
|
13 |
+
project_name= df['Project Na'].iloc[7]
|
14 |
+
project_start = df['Project St'].iloc[7]
|
15 |
+
project_end = df['Project En'].iloc[7]
|
16 |
+
project_ID = df['ProjectID'].iloc[7]
|
17 |
+
registry = df['Registry N'].iloc[7]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(7)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=10)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
@solara.component
|
98 |
+
def Page():
|
99 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
100 |
+
Map.element(
|
101 |
+
height="600px",
|
102 |
+
)
|
pages/09_ARR 9º.py
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ee
|
2 |
+
import geemap
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
import solara
|
6 |
+
import dataclasses
|
7 |
+
from typing import Callable, cast
|
8 |
+
|
9 |
+
|
10 |
+
df= pd.read_csv('CSVs\ARR_projects.csv')
|
11 |
+
|
12 |
+
developer= df['Project De'].iloc[8]
|
13 |
+
project_name= df['Project Na'].iloc[8]
|
14 |
+
project_start = df['Project St'].iloc[8]
|
15 |
+
project_end = df['Project En'].iloc[8]
|
16 |
+
project_ID = df['ProjectID'].iloc[8]
|
17 |
+
registry = df['Registry N'].iloc[8]
|
18 |
+
|
19 |
+
class Map(geemap.Map):
|
20 |
+
def __init__(self, **kwargs):
|
21 |
+
super().__init__(**kwargs)
|
22 |
+
self.add_basemap("Esri.WorldImagery")
|
23 |
+
self.add_ee_data()
|
24 |
+
|
25 |
+
def add_ee_data(self):
|
26 |
+
# Add Earth Engine dataset
|
27 |
+
|
28 |
+
carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL').filter(ee.Filter.eq('Country', 'Brazil'))
|
29 |
+
ARR_projects= carbonoffsetscol.filter(ee.Filter.eq('Project Ty', 'ARR'))
|
30 |
+
ARR_project_list= ARR_projects.toList(ARR_projects.size()).get(8)
|
31 |
+
|
32 |
+
ARR_project= ee.Feature(ARR_project_list)
|
33 |
+
ARR_project_df= geemap.ee_to_gdf(ARR_project)
|
34 |
+
|
35 |
+
fromList = [1,3,4,5,6,49,10,11,12,32,29,50,13,15,18,19,39,20,40,62,41,36,46,47,35,48,21,14,9,26,33,31,22,23,24,30,25,27]
|
36 |
+
toList = [3,3,3,3,3,3,10,10,10,10,10,10,10,15,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,26,26,26,22,22,22,22,22,22]
|
37 |
+
|
38 |
+
#26- Ano de 2023
|
39 |
+
|
40 |
+
land_use_2011=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(26)
|
41 |
+
land_use_2011= land_use_2011.clipToCollection(ARR_projects)
|
42 |
+
land_use_2011_remap= land_use_2011.remap(fromList, toList, 0)
|
43 |
+
land_use_2011_remap= land_use_2011_remap.clip(ARR_project)
|
44 |
+
|
45 |
+
|
46 |
+
#38-Ano de 2023
|
47 |
+
land_use_2023=ee.Image('projects/mapbiomas-public/assets/brazil/lulc/collection9/mapbiomas_collection90_integration_v1').select(38)
|
48 |
+
land_use_2023= land_use_2023.clipToCollection(ARR_projects)
|
49 |
+
land_use_2023_remap= land_use_2023.remap(fromList, toList, 0)
|
50 |
+
land_use_2023_remap= land_use_2023_remap.clip(ARR_project)
|
51 |
+
|
52 |
+
legend_dict = {
|
53 |
+
'3 - Formação Florestal ': '#1f8d49',
|
54 |
+
'10 - Vegetação Herbácea e Arbustiva': '#d6bc74',
|
55 |
+
'15 - Pastagem ': '#edde8e',
|
56 |
+
'18 - Agricultura/Silvicultura': '#E974ED',
|
57 |
+
'22 - Área não Vegetada': '#d4271e' ,
|
58 |
+
"26 - Corpo D'água": '#2532e4',
|
59 |
+
}
|
60 |
+
|
61 |
+
vis_params = {
|
62 |
+
'palette': ['#1f8d49','#1f8d49','#d6bc74', '#d6bc74','#edde8e', '#edde8e', '#E974ED', '#d4271e', '#2532e4'],
|
63 |
+
#'min': 3,
|
64 |
+
#'max': 26,
|
65 |
+
}
|
66 |
+
|
67 |
+
left_layer = geemap.ee_tile_layer(land_use_2011_remap, vis_params, 'Uso de Solo Mapbiomas 2011')
|
68 |
+
right_layer = geemap.ee_tile_layer(land_use_2023_remap, vis_params, 'Uso de Solo Mapbiomas 2023')
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
# Add Earth Engine layers to Map
|
73 |
+
|
74 |
+
self.centerObject(ARR_project, zoom=13)
|
75 |
+
|
76 |
+
self.add_layer(ARR_project,{},'Projeto de Carbono ARR')
|
77 |
+
|
78 |
+
self.split_map(left_layer, right_layer, left_label='MapBiomas 2011', right_label='MapBiomas 2023',add_close_button=False, layer_control=True ,left_position='topleft',right_position='topright',zoom_control=False,fullscreen_control=False,draw_control=False)
|
79 |
+
|
80 |
+
self.add_legend(title='Uso de Solo Mapbiomas', legend_dict=legend_dict)
|
81 |
+
|
82 |
+
self.add_text(text='Nome: '+ project_name, position='bottomleft', offset_x=0, offset_y=0)
|
83 |
+
|
84 |
+
self.add_text(text='Desenvolvedor do Projeto: ' + developer, position='bottomleft', offset_x=0, offset_y=0)
|
85 |
+
|
86 |
+
self.add_text(text='Data de Término: ' + project_end, position='bottomleft', offset_x=0, offset_y=0)
|
87 |
+
|
88 |
+
self.add_text(text='Data de Início: ' + project_start, position='bottomleft', offset_x=0, offset_y=0)
|
89 |
+
|
90 |
+
self.add_text(text='Registro: '+ registry + ' // ID do Projeto: ' + project_ID, position='bottomleft', offset_x=0, offset_y=0)
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
@solara.component
|
99 |
+
def Page():
|
100 |
+
with solara.Column(style={"max-width": "100%",'margin': "10vw"}):
|
101 |
+
Map.element(
|
102 |
+
height="600px",
|
103 |
+
)
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
geemap
|
2 |
+
geopandas
|
3 |
+
pydantic< 2.0
|
4 |
+
solara
|
5 |
+
plotly
|