From 43bd96da7483f171a0b988c403fb5fa84910066b Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Tue, 28 Nov 2023 14:43:52 -0500 Subject: [PATCH] Fix notebook error --- docs/notebooks/85_gedi.ipynb | 2 +- examples/notebooks/85_gedi.ipynb | 365 ++++++++++++++++++++++++++++++- 2 files changed, 354 insertions(+), 13 deletions(-) diff --git a/docs/notebooks/85_gedi.ipynb b/docs/notebooks/85_gedi.ipynb index 13d2b880bd..545fd3d9e2 100644 --- a/docs/notebooks/85_gedi.ipynb +++ b/docs/notebooks/85_gedi.ipynb @@ -33,7 +33,7 @@ "metadata": {}, "outputs": [], "source": [ - "import leafmap" + "from leafmap import leafmap" ] }, { diff --git a/examples/notebooks/85_gedi.ipynb b/examples/notebooks/85_gedi.ipynb index 13d2b880bd..81060d466f 100644 --- a/examples/notebooks/85_gedi.ipynb +++ b/examples/notebooks/85_gedi.ipynb @@ -29,11 +29,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "import leafmap" + "from leafmap import leafmap" ] }, { @@ -45,11 +45,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "205ecf11dbee4379abaa9c6e72a74c62", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Map(center=[20, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "m = leafmap.Map()\n", + "m = leafmap.Map(height=600)\n", "m" ] }, @@ -62,7 +77,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -81,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -98,11 +113,131 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
idtitletime_starttime_endgranule_sizegranule_urlgranule_poly
84G2613736872-ORNL_CLOUDGEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202072303...2020-07-25T23:30:38.000Z2020-07-25T23:49:29.000Z222.679181https://data.ornldaac.earthdata.nasa.gov/prote...MULTIPOLYGON (((-129.75696 13.08706, -127.4353...
64G2613768727-ORNL_CLOUDGEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202020212...2020-07-20T02:41:31.000Z2020-07-20T02:58:13.000Z232.823941https://data.ornldaac.earthdata.nasa.gov/prote...MULTIPOLYGON (((-136.94246 19.63606, -134.4253...
10G2613734223-ORNL_CLOUDGEDI_L4A_AGB_Density_V2_1.GEDI04_A_20201860829...2020-07-04T08:58:43.000Z2020-07-04T09:15:16.000Z233.044988https://data.ornldaac.earthdata.nasa.gov/prote...MULTIPOLYGON (((-137.95451 19.48601, -135.4478...
94G2613728299-ORNL_CLOUDGEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202102215...2020-07-28T22:43:57.000Z2020-07-28T23:01:35.000Z236.380408https://data.ornldaac.earthdata.nasa.gov/prote...MULTIPOLYGON (((-132.51668 16.79776, -130.0985...
50G2613720747-ORNL_CLOUDGEDI_L4A_AGB_Density_V2_1.GEDI04_A_20201980347...2020-07-16T04:16:27.000Z2020-07-16T04:33:06.000Z236.764659https://data.ornldaac.earthdata.nasa.gov/prote...MULTIPOLYGON (((-137.16560 19.82265, -134.6462...
\n", + "
" + ], + "text/plain": [ + " id title \\\n", + "84 G2613736872-ORNL_CLOUD GEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202072303... \n", + "64 G2613768727-ORNL_CLOUD GEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202020212... \n", + "10 G2613734223-ORNL_CLOUD GEDI_L4A_AGB_Density_V2_1.GEDI04_A_20201860829... \n", + "94 G2613728299-ORNL_CLOUD GEDI_L4A_AGB_Density_V2_1.GEDI04_A_20202102215... \n", + "50 G2613720747-ORNL_CLOUD GEDI_L4A_AGB_Density_V2_1.GEDI04_A_20201980347... \n", + "\n", + " time_start time_end granule_size \\\n", + "84 2020-07-25T23:30:38.000Z 2020-07-25T23:49:29.000Z 222.679181 \n", + "64 2020-07-20T02:41:31.000Z 2020-07-20T02:58:13.000Z 232.823941 \n", + "10 2020-07-04T08:58:43.000Z 2020-07-04T09:15:16.000Z 233.044988 \n", + "94 2020-07-28T22:43:57.000Z 2020-07-28T23:01:35.000Z 236.380408 \n", + "50 2020-07-16T04:16:27.000Z 2020-07-16T04:33:06.000Z 236.764659 \n", + "\n", + " granule_url \\\n", + "84 https://data.ornldaac.earthdata.nasa.gov/prote... \n", + "64 https://data.ornldaac.earthdata.nasa.gov/prote... \n", + "10 https://data.ornldaac.earthdata.nasa.gov/prote... \n", + "94 https://data.ornldaac.earthdata.nasa.gov/prote... \n", + "50 https://data.ornldaac.earthdata.nasa.gov/prote... \n", + "\n", + " granule_poly \n", + "84 MULTIPOLYGON (((-129.75696 13.08706, -127.4353... \n", + "64 MULTIPOLYGON (((-136.94246 19.63606, -134.4253... \n", + "10 MULTIPOLYGON (((-137.95451 19.48601, -135.4478... \n", + "94 MULTIPOLYGON (((-132.51668 16.79776, -130.0985... \n", + "50 MULTIPOLYGON (((-137.16560 19.82265, -134.6462... " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "gdf = leafmap.gedi_search(roi, start_date, end_date, add_roi=True, sort_filesize=True)\n", + "gdf = leafmap.gedi_search(roi, start_date, end_date, add_roi=False, sort_filesize=True)\n", "gdf.head()" ] }, @@ -115,13 +250,219 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "gdf.explore()" ] }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "205ecf11dbee4379abaa9c6e72a74c62", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Map(bottom=1864.0, center=[39.095962936305476, -95.5810546875], controls=(ZoomControl(options=['position', 'zo…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "m.add_gdf(gdf, layer_name=\"GEDI footprints\")\n", + "m" + ] + }, { "cell_type": "markdown", "metadata": {},