Skip to content

Commit

Permalink
Add support for downloading NWI wetlands (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Sep 28, 2024
1 parent 84990fc commit 29167b1
Show file tree
Hide file tree
Showing 15 changed files with 916 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.config.py }}
run: uv python install ${{ matrix.config.py }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/py313.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
version: "0.4.16"
enable-cache: true
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
Expand Down
124 changes: 124 additions & 0 deletions docs/notebooks/98_watershed.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"[![image](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://demo.leafmap.org/lab/index.html?path=notebooks/98_watershed.ipynb)\n",
"[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/opengeos/leafmap/blob/master/docs/notebooks/98_watershed.ipynb)\n",
"[![image](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opengeos/leafmap/HEAD)\n",
"\n",
"**Retrieving watershed boundaries from the National Hydrography Dataset (NHD)**\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": [
"# %pip install -U leafmap"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"point_geometry = {\"x\": -114.452985, \"y\": 36.13323}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"gdf = leafmap.get_wbd(point_geometry, digit=8, return_geometry=True)\n",
"gdf.explore()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [],
"source": [
"bbox_geometry = {\"xmin\": -115.0954, \"ymin\": 36.1000, \"xmax\": -114.6658, \"ymax\": 36.1986}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"gdf = leafmap.get_wbd(bbox_geometry, digit=8, return_geometry=True)\n",
"gdf.explore()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"metadata": {},
"outputs": [],
"source": [
"huc_id = \"10160002\"\n",
"gdf = leafmap.get_wbd(searchText=huc_id, digit=8)\n",
"gdf.explore()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
"gdf = leafmap.get_wbd(searchText=huc_id, digit=10)\n",
"gdf.explore()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "geo",
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 29167b1

Please sign in to comment.