Spaces:
Running
Running
Updated notebooks
Browse files- notebooks/geemap.ipynb +4 -53
- notebooks/leafmap.ipynb +27 -165
- run.sh +1 -1
notebooks/geemap.ipynb
CHANGED
@@ -1,31 +1,5 @@
|
|
1 |
{
|
2 |
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "markdown",
|
5 |
-
"id": "a8d8ad8e",
|
6 |
-
"metadata": {},
|
7 |
-
"source": [
|
8 |
-
"<a href=\"https://githubtocolab.com/gee-community/geemap/blob/master/examples/notebooks/03_inspector_tool.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>"
|
9 |
-
]
|
10 |
-
},
|
11 |
-
{
|
12 |
-
"cell_type": "markdown",
|
13 |
-
"id": "ff3af8c3",
|
14 |
-
"metadata": {},
|
15 |
-
"source": [
|
16 |
-
"Uncomment the following line to install [geemap](https://geemap.org) if needed."
|
17 |
-
]
|
18 |
-
},
|
19 |
-
{
|
20 |
-
"cell_type": "code",
|
21 |
-
"execution_count": null,
|
22 |
-
"id": "c23972e6",
|
23 |
-
"metadata": {},
|
24 |
-
"outputs": [],
|
25 |
-
"source": [
|
26 |
-
"# !pip install geemap"
|
27 |
-
]
|
28 |
-
},
|
29 |
{
|
30 |
"cell_type": "code",
|
31 |
"execution_count": null,
|
@@ -37,14 +11,6 @@
|
|
37 |
"import geemap"
|
38 |
]
|
39 |
},
|
40 |
-
{
|
41 |
-
"cell_type": "markdown",
|
42 |
-
"id": "f482e496",
|
43 |
-
"metadata": {},
|
44 |
-
"source": [
|
45 |
-
"## Create an interactive map"
|
46 |
-
]
|
47 |
-
},
|
48 |
{
|
49 |
"cell_type": "code",
|
50 |
"execution_count": null,
|
@@ -52,24 +18,7 @@
|
|
52 |
"metadata": {},
|
53 |
"outputs": [],
|
54 |
"source": [
|
55 |
-
"Map = geemap.Map(center=(40, -100), zoom=4)"
|
56 |
-
]
|
57 |
-
},
|
58 |
-
{
|
59 |
-
"cell_type": "markdown",
|
60 |
-
"id": "0c851740",
|
61 |
-
"metadata": {},
|
62 |
-
"source": [
|
63 |
-
"## Add Earth Engine Python script"
|
64 |
-
]
|
65 |
-
},
|
66 |
-
{
|
67 |
-
"cell_type": "code",
|
68 |
-
"execution_count": null,
|
69 |
-
"id": "20c791e2",
|
70 |
-
"metadata": {},
|
71 |
-
"outputs": [],
|
72 |
-
"source": [
|
73 |
"# Add Earth Engine dataset\n",
|
74 |
"dem = ee.Image('USGS/SRTMGL1_003')\n",
|
75 |
"landsat7 = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003').select(\n",
|
@@ -92,6 +41,8 @@
|
|
92 |
" 'Landsat 7',\n",
|
93 |
")\n",
|
94 |
"Map.addLayer(states, {}, \"US States\")\n",
|
|
|
|
|
95 |
"\n",
|
96 |
"Map"
|
97 |
]
|
@@ -113,7 +64,7 @@
|
|
113 |
"name": "python",
|
114 |
"nbconvert_exporter": "python",
|
115 |
"pygments_lexer": "ipython3",
|
116 |
-
"version": "3.10.
|
117 |
}
|
118 |
},
|
119 |
"nbformat": 4,
|
|
|
1 |
{
|
2 |
"cells": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
"execution_count": null,
|
|
|
11 |
"import geemap"
|
12 |
]
|
13 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
"cell_type": "code",
|
16 |
"execution_count": null,
|
|
|
18 |
"metadata": {},
|
19 |
"outputs": [],
|
20 |
"source": [
|
21 |
+
"Map = geemap.Map(center=(40, -100), zoom=4, height='800px')\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
"# Add Earth Engine dataset\n",
|
23 |
"dem = ee.Image('USGS/SRTMGL1_003')\n",
|
24 |
"landsat7 = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003').select(\n",
|
|
|
41 |
" 'Landsat 7',\n",
|
42 |
")\n",
|
43 |
"Map.addLayer(states, {}, \"US States\")\n",
|
44 |
+
"Map.add_layer_manager()\n",
|
45 |
+
"Map.add_inspector()\n",
|
46 |
"\n",
|
47 |
"Map"
|
48 |
]
|
|
|
64 |
"name": "python",
|
65 |
"nbconvert_exporter": "python",
|
66 |
"pygments_lexer": "ipython3",
|
67 |
+
"version": "3.10.9"
|
68 |
}
|
69 |
},
|
70 |
"nbformat": 4,
|
notebooks/leafmap.ipynb
CHANGED
@@ -1,34 +1,8 @@
|
|
1 |
{
|
2 |
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "markdown",
|
5 |
-
"id": "6527891f",
|
6 |
-
"metadata": {},
|
7 |
-
"source": [
|
8 |
-
"[![image](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://demo.leafmap.org/lab/index.html?path=notebooks/02_using_basemaps.ipynb)\n",
|
9 |
-
"[![image](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/opengeos/leafmap/blob/master/examples/notebooks/02_using_basemaps.ipynb)\n",
|
10 |
-
"[![image](https://img.shields.io/badge/Open-Planetary%20Computer-black?style=flat&logo=microsoft)](https://pccompute.westeurope.cloudapp.azure.com/compute/hub/user-redirect/git-pull?repo=https://github.com/opengeos/leafmap&urlpath=lab/tree/leafmap/examples/notebooks/02_using_basemaps.ipynb&branch=master)\n",
|
11 |
-
"[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/opengeos/leafmap/blob/master/examples/notebooks/02_using_basemaps.ipynb)\n",
|
12 |
-
"[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/leafmap-binder)\n",
|
13 |
-
"\n",
|
14 |
-
"**Using basemaps in leafmap**\n",
|
15 |
-
"\n",
|
16 |
-
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
|
17 |
-
]
|
18 |
-
},
|
19 |
-
{
|
20 |
-
"cell_type": "code",
|
21 |
-
"execution_count": null,
|
22 |
-
"id": "d2c546a9",
|
23 |
-
"metadata": {},
|
24 |
-
"outputs": [],
|
25 |
-
"source": [
|
26 |
-
"# !pip install leafmap"
|
27 |
-
]
|
28 |
-
},
|
29 |
{
|
30 |
"cell_type": "code",
|
31 |
-
"execution_count":
|
32 |
"id": "a058f796",
|
33 |
"metadata": {},
|
34 |
"outputs": [],
|
@@ -36,153 +10,41 @@
|
|
36 |
"import leafmap"
|
37 |
]
|
38 |
},
|
39 |
-
{
|
40 |
-
"cell_type": "markdown",
|
41 |
-
"id": "88961a9f",
|
42 |
-
"metadata": {},
|
43 |
-
"source": [
|
44 |
-
"Create an interactive map."
|
45 |
-
]
|
46 |
-
},
|
47 |
-
{
|
48 |
-
"cell_type": "code",
|
49 |
-
"execution_count": null,
|
50 |
-
"id": "b9c9302e",
|
51 |
-
"metadata": {},
|
52 |
-
"outputs": [],
|
53 |
-
"source": [
|
54 |
-
"m = leafmap.Map()\n",
|
55 |
-
"m"
|
56 |
-
]
|
57 |
-
},
|
58 |
-
{
|
59 |
-
"cell_type": "markdown",
|
60 |
-
"id": "1fbc670a",
|
61 |
-
"metadata": {},
|
62 |
-
"source": [
|
63 |
-
"Specify a Google basemap to use, can be one of [\"ROADMAP\", \"TERRAIN\", \"SATELLITE\", \"HYBRID\"]."
|
64 |
-
]
|
65 |
-
},
|
66 |
-
{
|
67 |
-
"cell_type": "code",
|
68 |
-
"execution_count": null,
|
69 |
-
"id": "3cabfa3f",
|
70 |
-
"metadata": {},
|
71 |
-
"outputs": [],
|
72 |
-
"source": [
|
73 |
-
"m = leafmap.Map(google_map=\"HYBRID\")\n",
|
74 |
-
"m"
|
75 |
-
]
|
76 |
-
},
|
77 |
-
{
|
78 |
-
"cell_type": "code",
|
79 |
-
"execution_count": null,
|
80 |
-
"id": "a5b34cbd",
|
81 |
-
"metadata": {},
|
82 |
-
"outputs": [],
|
83 |
-
"source": [
|
84 |
-
"m = leafmap.Map(google_map=\"TERRAIN\")\n",
|
85 |
-
"m"
|
86 |
-
]
|
87 |
-
},
|
88 |
-
{
|
89 |
-
"cell_type": "markdown",
|
90 |
-
"id": "5f88fc6a",
|
91 |
-
"metadata": {},
|
92 |
-
"source": [
|
93 |
-
"Add a basemap using the `add_basemap()` function."
|
94 |
-
]
|
95 |
-
},
|
96 |
-
{
|
97 |
-
"cell_type": "code",
|
98 |
-
"execution_count": null,
|
99 |
-
"id": "80eb3571",
|
100 |
-
"metadata": {},
|
101 |
-
"outputs": [],
|
102 |
-
"source": [
|
103 |
-
"m = leafmap.Map()\n",
|
104 |
-
"m.add_basemap(\"HYBRID\")\n",
|
105 |
-
"m.add_basemap(\"Esri.NatGeoWorldMap\")\n",
|
106 |
-
"m"
|
107 |
-
]
|
108 |
-
},
|
109 |
-
{
|
110 |
-
"cell_type": "markdown",
|
111 |
-
"id": "aacb1f95",
|
112 |
-
"metadata": {},
|
113 |
-
"source": [
|
114 |
-
"Add an XYZ tile layer."
|
115 |
-
]
|
116 |
-
},
|
117 |
-
{
|
118 |
-
"cell_type": "code",
|
119 |
-
"execution_count": null,
|
120 |
-
"id": "cbe08c0b",
|
121 |
-
"metadata": {},
|
122 |
-
"outputs": [],
|
123 |
-
"source": [
|
124 |
-
"m = leafmap.Map()\n",
|
125 |
-
"m.add_tile_layer(\n",
|
126 |
-
" url=\"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}\",\n",
|
127 |
-
" name=\"Google Satellite\",\n",
|
128 |
-
" attribution=\"Google\",\n",
|
129 |
-
")\n",
|
130 |
-
"m"
|
131 |
-
]
|
132 |
-
},
|
133 |
-
{
|
134 |
-
"cell_type": "markdown",
|
135 |
-
"id": "fb33bb83",
|
136 |
-
"metadata": {},
|
137 |
-
"source": [
|
138 |
-
"Add a WMS tile layer."
|
139 |
-
]
|
140 |
-
},
|
141 |
{
|
142 |
"cell_type": "code",
|
143 |
-
"execution_count":
|
144 |
-
"id": "
|
145 |
-
"metadata": {},
|
146 |
-
"outputs": [
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
"m"
|
154 |
]
|
155 |
},
|
156 |
-
{
|
157 |
-
"cell_type": "markdown",
|
158 |
-
"id": "3661053f",
|
159 |
-
"metadata": {},
|
160 |
-
"source": [
|
161 |
-
"Add a legend to the map."
|
162 |
-
]
|
163 |
-
},
|
164 |
{
|
165 |
"cell_type": "code",
|
166 |
"execution_count": null,
|
167 |
-
"id": "
|
168 |
"metadata": {},
|
169 |
"outputs": [],
|
170 |
-
"source": [
|
171 |
-
"m = leafmap.Map(google_map=\"HYBRID\")\n",
|
172 |
-
"\n",
|
173 |
-
"url1 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands/MapServer/WMSServer?\"\n",
|
174 |
-
"m.add_wms_layer(\n",
|
175 |
-
" url1, layers=\"1\", format='image/png', transparent=True, name=\"NWI Wetlands Vector\"\n",
|
176 |
-
")\n",
|
177 |
-
"\n",
|
178 |
-
"url2 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands_Raster/ImageServer/WMSServer?\"\n",
|
179 |
-
"m.add_wms_layer(\n",
|
180 |
-
" url2, layers=\"0\", format='image/png', transparent=True, name=\"NWI Wetlands Raster\"\n",
|
181 |
-
")\n",
|
182 |
-
"\n",
|
183 |
-
"m.add_legend(builtin_legend=\"NWI\")\n",
|
184 |
-
"m"
|
185 |
-
]
|
186 |
}
|
187 |
],
|
188 |
"metadata": {
|
@@ -201,7 +63,7 @@
|
|
201 |
"name": "python",
|
202 |
"nbconvert_exporter": "python",
|
203 |
"pygments_lexer": "ipython3",
|
204 |
-
"version": "3.10.
|
205 |
}
|
206 |
},
|
207 |
"nbformat": 4,
|
|
|
1 |
{
|
2 |
"cells": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"id": "a058f796",
|
7 |
"metadata": {},
|
8 |
"outputs": [],
|
|
|
10 |
"import leafmap"
|
11 |
]
|
12 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
"cell_type": "code",
|
15 |
+
"execution_count": 5,
|
16 |
+
"id": "57967f3a",
|
17 |
+
"metadata": {},
|
18 |
+
"outputs": [
|
19 |
+
{
|
20 |
+
"data": {
|
21 |
+
"application/vnd.jupyter.widget-view+json": {
|
22 |
+
"model_id": "18da37ed564c4610bd772f1179896df8",
|
23 |
+
"version_major": 2,
|
24 |
+
"version_minor": 0
|
25 |
+
},
|
26 |
+
"text/plain": [
|
27 |
+
"Map(center=[20, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text…"
|
28 |
+
]
|
29 |
+
},
|
30 |
+
"metadata": {},
|
31 |
+
"output_type": "display_data"
|
32 |
+
}
|
33 |
+
],
|
34 |
+
"source": [
|
35 |
+
"m = leafmap.Map(height='800px')\n",
|
36 |
+
"m.add_basemap('OpenTopoMap')\n",
|
37 |
+
"# m.split_map('TERRAIN', 'OpenTopoMap')\n",
|
38 |
"m"
|
39 |
]
|
40 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
{
|
42 |
"cell_type": "code",
|
43 |
"execution_count": null,
|
44 |
+
"id": "80bf53d8",
|
45 |
"metadata": {},
|
46 |
"outputs": [],
|
47 |
+
"source": []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
],
|
50 |
"metadata": {
|
|
|
63 |
"name": "python",
|
64 |
"nbconvert_exporter": "python",
|
65 |
"pygments_lexer": "ipython3",
|
66 |
+
"version": "3.10.9"
|
67 |
}
|
68 |
},
|
69 |
"nbformat": 4,
|
run.sh
CHANGED
@@ -1 +1 @@
|
|
1 |
-
voila --Voila.ip=0.0.0.0 --no-browser --strip_sources=
|
|
|
1 |
+
voila --Voila.ip=0.0.0.0 --no-browser --strip_sources=True --enable_nbextensions=True --MappingKernelManager.cull_interval=60 --MappingKernelManager.cull_idle_timeout=120 --NotebookClient.iopub_timeout=30 notebooks/
|