Skip to content

Commit e38c05d

Browse files
authored
Updated swimming pools example (#107)
1 parent 2a52147 commit e38c05d

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

docs/examples/swimming_pools.ipynb

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"metadata": {},
5858
"outputs": [],
5959
"source": [
60-
"m = leafmap.Map(center=[34.040984, -118.491668], zoom=19, height=\"800px\")\n",
60+
"m = leafmap.Map(center=[34.040984, -118.491668], zoom=19, height=\"600px\")\n",
6161
"m.add_basemap(\"SATELLITE\")\n",
6262
"m"
6363
]
@@ -79,7 +79,7 @@
7979
"source": [
8080
"bbox = m.user_roi_bounds()\n",
8181
"if bbox is None:\n",
82-
" bbox = [-51.2565, -22.1777, -51.2512, -22.175]"
82+
" bbox = [-118.4932, 34.0404, -118.4903, 34.0417]"
8383
]
8484
},
8585
{
@@ -200,9 +200,9 @@
200200
"outputs": [],
201201
"source": [
202202
"sam.show_anns(\n",
203-
" cmap='Greens',\n",
203+
" cmap='Blues',\n",
204204
" box_color='red',\n",
205-
" title='Automatic Segmentation of Trees',\n",
205+
" title='Automatic Segmentation of Swimming Pools',\n",
206206
" blend=True,\n",
207207
")"
208208
]
@@ -211,7 +211,7 @@
211211
"cell_type": "markdown",
212212
"metadata": {},
213213
"source": [
214-
"![](https://i.imgur.com/ytKMTlA.png)"
214+
"![](https://i.imgur.com/aXbxCFt.png)"
215215
]
216216
},
217217
{
@@ -228,18 +228,18 @@
228228
"outputs": [],
229229
"source": [
230230
"sam.show_anns(\n",
231-
" cmap='Greens',\n",
231+
" cmap='Blues',\n",
232232
" add_boxes=False,\n",
233233
" alpha=0.5,\n",
234-
" title='Automatic Segmentation of Trees',\n",
234+
" title='Automatic Segmentation of Swimming Pools',\n",
235235
")"
236236
]
237237
},
238238
{
239239
"cell_type": "markdown",
240240
"metadata": {},
241241
"source": [
242-
"![](https://i.imgur.com/3Iq2kt1.png)"
242+
"![](https://i.imgur.com/9wOkCHC.png)"
243243
]
244244
},
245245
{
@@ -259,17 +259,17 @@
259259
" cmap='Greys_r',\n",
260260
" add_boxes=False,\n",
261261
" alpha=1,\n",
262-
" title='Automatic Segmentation of Trees',\n",
262+
" title='Automatic Segmentation of Swimming Pools',\n",
263263
" blend=False,\n",
264-
" output='trees.tif',\n",
264+
" output='pools.tif',\n",
265265
")"
266266
]
267267
},
268268
{
269269
"cell_type": "markdown",
270270
"metadata": {},
271271
"source": [
272-
"![](https://i.imgur.com/KtHwFbF.png)"
272+
"![](https://i.imgur.com/lbNtUou.png)"
273273
]
274274
},
275275
{
@@ -285,7 +285,7 @@
285285
"metadata": {},
286286
"outputs": [],
287287
"source": [
288-
"sam.raster_to_vector(\"trees.tif\", \"trees.shp\")"
288+
"sam.raster_to_vector(\"pools.tif\", \"pools.shp\")"
289289
]
290290
},
291291
{
@@ -301,17 +301,24 @@
301301
"metadata": {},
302302
"outputs": [],
303303
"source": [
304-
"m.add_raster(\"trees.tif\", layer_name=\"Trees\", palette=\"Greens\", opacity=0.5, nodata=0)\n",
304+
"m.add_raster(\"pools.tif\", layer_name=\"Pools\", palette=\"Blues\", opacity=0.5, nodata=0)\n",
305305
"style = {\n",
306306
" \"color\": \"#3388ff\",\n",
307307
" \"weight\": 2,\n",
308308
" \"fillColor\": \"#7c4185\",\n",
309309
" \"fillOpacity\": 0.5,\n",
310310
"}\n",
311-
"m.add_vector(\"trees.shp\", layer_name=\"Vector\", style=style)\n",
311+
"m.add_vector(\"pools.shp\", layer_name=\"Vector\", style=style)\n",
312312
"m"
313313
]
314314
},
315+
{
316+
"cell_type": "markdown",
317+
"metadata": {},
318+
"source": [
319+
"![](https://i.imgur.com/HmFYDAf.png)"
320+
]
321+
},
315322
{
316323
"cell_type": "markdown",
317324
"metadata": {},
@@ -332,7 +339,7 @@
332339
"cell_type": "markdown",
333340
"metadata": {},
334341
"source": [
335-
"![](https://i.imgur.com/wydt5Xt.gif)"
342+
"![](https://i.imgur.com/4Q2qpMA.gif)"
336343
]
337344
}
338345
],

0 commit comments

Comments
 (0)