Spaces:
Runtime error
Runtime error
Jonathan Marokhovsky
commited on
Commit
·
98d2d22
1
Parent(s):
74a3e65
Moved the cog layer calls into optional space to make the eurocrop data easier to see.
Browse files
app.py
CHANGED
@@ -28,22 +28,23 @@ eurocrops_pmtiles = "https://s3.us-west-2.amazonaws.com/us-west-2.opendata.sourc
|
|
28 |
ec_style = pmtiles_style(eurocrops_pmtiles)
|
29 |
|
30 |
m = leafmap.Map(center=[41, -69], zoom=5)
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
47 |
m.add_pmtiles(
|
48 |
eurocrops_pmtiles, name="euro crops", style=ec_style, overlay=True, show=True, zoom_to_layer=False
|
49 |
)
|
@@ -96,6 +97,34 @@ st.divider()
|
|
96 |
eval(compile(code, "<string>", "exec"))
|
97 |
m.to_streamlit(height=700)
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
"""
|
101 |
## Credits
|
|
|
28 |
ec_style = pmtiles_style(eurocrops_pmtiles)
|
29 |
|
30 |
m = leafmap.Map(center=[41, -69], zoom=5)
|
31 |
+
# Moved the cog layers into optional scripts to make the pmtile information easier to see.
|
32 |
+
# m.add_cog_layer(
|
33 |
+
# deforest,
|
34 |
+
# palette="reds",
|
35 |
+
# name="deforested",
|
36 |
+
# transparent_bg=True,
|
37 |
+
# opacity=0.5,
|
38 |
+
# zoom_to_layer=False,
|
39 |
+
# )
|
40 |
+
# m.add_cog_layer(
|
41 |
+
# hi,
|
42 |
+
# palette="purples",
|
43 |
+
# name="human impact",
|
44 |
+
# transparent_bg=True,
|
45 |
+
# opacity=0.5,
|
46 |
+
# zoom_to_layer=False,
|
47 |
+
# )
|
48 |
m.add_pmtiles(
|
49 |
eurocrops_pmtiles, name="euro crops", style=ec_style, overlay=True, show=True, zoom_to_layer=False
|
50 |
)
|
|
|
97 |
eval(compile(code, "<string>", "exec"))
|
98 |
m.to_streamlit(height=700)
|
99 |
|
100 |
+
"## Explore Further"
|
101 |
+
st.write('''
|
102 |
+
To modify the map, add code to the `code` section in the sidebar to the left. Some examples of code to add are below.
|
103 |
+
''')
|
104 |
+
st.code('''
|
105 |
+
# Show deforested areas:
|
106 |
+
|
107 |
+
m.add_cog_layer(
|
108 |
+
deforest,
|
109 |
+
palette="reds",
|
110 |
+
name="deforested",
|
111 |
+
transparent_bg=True,
|
112 |
+
opacity=0.5,
|
113 |
+
zoom_to_layer=False,
|
114 |
+
)
|
115 |
+
|
116 |
+
# Show human impacted areas
|
117 |
+
|
118 |
+
m.add_cog_layer(
|
119 |
+
hi,
|
120 |
+
palette="purples",
|
121 |
+
name="human impact",
|
122 |
+
transparent_bg=True,
|
123 |
+
opacity=0.5,
|
124 |
+
zoom_to_layer=False,
|
125 |
+
)
|
126 |
+
''')
|
127 |
+
|
128 |
|
129 |
"""
|
130 |
## Credits
|