From 486fe4f9f6791f9455e63026c625c068b55ed027 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Mon, 21 Oct 2024 14:48:12 -0400 Subject: [PATCH] Update NWI notebook --- docs/notebooks/99_wetlands.ipynb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/notebooks/99_wetlands.ipynb b/docs/notebooks/99_wetlands.ipynb index 45b98fb47f..2fe24033a9 100644 --- a/docs/notebooks/99_wetlands.ipynb +++ b/docs/notebooks/99_wetlands.ipynb @@ -200,7 +200,11 @@ "metadata": {}, "outputs": [], "source": [ - "gdf = leafmap.get_nwi_by_huc8(huc8, quiet=False)" + "try:\n", + " gdf = leafmap.get_nwi_by_huc8(huc8, quiet=False)\n", + "except Exception as e:\n", + " print(e)\n", + " gdf = None" ] }, { @@ -212,7 +216,8 @@ "source": [ "m = leafmap.Map()\n", "m.add_basemap(\"HYBRID\")\n", - "m.add_nwi(gdf, layer_name=\"Wetlands\", zoom_to_layer=True)\n", + "if gdf is not None:\n", + " m.add_nwi(gdf, layer_name=\"Wetlands\", zoom_to_layer=True)\n", "m" ] }