diff --git a/docs/examples/opentopo.ipynb b/docs/examples/opentopo.ipynb new file mode 100644 index 0000000..41d05ab --- /dev/null +++ b/docs/examples/opentopo.ipynb @@ -0,0 +1,983 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# OpenTopography API \n", + "\n", + "This notebook will highlight searching for data in the NOAA Coastal LiDAR and NCALM / OpenTopo User-Submitted datasets via the [OpenTopo /otCatalog API](https://portal.opentopography.org/apidocs/)\n", + "\n", + "This is just a search for LiDAR flight extents and minimal associated metadata, similar to the [USGS 3dep Search Example](https://coincident.readthedocs.io/en/latest/examples/quickstart.html), not point cloud analysis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import coincident\n", + "import geopandas as gpd" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Identify a dataset of interest\n", + "\n", + "`opentopo` datasets in `coincident` currently support the search of the [NOAA Coastal LiDAR Catalog](https://coast.noaa.gov/htdata/lidar1_z/) and [NCALM Aerial LiDAR Catalog](https://calm.geo.berkeley.edu/ncalm/dtc.html). \n", + "\n", + "```{note}\n", + "The NCALM Aerial LiDAR Catalog also includes user-submitted flights\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# first, we'll search for NOAA Coastal LiDAR missions in Oregon\n", + "# we'll inspect 2020 arbitrarily\n", + "aoi = gpd.read_file(\n", + " \"https://raw.githubusercontent.com/unitedstates/districts/refs/heads/gh-pages/states/OR/shape.geojson\"\n", + ")\n", + "aoi.explore()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "gf_noaa = coincident.search.search(\n", + " dataset=\"noaa\",\n", + " intersects=aoi,\n", + " datetime=[\"2020\"]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "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", + "
idtitlestart_datetimeend_datetimegeometry
096932020 USACE NCMP Topobathy Lidar: Oregon2020-07-232020-08-13MULTIPOLYGON (((-124.33314 43.35468, -124.3100...
197162020 USFS Lidar: Wallowa-Whitman National Forest2020-07-112020-07-23MULTIPOLYGON (((-116.89911 44.99512, -116.8784...
293042020 OR DOT Lidar: Blue Pool, OR2020-06-182020-06-19POLYGON ((-122.08252 43.5907, -122.09351 43.69...
\n", + "
" + ], + "text/plain": [ + " id title start_datetime \\\n", + "0 9693 2020 USACE NCMP Topobathy Lidar: Oregon 2020-07-23 \n", + "1 9716 2020 USFS Lidar: Wallowa-Whitman National Forest 2020-07-11 \n", + "2 9304 2020 OR DOT Lidar: Blue Pool, OR 2020-06-18 \n", + "\n", + " end_datetime geometry \n", + "0 2020-08-13 MULTIPOLYGON (((-124.33314 43.35468, -124.3100... \n", + "1 2020-07-23 MULTIPOLYGON (((-116.89911 44.99512, -116.8784... \n", + "2 2020-06-19 POLYGON ((-122.08252 43.5907, -122.09351 43.69... " + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gf_noaa" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gf_noaa.explore(column=\"title\", cmap=\"Set1\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "# now, let's see if there were any NCALM missions from the same year\n", + "gf_ncalm = coincident.search.search(\n", + " dataset=\"ncalm\",\n", + " intersects=aoi,\n", + " datetime=[\"2020\"]\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "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", + "
idtitlestart_datetimeend_datetimegeometry
0OTLAS.082021.6339.1Post-Fire Debris Flow Detection and Erosion, O...2020-11-082020-11-08POLYGON ((-123.63575 42.81861, -123.63638 42.8...
\n", + "
" + ], + "text/plain": [ + " id title \\\n", + "0 OTLAS.082021.6339.1 Post-Fire Debris Flow Detection and Erosion, O... \n", + "\n", + " start_datetime end_datetime \\\n", + "0 2020-11-08 2020-11-08 \n", + "\n", + " geometry \n", + "0 POLYGON ((-123.63575 42.81861, -123.63638 42.8... " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gf_ncalm" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = gf_noaa.explore(color='black')\n", + "gf_ncalm.explore(m=m, color='deeppink')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "coincident", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}