Spaces:
Sleeping
Sleeping
Upload 23 files
Browse files- .gitattributes +1 -0
- pages/01_Agro-Clima.py +173 -243
- pages/02_Solos.py +63 -124
- pages/aez.tif +3 -0
- requirements.txt +7 -8
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
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
|
36 |
+
pages/aez.tif filter=lfs diff=lfs merge=lfs -text
|
pages/01_Agro-Clima.py
CHANGED
@@ -3,8 +3,10 @@ import leafmap
|
|
3 |
import solara
|
4 |
import ipywidgets as widgets
|
5 |
import ee
|
6 |
-
import
|
7 |
-
import
|
|
|
|
|
8 |
|
9 |
|
10 |
|
@@ -16,6 +18,7 @@ center = solara.reactive((20, 0))
|
|
16 |
|
17 |
|
18 |
maps = {
|
|
|
19 |
'Koeppen-Geiger (3-character) classification 2011-2040': 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/IPSL-CM5A-LR/rcp4p5/KG3_IPSL-CM5A-LR_rcp4p5_2020s.tif',
|
20 |
"Total number of growing period days": 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/GFDL-ESM2M/rcp2p6/TS/lgd_GFDL-ESM2M_rcp2p6_',
|
21 |
"Number of dry days during temperature growing period LGPt=5 (days)" : 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/IPSL-CM5A-LR/rcp8p5/TS/ndd2_IPSL-CM5A-LR_rcp8p5_',
|
@@ -41,7 +44,64 @@ maps_list= list(maps)
|
|
41 |
maps_values= list(maps.values())
|
42 |
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
legend_dict = {
|
@@ -109,47 +169,24 @@ legend_dict = {
|
|
109 |
|
110 |
|
111 |
def add_widgets(m):
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
# Get the list of state names
|
116 |
-
estados_list = estados.aggregate_array('ADM1_NAME').getInfo()
|
117 |
setattr(m, "zoom_to_layer", True)
|
118 |
style = {"description_width": "initial"}
|
119 |
padding = "0px 0px 0px 5px"
|
120 |
|
121 |
-
estado = widgets.Dropdown(
|
122 |
-
value= None,
|
123 |
-
options=estados_list,
|
124 |
-
description="Estado:",
|
125 |
-
style=style,
|
126 |
-
layout=widgets.Layout(width="270px", padding=padding),
|
127 |
-
)
|
128 |
-
|
129 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value))
|
130 |
-
municipio_list = municipio_ee.aggregate_array('ADM2_NAME').getInfo()
|
131 |
-
|
132 |
-
municipio = widgets.Dropdown(
|
133 |
-
value=None,
|
134 |
-
options=municipio_list,
|
135 |
-
description="Municipio:",
|
136 |
-
style=style,
|
137 |
-
layout=widgets.Layout(width="270px", padding=padding),
|
138 |
-
)
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
|
143 |
image = widgets.Dropdown(
|
144 |
value=None,
|
145 |
-
options=[('
|
146 |
-
|
147 |
-
('
|
148 |
-
('
|
149 |
-
('
|
150 |
-
('
|
151 |
-
('
|
152 |
-
('
|
|
|
153 |
],
|
154 |
description="Image:",
|
155 |
style=style,
|
@@ -167,54 +204,15 @@ def add_widgets(m):
|
|
167 |
output = widgets.Output()
|
168 |
|
169 |
|
170 |
-
|
171 |
-
if change.new:
|
172 |
-
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
173 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value))
|
174 |
-
municipio_list = municipio_ee.aggregate_array('ADM2_NAME').getInfo()
|
175 |
-
|
176 |
-
municipio.options = municipio_list
|
177 |
-
#image_date = get_image_date(image.value, m)
|
178 |
-
output.outputs = ()
|
179 |
-
#output.append_stdout(f"Image date: {image_date}\n")
|
180 |
-
|
181 |
-
estado.observe(change_estado, names="value")
|
182 |
-
|
183 |
-
def change_municipio(change):
|
184 |
-
if change.new:
|
185 |
-
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
186 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value)).filter(ee.Filter.eq('ADM2_NAME', municipio.value))
|
187 |
-
|
188 |
-
m.add_layer(municipio_ee, name =municipio.value )
|
189 |
-
m.centerObject(municipio_ee)
|
190 |
-
#image_date = get_image_date(image.value, m)
|
191 |
-
output.outputs = ()
|
192 |
-
#output.append_stdout(f"Image date: {image_date}\n")
|
193 |
-
|
194 |
-
municipio.observe(change_municipio, names="value")
|
195 |
|
196 |
def change_ano(change):
|
197 |
if change.new:
|
198 |
if change.new not in m.get_layer_names():
|
199 |
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
200 |
-
|
201 |
-
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=
|
202 |
|
203 |
-
|
204 |
-
if image.value == maps_values[4] or image.value == maps_values[5]:
|
205 |
-
m.remove_colorbar()
|
206 |
-
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
207 |
-
m.add_colorbar_branca(colors= colors, vmin=0, vmax=40, position='bottomright', orientation='horizontal', label='°C', caption='Graus Celsius')
|
208 |
-
elif image.value == maps_values[6]:
|
209 |
-
m.remove_colorbar()
|
210 |
-
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
211 |
-
m.add_colorbar_branca(colors= colors, vmin=0, vmax=3000, position='bottomright', orientation='horizontal', label='mm', caption='Precipitação Anual')
|
212 |
-
else:
|
213 |
-
m.remove_colorbar()
|
214 |
-
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
215 |
-
m.add_colorbar_branca(colors= colors, vmin=0, vmax=365, position='bottomright', orientation='horizontal', label='Dias', caption='Dias no Ano')
|
216 |
-
|
217 |
-
|
218 |
output.outputs = ()
|
219 |
#output.append_stdout(f"Image date: {image_date}\n")
|
220 |
|
@@ -232,110 +230,116 @@ def add_widgets(m):
|
|
232 |
|
233 |
|
234 |
m.add_basemap("HYBRID")
|
235 |
-
m.remove_legend()
|
236 |
|
237 |
if image.value == maps_values[0]:
|
|
|
|
|
|
|
|
|
238 |
|
239 |
|
240 |
-
m.remove_colorbar()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
"#008000",
|
276 |
-
"#ADD8E6",
|
277 |
-
"#4682B4",
|
278 |
-
"#5F9EA0",
|
279 |
-
"#6495ED",
|
280 |
-
"#1E90FF",
|
281 |
-
"#0000FF",
|
282 |
-
"#87CEEB",
|
283 |
-
"#4169E1",
|
284 |
-
"#191970",
|
285 |
-
"#00008B",
|
286 |
-
"#4B0082",
|
287 |
-
"#8A2BE2",
|
288 |
-
"#708090",
|
289 |
-
"#2F4F4F",
|
290 |
-
"#696969",
|
291 |
-
"#808080",
|
292 |
-
"#A9A9A9",
|
293 |
-
"#D3D3D3",
|
294 |
-
"#FFD700",
|
295 |
-
"#A0522D",
|
296 |
-
"#CD5C5C",
|
297 |
-
"#8B0000",
|
298 |
-
"#FF4500",
|
299 |
-
"#2E8B57",
|
300 |
-
"#00CED1",
|
301 |
-
"#8B4513",
|
302 |
-
"#0000FF"
|
303 |
-
]
|
304 |
|
305 |
|
|
|
|
|
|
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
'palette': colors,
|
311 |
-
|
312 |
-
}
|
313 |
|
|
|
314 |
|
315 |
-
m.addLayer(aez, vis_params, name ='Koeppen-Geiger Classification')
|
316 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value)).filter(ee.Filter.eq('ADM2_NAME', municipio.value))
|
317 |
-
|
318 |
-
m.add_layer(municipio_ee, name =municipio.value )
|
319 |
-
|
320 |
-
elif image.value == maps_values[4] or image.value == maps_values[5]:
|
321 |
-
m.remove_colorbar()
|
322 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
323 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
324 |
-
m.
|
325 |
-
elif image.value == maps_values[
|
326 |
-
|
|
|
|
|
327 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
328 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
329 |
-
m.
|
330 |
|
331 |
|
332 |
|
333 |
else:
|
|
|
334 |
|
335 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
336 |
-
|
337 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
338 |
-
m.
|
339 |
|
340 |
|
341 |
|
@@ -347,101 +351,27 @@ def add_widgets(m):
|
|
347 |
image.observe(change_image, names="value")
|
348 |
|
349 |
box = widgets.VBox(
|
350 |
-
[
|
351 |
)
|
352 |
m.add_widget(box, position="topright", add_header=False)
|
353 |
|
354 |
|
355 |
-
class Map(
|
356 |
def __init__(self, **kwargs):
|
357 |
super().__init__(**kwargs)
|
358 |
-
ee.Authenticate()
|
359 |
-
ee.Initialize(project='ee-curso-gee-rhamon')
|
360 |
-
self.add_ee_data()
|
361 |
|
362 |
|
363 |
add_widgets(self)
|
364 |
self.add_layer_manager(opened= True)
|
365 |
-
self.add_legend(legend_title="Legend", legend_dict=legend_dict, open=False)
|
366 |
#self.add_inspector()
|
367 |
|
368 |
-
|
369 |
-
def add_ee_data(self):
|
370 |
-
|
371 |
-
aez = ee.Image('users/rhamonvmlbg/agro-clima/Koeppen-Geiger_3-character_classification')
|
372 |
-
|
373 |
-
colors = [
|
374 |
-
"#FFFFFF",
|
375 |
-
"#FF99CC",
|
376 |
-
"#FF6699",
|
377 |
-
"#FF9966",
|
378 |
-
"#FF6600",
|
379 |
-
"#FFCC66",
|
380 |
-
"#FF9933",
|
381 |
-
"#FFCC99",
|
382 |
-
"#FFCC00",
|
383 |
-
"#FFFF99",
|
384 |
-
"#FFFF33",
|
385 |
-
"#FFFF66",
|
386 |
-
"#FFFF00",
|
387 |
-
"#FFCC33",
|
388 |
-
"#FF9900",
|
389 |
-
"#FFCC00",
|
390 |
-
"#FF9900",
|
391 |
-
"#FFD700",
|
392 |
-
"#FF8C00",
|
393 |
-
"#FFA07A",
|
394 |
-
"#FF4500",
|
395 |
-
"#FFA500",
|
396 |
-
"#FFDAB9",
|
397 |
-
"#FFD700",
|
398 |
-
"#FFC0CB",
|
399 |
-
"#98FB98",
|
400 |
-
"#7CFC00",
|
401 |
-
"#ADFF2F",
|
402 |
-
"#32CD32",
|
403 |
-
"#00FF00",
|
404 |
-
"#008000",
|
405 |
-
"#ADD8E6",
|
406 |
-
"#4682B4",
|
407 |
-
"#5F9EA0",
|
408 |
-
"#6495ED",
|
409 |
-
"#1E90FF",
|
410 |
-
"#0000FF",
|
411 |
-
"#87CEEB",
|
412 |
-
"#4169E1",
|
413 |
-
"#191970",
|
414 |
-
"#00008B",
|
415 |
-
"#4B0082",
|
416 |
-
"#8A2BE2",
|
417 |
-
"#708090",
|
418 |
-
"#2F4F4F",
|
419 |
-
"#696969",
|
420 |
-
"#808080",
|
421 |
-
"#A9A9A9",
|
422 |
-
"#D3D3D3",
|
423 |
-
"#FFD700",
|
424 |
-
"#A0522D",
|
425 |
-
"#CD5C5C",
|
426 |
-
"#8B0000",
|
427 |
-
"#FF4500",
|
428 |
-
"#2E8B57",
|
429 |
-
"#00CED1",
|
430 |
-
"#8B4513",
|
431 |
-
"#0000FF"
|
432 |
-
]
|
433 |
-
|
434 |
|
435 |
|
436 |
-
|
437 |
-
'min': 0,
|
438 |
-
'max': 58,
|
439 |
-
'palette': colors,
|
440 |
-
|
441 |
-
}
|
442 |
-
|
443 |
-
|
444 |
-
self.addLayer(aez, vis_params, name ='Koeppen-Geiger Classification')
|
445 |
|
446 |
|
447 |
|
|
|
3 |
import solara
|
4 |
import ipywidgets as widgets
|
5 |
import ee
|
6 |
+
from leafmap import leafmap
|
7 |
+
import leafmap.colormaps as cm
|
8 |
+
import rioxarray as rxr
|
9 |
+
from leafmap.common import get_image_colormap
|
10 |
|
11 |
|
12 |
|
|
|
18 |
|
19 |
|
20 |
maps = {
|
21 |
+
'Agro-ecological Zones: AEZ classification by climate/soil/terrain/LC': 'pages/aez.tif',
|
22 |
'Koeppen-Geiger (3-character) classification 2011-2040': 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/IPSL-CM5A-LR/rcp4p5/KG3_IPSL-CM5A-LR_rcp4p5_2020s.tif',
|
23 |
"Total number of growing period days": 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/GFDL-ESM2M/rcp2p6/TS/lgd_GFDL-ESM2M_rcp2p6_',
|
24 |
"Number of dry days during temperature growing period LGPt=5 (days)" : 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/res01/IPSL-CM5A-LR/rcp8p5/TS/ndd2_IPSL-CM5A-LR_rcp8p5_',
|
|
|
44 |
maps_values= list(maps.values())
|
45 |
|
46 |
|
47 |
+
aez_dict ={
|
48 |
+
"NAA": "#FFFFFF", # Branco
|
49 |
+
"Tropics, lowland; semi-arid, no soil/terrain limitations": "#FFD700", # Dourado
|
50 |
+
"Tropics, lowland; semi-arid, with soil/terrain limitations": "#DAA520", # Dourado escuro
|
51 |
+
"Tropics, lowland; sub-humid, no soil/terrain limitations": "#32CD32", # Verde Lima
|
52 |
+
"Tropics, lowland; sub-humid, with soil/terrain limitations": "#228B22", # Verde Floresta
|
53 |
+
"Tropics, lowland; humid, no soil/terrain limitations": "#008000", # Verde
|
54 |
+
"Tropics, lowland; humid, with soil/terrain limitations": "#006400", # Verde Escuro
|
55 |
+
"Tropics, highland; semi-arid, no soil/terrain limitations": "#FFA500", # Laranja
|
56 |
+
"Tropics, highland; semi-arid, with soil/terrain limitations": "#FF8C00", # Laranja Escuro
|
57 |
+
"Tropics, highland; sub-humid, no soil/terrain limitations": "#7FFF00", # Verde Chartreuse
|
58 |
+
"Tropics, highland; sub-humid, with soil/terrain limitations": "#ADFF2F", # Verde Amarelo
|
59 |
+
"Tropics, highland; humid, no soil/terrain limitations": "#00FF00", # Verde Limão
|
60 |
+
"Tropics, highland; humid, with soil/terrain limitations": "#00FA9A", # Verde Médio
|
61 |
+
"Sub-tropics, warm; semi-arid, no soil/terrain limitations": "#FF4500", # Laranja Vermelho
|
62 |
+
"Sub-tropics, warm; semi-arid, with soil/terrain limitations": "#FF6347", # Tomate
|
63 |
+
"Sub-tropics, warm; sub-humid, no soil/terrain limitations": "#9ACD32", # Verde Amarelo Escuro
|
64 |
+
"Sub-tropics, warm; sub-humid, with soil/terrain limitations": "#6B8E23", # Verde Oliva
|
65 |
+
"Sub-tropics, warm; humid, no soil/terrain limitations": "#3CB371", # Verde Mar Médio
|
66 |
+
"Sub-tropics, warm; humid, with soil/terrain limitations": "#2E8B57", # Verde Mar
|
67 |
+
"Sub-tropics, mud, cool; semi-arid, no soil/terrain limitations": "#8B4513", # Marrom Sela
|
68 |
+
"Sub-tropics, mud, cool; semi-arid, with soil/terrain limitations": "#A0522D", # Sienna
|
69 |
+
"Sub-tropics, mud, cool; sub-humid, no soil/terrain limitations": "#D2B48C", # Tan
|
70 |
+
"Sub-tropics, mud, cool; sub-humid, with soil/terrain limitations": "#BC8F8F", # Rosa Marrom
|
71 |
+
"Sub-tropics, mud, cool; humid, no soil/terrain limitations": "#8FBC8F", # Verde Mar Claro
|
72 |
+
"Sub-tropics, mud, cool; humid, with soil/terrain limitations": "#556B2F", # Verde Oliva Escuro
|
73 |
+
"Sub-tropics, cool; semi-arid, no soil/terrain limitations": "#CD853F", # Peru
|
74 |
+
"Sub-tropics, cool; sub-humid, no soil/terrain limitations": "#DEB887", # Burlywood
|
75 |
+
"Sub-tropics, cool; humid, with soil/terrain limitations": "#F4A460", # Sandy Brown
|
76 |
+
"Sub-tropics, cool; humid, no soil/terrain limitations": "#D2691E", # Chocolate
|
77 |
+
"Temperature, moderate; dry, no soil/terrain limitations": "#B0C4DE", # Azul Aço Claro
|
78 |
+
"Temperature, moderate; dry, with soil/terrain limitations": "#87CEEB", # Céu Azul
|
79 |
+
"Temperature, moderate; moist, no soil/terrain limitations": "#ADD8E6", # Azul Claro
|
80 |
+
"Temperature, moderate; moist, with soil/terrain limitations": "#6495ED", # Azul Cornflower
|
81 |
+
"Temperature, moderate; wet, no soil/terrain limitations": "#1E90FF", # Azul Dodger
|
82 |
+
"Temperature, moderate; wet, with soil/terrain limitations": "#0000FF", # Azul
|
83 |
+
"Temperature, cool; dry, no soil/terrain limitations": "#4682B4", # Azul Aço
|
84 |
+
"Temperature, cool; dry, with soil/terrain limitations": "#5F9EA0", # Azul Cadet
|
85 |
+
"Temperature, cool; moist, no soil/terrain limitations": "#00CED1", # Azul Turquesa Escuro
|
86 |
+
"Temperature, cool; moist, with soil/terrain limitations": "#40E0D0", # Turquesa
|
87 |
+
"Temperature, cool; wet, no soil/terrain limitations": "#00FFFF", # Ciano
|
88 |
+
"Temperature, cool; wet, with soil/terrain limitations": "#00BFFF", # Azul Céu Profundo
|
89 |
+
"Cold, no permafrost; dry, no soil/terrain limitations": "#A9A9A9", # Cinza Escuro
|
90 |
+
"Cold, no permafrost; dry, with soil/terrain limitations": "#808080", # Cinza
|
91 |
+
"Cold, no permafrost; moist, no soil/terrain limitations": "#C0C0C0", # Prata
|
92 |
+
"Cold, no permafrost; moist, with soil/terrain limitations": "#D3D3D3", # Cinza Claro
|
93 |
+
"Cold, no permafrost; wet, no soil/terrain limitations": "#E0FFFF", # Azul Claro Claro
|
94 |
+
"Cold, no permafrost; wet, with soil/terrain limitations": "#F0FFFF", # Azul Celeste
|
95 |
+
"Dominantly very steep terrain": "#8B0000", # Vermelho Escuro
|
96 |
+
"Land with severe soil/terrain limitations": "#FF0000", # Vermelho
|
97 |
+
"Ample irrigated soils": "#00FF00", # Verde Limão
|
98 |
+
"Dominantly hydromorphic soils": "#008080", # Verde Azulado
|
99 |
+
"Desert/Arid climate": "#FFDAB9", # Pêssego
|
100 |
+
"Boreal/Cold climate": "#000080", # Azul Marinho
|
101 |
+
"Arctic/Very cold climate": "#FFFFFF", # Branco
|
102 |
+
"Dominantly built-up land": "#A52A2A", # Marrom
|
103 |
+
"Dominantly water": "#0000FF" # Azul
|
104 |
+
}
|
105 |
|
106 |
|
107 |
legend_dict = {
|
|
|
169 |
|
170 |
|
171 |
def add_widgets(m):
|
172 |
+
|
173 |
+
|
|
|
|
|
|
|
174 |
setattr(m, "zoom_to_layer", True)
|
175 |
style = {"description_width": "initial"}
|
176 |
padding = "0px 0px 0px 5px"
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
|
179 |
image = widgets.Dropdown(
|
180 |
value=None,
|
181 |
+
options=[('Agro-ecological Zones classification by climate/soil/terrain/LC', maps_values[0]),
|
182 |
+
('Koeppen-Geiger (3-character) classification 2011-2040', maps_values[1]),
|
183 |
+
('Total number of growing period days', maps_values[2]),
|
184 |
+
('Number of dry days during temperature growing period LGPt=5 (days)', maps_values[3]),
|
185 |
+
('Longest period of consecutive dry days in temperature growing period LGPt=5(days)', maps_values[4]),
|
186 |
+
('Annual temperature amplitude (°C)', maps_values[5]),
|
187 |
+
('Mean annual temperature (°C)', maps_values[6]),
|
188 |
+
('Annual precipitation (mm)', maps_values[7]),
|
189 |
+
('Total number of rain days (days with P > 1 mm)', maps_values[8]),
|
190 |
],
|
191 |
description="Image:",
|
192 |
style=style,
|
|
|
204 |
output = widgets.Output()
|
205 |
|
206 |
|
207 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
def change_ano(change):
|
210 |
if change.new:
|
211 |
if change.new not in m.get_layer_names():
|
212 |
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
213 |
+
|
214 |
+
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
output.outputs = ()
|
217 |
#output.append_stdout(f"Image date: {image_date}\n")
|
218 |
|
|
|
230 |
|
231 |
|
232 |
m.add_basemap("HYBRID")
|
233 |
+
#m.remove_legend()
|
234 |
|
235 |
if image.value == maps_values[0]:
|
236 |
+
m.add_raster(maps_values[0], layer_name=maps_list[0])
|
237 |
+
m.add_legend(legend_title="Legenda", legend_dict=aez_dict, layer_name=maps_list[0], position="bottomleft")
|
238 |
+
|
239 |
+
elif image.value == maps_values[1]:
|
240 |
|
241 |
|
242 |
+
#m.remove_colorbar()
|
243 |
+
#raster = 'pages/aez.tif'
|
244 |
+
legend_dict = {
|
245 |
+
"A4 Equatorial rainforest": "#00FF00", # Verde
|
246 |
+
"Am Equatorial monsoon": "#32CD32", # Verde Lima
|
247 |
+
"As Equatorial savannah, dry summer": "#ADFF2F", # Verde Amarelo
|
248 |
+
"Aw Equatorial savannah, dry winter": "#9ACD32", # Verde Amarelo Escuro
|
249 |
+
"BWh Desert climate, hot": "#FF4500", # Laranja Vermelho
|
250 |
+
"BWk Desert climate, cold": "#FF8C00", # Laranja Escuro
|
251 |
+
"BSh Steppe climate, hot": "#FFD700", # Ouro
|
252 |
+
"BSk Steppe climate, cold": "#DAA520", # Ouro Escuro
|
253 |
+
"Cfa Temperate/mesothermal, fully humid, hot": "#87CEEB", # Céu Azul
|
254 |
+
"Cfb Temperate/mesothermal, fully humid, warm": "#ADD8E6", # Azul Claro
|
255 |
+
"Cfc Temperate/mesothermal, fully humid, cold": "#4682B4", # Azul Aço
|
256 |
+
"Csa Temperate/mesothermal, dry summer, hot": "#FFA07A", # Salmão Claro
|
257 |
+
"Csb Temperate/mesothermal, dry summer, warm": "#FA8072", # Salmão
|
258 |
+
"Csc Temperate/mesothermal, dry summer, cold": "#E9967A", # Salmão Escuro
|
259 |
+
"Cwa Temperate/mesothermal, dry winter, hot": "#FFDAB9", # Pêssego
|
260 |
+
"Cwb Temperate/mesothermal, dry winter, warm": "#FFE4B5", # Moccasin
|
261 |
+
"Cwc Temperate/mesothermal, dry winter, cold": "#FFDEAD", # Navajo Branco
|
262 |
+
"Dfa Continental/microthermal, fully humid, hot": "#8B0000", # Vermelho Escuro
|
263 |
+
"Dfb Continental/microthermal, fully humid, warm": "#B22222", # Tijolo Fogo
|
264 |
+
"Dfc Continental/microthermal, fully humid, cold": "#DC143C", # Carmesim
|
265 |
+
"Dfd Continental/microthermal, fully humid, very cold": "#FF0000", # Vermelho
|
266 |
+
"Dsa Continental/microthermal, dry summer, hot": "#800080", # Roxo
|
267 |
+
"Dsb Continental/microthermal, dry summer, warm": "#9370DB", # Roxo Médio
|
268 |
+
"Dsc Continental/microthermal, dry summer, cold": "#8A2BE2", # Azul Violeta
|
269 |
+
"Dsd Continental/microthermal, dry summer, very cold": "#4B0082", # Índigo
|
270 |
+
"Dwa Continental/microthermal, dry winter, hot": "#000080", # Azul Marinho
|
271 |
+
"Dwb Continental/microthermal, dry winter, warm": "#0000CD", # Azul Médio
|
272 |
+
"Dwc Continental/microthermal, dry winter, cold": "#1E90FF", # Azul Dodger
|
273 |
+
"Dwd Continental/microthermal, dry winter, very cold": "#00BFFF", # Azul Céu Profundo
|
274 |
+
"ET Tundra climate": "#F0E68C", # Caqui
|
275 |
+
"EF Eternal Frost climate": "#FFFFFF" # Branco
|
276 |
+
}
|
277 |
|
278 |
+
custom_cmap = {
|
279 |
+
0: "#00FF00", # A4 Equatorial rainforest
|
280 |
+
1: "#32CD32", # Am Equatorial monsoon
|
281 |
+
2: "#ADFF2F", # As Equatorial savannah, dry summer
|
282 |
+
3: "#9ACD32", # Aw Equatorial savannah, dry winter
|
283 |
+
4: "#FF4500", # BWh Desert climate, hot
|
284 |
+
5: "#FF8C00", # BWk Desert climate, cold
|
285 |
+
6: "#FFD700", # BSh Steppe climate, hot
|
286 |
+
7: "#DAA520", # BSk Steppe climate, cold
|
287 |
+
8: "#87CEEB", # Cfa Temperate/mesothermal climate, fully humid, hot
|
288 |
+
9: "#ADD8E6", # Cfb Temperate/mesothermal climate, fully humid, warm
|
289 |
+
10: "#4682B4", # Cfc Temperate/mesothermal climate, fully humid, cold
|
290 |
+
11: "#FFA07A", # Csa Temperate/mesothermal climate, dry summer, hot
|
291 |
+
12: "#FA8072", # Csb Temperate/mesothermal climate, dry summer, warm
|
292 |
+
13: "#E9967A", # Csc Temperate/mesothermal climate, dry summer, cold
|
293 |
+
14: "#FFDAB9", # Cwa Temperate/mesothermal climate, dry winter, hot
|
294 |
+
15: "#FFE4B5", # Cwb Temperate/mesothermal climate, dry winter, warm
|
295 |
+
16: "#FFDEAD", # Cwc Temperate/mesothermal climate, dry winter, cold
|
296 |
+
17: "#8B0000", # Dfa Continental/microthermal climate, fully humid, hot
|
297 |
+
18: "#B22222", # Dfb Continental/microthermal climate, fully humid, warm
|
298 |
+
19: "#DC143C", # Dfc Continental/microthermal climate, fully humid, cold
|
299 |
+
20: "#FF0000", # Dfd Continental/microthermal climate, fully humid, very cold
|
300 |
+
21: "#800080", # Dsa Continental/microthermal climate, dry summer, hot
|
301 |
+
22: "#9370DB", # Dsb Continental/microthermal climate, dry summer, warm
|
302 |
+
23: "#8A2BE2", # Dsc Continental/microthermal climate, dry summer, cold
|
303 |
+
24: "#4B0082", # Dsd Continental/microthermal climate, dry summer, very cold
|
304 |
+
25: "#000080", # Dwa Continental/microthermal climate, dry winter, hot
|
305 |
+
26: "#0000CD", # Dwb Continental/microthermal climate, dry winter, warm
|
306 |
+
27: "#1E90FF", # Dwc Continental/microthermal climate, dry winter, cold
|
307 |
+
28: "#00BFFF", # Dwd Continental/microthermal climate, dry winter, very cold
|
308 |
+
29: "#F0E68C", # ET Tundra climate
|
309 |
+
30: "#FFFFFF" # EF Eternal Frost climate
|
310 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
|
313 |
+
|
314 |
+
m.add_cog_layer(image.value, colormap=custom_cmap, name=maps_list[1])
|
315 |
+
m.add_legend(legend_title="Legenda", legend_dict=legend_dict, layer_name=maps_list[1], position="bottomleft")
|
316 |
|
317 |
+
|
318 |
+
elif image.value == maps_values[5] or image.value == maps_values[6]:
|
319 |
+
|
|
|
|
|
|
|
320 |
|
321 |
+
|
322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
324 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
325 |
+
m.add_colorbar(colors= colors, vmin=0, vmax=40, position='bottomright', orientation='horizontal', label='°C', caption='Graus Celsius')
|
326 |
+
elif image.value == maps_values[7]:
|
327 |
+
|
328 |
+
|
329 |
+
|
330 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
331 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
332 |
+
m.add_colorbar(colors= colors, vmin=0, vmax=3000, position='bottomright', orientation='horizontal', label='mm', caption='Precipitação Anual')
|
333 |
|
334 |
|
335 |
|
336 |
else:
|
337 |
+
|
338 |
|
339 |
m.add_cog_layer(image.value+ str(ano.value) + '.tif', name=str(ano.value), palette = 'inferno' )
|
340 |
+
|
341 |
colors = cm.get_palette(cmap_name='inferno', hashtag=True)
|
342 |
+
m.add_colorbar(colors= colors, vmin=0, vmax=365, position='bottomright', orientation='horizontal', label='Dias', caption='Dias no Ano')
|
343 |
|
344 |
|
345 |
|
|
|
351 |
image.observe(change_image, names="value")
|
352 |
|
353 |
box = widgets.VBox(
|
354 |
+
[ ano,image, output]
|
355 |
)
|
356 |
m.add_widget(box, position="topright", add_header=False)
|
357 |
|
358 |
|
359 |
+
class Map(leafmap.Map):
|
360 |
def __init__(self, **kwargs):
|
361 |
super().__init__(**kwargs)
|
362 |
+
#ee.Authenticate()
|
363 |
+
#ee.Initialize(project='ee-curso-gee-rhamon')
|
364 |
+
#self.add_ee_data()
|
365 |
|
366 |
|
367 |
add_widgets(self)
|
368 |
self.add_layer_manager(opened= True)
|
369 |
+
#self.add_legend(legend_title="Legend", legend_dict=legend_dict, open=False)
|
370 |
#self.add_inspector()
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
|
373 |
|
374 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
|
377 |
|
pages/02_Solos.py
CHANGED
@@ -3,15 +3,23 @@ import leafmap
|
|
3 |
import solara
|
4 |
import ipywidgets as widgets
|
5 |
import ee
|
6 |
-
import
|
7 |
-
import
|
8 |
|
9 |
zoom = solara.reactive(2)
|
10 |
center = solara.reactive((20, 0))
|
11 |
|
12 |
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
|
|
|
|
15 |
|
16 |
|
17 |
|
@@ -49,62 +57,35 @@ legend_dict1 = {
|
|
49 |
"Not evaluated": "#A9A9A9", # Cinza escuro
|
50 |
"Water": "#0000FF", # Azul
|
51 |
}
|
52 |
-
|
53 |
-
|
54 |
-
"#
|
55 |
-
"#
|
56 |
-
"#
|
57 |
-
"#
|
58 |
-
"#
|
59 |
-
"#
|
60 |
-
"#
|
61 |
-
"#
|
62 |
-
"#
|
63 |
-
"#
|
64 |
-
"#
|
65 |
-
"#
|
66 |
-
"#
|
67 |
-
|
|
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
def add_widgets(m):
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
# Get the list of state names
|
77 |
-
estados_list = estados.aggregate_array('ADM1_NAME').getInfo()
|
78 |
-
maps = {
|
79 |
-
'Most limiting soil quality rating factor': ee.Image('users/rhamonvmlbg/agro-clima/Most_limiting_soil_quality_rating_factor'),
|
80 |
-
"Nutrient retention capacity": ee.Image('users/rhamonvmlbg/agro-clima/Nutrient_retention_capacity'),
|
81 |
-
"Rooting conditions" : ee.Image('users/rhamonvmlbg/agro-clima/Rooting_conditions'),
|
82 |
-
'Soil and terrain suitability, rain-fed': ee.Image('users/rhamonvmlbg/agro-clima/Soil_and_terrain_suitability_rain-fed')
|
83 |
-
}
|
84 |
-
maps_list= list(maps)
|
85 |
-
maps_values= list(maps.values())
|
86 |
setattr(m, "zoom_to_layer", True)
|
87 |
style = {"description_width": "initial"}
|
88 |
padding = "0px 0px 0px 5px"
|
89 |
|
90 |
-
|
91 |
-
value= None,
|
92 |
-
options=estados_list,
|
93 |
-
description="Estado:",
|
94 |
-
style=style,
|
95 |
-
layout=widgets.Layout(width="270px", padding=padding),
|
96 |
-
)
|
97 |
-
|
98 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value))
|
99 |
-
municipio_list = municipio_ee.aggregate_array('ADM2_NAME').getInfo()
|
100 |
-
|
101 |
-
municipio = widgets.Dropdown(
|
102 |
-
value=None,
|
103 |
-
options=municipio_list,
|
104 |
-
description="Municipio:",
|
105 |
-
style=style,
|
106 |
-
layout=widgets.Layout(width="270px", padding=padding),
|
107 |
-
)
|
108 |
|
109 |
|
110 |
|
@@ -126,32 +107,7 @@ def add_widgets(m):
|
|
126 |
output = widgets.Output()
|
127 |
|
128 |
|
129 |
-
|
130 |
-
if change.new:
|
131 |
-
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
132 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value))
|
133 |
-
municipio_list = municipio_ee.aggregate_array('ADM2_NAME').getInfo()
|
134 |
-
|
135 |
-
municipio.options = municipio_list
|
136 |
-
#image_date = get_image_date(image.value, m)
|
137 |
-
output.outputs = ()
|
138 |
-
#output.append_stdout(f"Image date: {image_date}\n")
|
139 |
-
|
140 |
-
estado.observe(change_estado, names="value")
|
141 |
-
|
142 |
-
def change_municipio(change):
|
143 |
-
if change.new:
|
144 |
-
#mosaic = f"{url}/datasets/{dataset.value}/{image.value}.json"
|
145 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value)).filter(ee.Filter.eq('ADM2_NAME', municipio.value))
|
146 |
-
|
147 |
-
m.add_layer(municipio_ee, name =municipio.value )
|
148 |
-
m.centerObject(municipio_ee)
|
149 |
-
#image_date = get_image_date(image.value, m)
|
150 |
-
output.outputs = ()
|
151 |
-
#output.append_stdout(f"Image date: {image_date}\n")
|
152 |
-
|
153 |
-
municipio.observe(change_municipio, names="value")
|
154 |
-
|
155 |
|
156 |
|
157 |
|
@@ -163,67 +119,56 @@ def add_widgets(m):
|
|
163 |
|
164 |
for layer in layer_list:
|
165 |
m.remove_layer(m.find_layer(layer))
|
166 |
-
|
167 |
-
|
168 |
m.add_basemap("HYBRID")
|
169 |
-
m.
|
|
|
|
|
170 |
|
171 |
if image.value == maps_values[0]:
|
172 |
-
|
|
|
|
|
173 |
|
174 |
-
vis_params = {
|
175 |
-
'min': 0,
|
176 |
-
'max': 13,
|
177 |
-
'palette': hex_colors,
|
178 |
-
}
|
179 |
|
180 |
|
181 |
-
m.
|
182 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
183 |
|
184 |
|
185 |
-
municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value)).filter(ee.Filter.eq('ADM2_NAME', municipio.value))
|
186 |
|
187 |
-
m.add_layer(municipio_ee, name =municipio.value )
|
188 |
|
189 |
elif image.value == maps_values[1]:
|
190 |
-
|
191 |
-
vis_params = {
|
192 |
-
'min': 0,
|
193 |
-
'max': 13,
|
194 |
-
'palette': hex_colors,
|
195 |
-
}
|
196 |
|
|
|
197 |
|
198 |
-
m.
|
199 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
200 |
|
201 |
elif image.value == maps_values[2]:
|
202 |
|
203 |
-
vis_params = {
|
204 |
-
'min': 0,
|
205 |
-
'max': 13,
|
206 |
-
'palette': hex_colors,
|
207 |
-
}
|
208 |
|
209 |
|
210 |
-
m.
|
211 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
212 |
|
213 |
elif image.value == maps_values[3]:
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
legend_dict = {
|
228 |
"NA": "#FFFFFF", # Branco
|
229 |
"SI > 75 : Very high": "#006400", # Verde escuro
|
@@ -238,13 +183,8 @@ def add_widgets(m):
|
|
238 |
"Water": "#FF0000" # Vermelho
|
239 |
}
|
240 |
|
241 |
-
vis_params = {
|
242 |
-
'min': 0,
|
243 |
-
'max': 10,
|
244 |
-
'palette': colors,
|
245 |
-
}
|
246 |
|
247 |
-
m.
|
248 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict)
|
249 |
|
250 |
|
@@ -261,17 +201,17 @@ def add_widgets(m):
|
|
261 |
image.observe(change_image, names="value")
|
262 |
|
263 |
box = widgets.VBox(
|
264 |
-
[ image,
|
265 |
)
|
266 |
m.add_widget(box, position="topright", add_header=False)
|
267 |
|
268 |
|
269 |
-
class Map(
|
270 |
def __init__(self, **kwargs):
|
271 |
super().__init__(**kwargs)
|
272 |
#self.add_ee_data()
|
273 |
-
ee.Authenticate()
|
274 |
-
ee.Initialize(project='ee-curso-gee-rhamon')
|
275 |
add_widgets(self)
|
276 |
|
277 |
self.add_layer_manager(opened= True)
|
@@ -299,5 +239,4 @@ def Page():
|
|
299 |
height="600px",
|
300 |
toolbar_ctrl=False,
|
301 |
data_ctrl=True,
|
302 |
-
add_google_map=True,
|
303 |
)
|
|
|
3 |
import solara
|
4 |
import ipywidgets as widgets
|
5 |
import ee
|
6 |
+
from leafmap import leafmap
|
7 |
+
import leafmap.colormaps as cm
|
8 |
|
9 |
zoom = solara.reactive(2)
|
10 |
center = solara.reactive((20, 0))
|
11 |
|
12 |
|
13 |
|
14 |
+
maps = {
|
15 |
+
'Most limiting soil quality rating factor': 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/LR/soi1/SQ0_mze_v9aH.tif',
|
16 |
+
"Nutrient retention capacity": 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/LR/soi1/SQ2_mze_v9aH.tif',
|
17 |
+
"Rooting conditions" : 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/LR/soi1/SQ3_mze_v9aH.tif',
|
18 |
+
'Soil and terrain suitability, rain-fed': 'https://s3.eu-west-1.amazonaws.com/data.gaezdev.aws.fao.org/LR/soi2/siHr_sst_mze.tif'
|
19 |
+
}
|
20 |
|
21 |
+
maps_list= list(maps)
|
22 |
+
maps_values= list(maps.values())
|
23 |
|
24 |
|
25 |
|
|
|
57 |
"Not evaluated": "#A9A9A9", # Cinza escuro
|
58 |
"Water": "#0000FF", # Azul
|
59 |
}
|
60 |
+
|
61 |
+
hex_colors_dict = {
|
62 |
+
0: "#FFFFFF", # NA
|
63 |
+
1: "#8B0000", # 0.0 - 0.1
|
64 |
+
2: "#FF4500", # 0.1 - 0.2
|
65 |
+
3: "#FFA500", # 0.2 - 0.3
|
66 |
+
4: "#FFD700", # 0.3 - 0.4
|
67 |
+
5: "#FFFF00", # 0.4 - 0.5
|
68 |
+
6: "#ADFF2F", # 0.5 - 0.6
|
69 |
+
7: "#7FFF00", # 0.6 - 0.7
|
70 |
+
8: "#32CD32", # 0.7 - 0.8
|
71 |
+
9: "#008000", # 0.8 - 0.9
|
72 |
+
10: "#006400", # 0.9 - 1.0
|
73 |
+
11: "#B0C4DE", # Permafrost
|
74 |
+
12: "#A9A9A9", # Not evaluated
|
75 |
+
13: "#0000FF", # Water
|
76 |
+
}
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
def add_widgets(m):
|
82 |
+
|
83 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
setattr(m, "zoom_to_layer", True)
|
85 |
style = {"description_width": "initial"}
|
86 |
padding = "0px 0px 0px 5px"
|
87 |
|
88 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
|
91 |
|
|
|
107 |
output = widgets.Output()
|
108 |
|
109 |
|
110 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
|
113 |
|
|
|
119 |
|
120 |
for layer in layer_list:
|
121 |
m.remove_layer(m.find_layer(layer))
|
122 |
+
#municipiosBR= 'https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2023/Brasil/BR_Municipios_2023.zip'
|
123 |
+
#estadosBR = 'https://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2023/Brasil/BR_UF_2023.zip'
|
124 |
m.add_basemap("HYBRID")
|
125 |
+
#m.add_shp(estadosBR, layer_name='EstadosBR')
|
126 |
+
#m.add_shp(municipiosBR, layer_name='MunicipiosBR')
|
127 |
+
#m.remove_legend()
|
128 |
|
129 |
if image.value == maps_values[0]:
|
130 |
+
|
131 |
+
|
132 |
+
|
133 |
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
|
136 |
+
m.add_cog_layer(image.value, name= maps_list[0], colormap = hex_colors_dict, nodata =0)
|
137 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
138 |
|
139 |
|
140 |
+
#municipio_ee = ee.FeatureCollection('FAO/GAUL_SIMPLIFIED_500m/2015/level2').filter(ee.Filter.eq('ADM0_NAME', 'Brazil')).filter(ee.Filter.eq('ADM1_NAME', estado.value)).filter(ee.Filter.eq('ADM2_NAME', municipio.value))
|
141 |
|
142 |
+
#m.add_layer(municipio_ee, name =municipio.value )
|
143 |
|
144 |
elif image.value == maps_values[1]:
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
+
|
147 |
|
148 |
+
m.add_cog_layer(image.value, name= maps_list[1], colormap = hex_colors_dict, nodata =0)
|
149 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
150 |
|
151 |
elif image.value == maps_values[2]:
|
152 |
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
|
155 |
+
m.add_cog_layer(image.value, name= maps_list[2], colormap = hex_colors_dict, nodata=0)
|
156 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict1)
|
157 |
|
158 |
elif image.value == maps_values[3]:
|
159 |
+
colors_dict = {
|
160 |
+
0: "#FFFFFF10", # Branco
|
161 |
+
1: "#006400", # Verde escuro
|
162 |
+
2: "#008000", # Verde
|
163 |
+
3: "#ADFF2F", # Verde claro
|
164 |
+
4: "#FFFF00", # Amarelo
|
165 |
+
5: "#DAA520", # Dourado escuro
|
166 |
+
6: "#FF8C00", # Laranja
|
167 |
+
7: "#A9A9A9", # Cinza escuro
|
168 |
+
8: "#D3D3D3", # Cinza claro
|
169 |
+
9: "#0000FF", # Azul
|
170 |
+
10: "#FF0000" # Vermelho
|
171 |
+
}
|
172 |
legend_dict = {
|
173 |
"NA": "#FFFFFF", # Branco
|
174 |
"SI > 75 : Very high": "#006400", # Verde escuro
|
|
|
183 |
"Water": "#FF0000" # Vermelho
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
+
m.add_cog_layer(image.value, name= maps_list[3], colormap = colors_dict,nodata=0)
|
188 |
m.add_legend(legend_title="Legend", legend_dict=legend_dict)
|
189 |
|
190 |
|
|
|
201 |
image.observe(change_image, names="value")
|
202 |
|
203 |
box = widgets.VBox(
|
204 |
+
[ image, output]
|
205 |
)
|
206 |
m.add_widget(box, position="topright", add_header=False)
|
207 |
|
208 |
|
209 |
+
class Map(leafmap.Map):
|
210 |
def __init__(self, **kwargs):
|
211 |
super().__init__(**kwargs)
|
212 |
#self.add_ee_data()
|
213 |
+
#ee.Authenticate()
|
214 |
+
#ee.Initialize(project='ee-curso-gee-rhamon')
|
215 |
add_widgets(self)
|
216 |
|
217 |
self.add_layer_manager(opened= True)
|
|
|
239 |
height="600px",
|
240 |
toolbar_ctrl=False,
|
241 |
data_ctrl=True,
|
|
|
242 |
)
|
pages/aez.tif
ADDED
|
Git LFS Details
|
requirements.txt
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
-
geemap
|
2 |
-
geopandas
|
3 |
-
pydantic
|
4 |
-
solara
|
5 |
-
plotly
|
6 |
-
leafmap>=0.42.3
|
7 |
-
setuptools
|
8 |
-
gcloud
|
|
|
1 |
+
geemap
|
2 |
+
geopandas
|
3 |
+
pydantic
|
4 |
+
solara
|
5 |
+
plotly
|
6 |
+
leafmap>=0.42.3
|
7 |
+
setuptools
|
|