Skip to content

Commit

Permalink
Tutorials: sign NAIP download (#2343)
Browse files Browse the repository at this point in the history
* Getting Started: fix NAIP download

* Import planetary_computer

* Help torchvision figure out filename
  • Loading branch information
adamjstewart authored Oct 10, 2024
1 parent c5c7fcc commit e0dcd33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/tutorials/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install torchgeo"
"%pip install torchgeo planetary_computer"
]
},
{
Expand All @@ -70,6 +70,7 @@
"import os\n",
"import tempfile\n",
"\n",
"import planetary_computer\n",
"from torch.utils.data import DataLoader\n",
"\n",
"from torchgeo.datasets import NAIP, ChesapeakeDE, stack_samples\n",
Expand Down Expand Up @@ -160,7 +161,8 @@
" 'm_3807512_sw_18_060_20180815.tif',\n",
"]\n",
"for tile in tiles:\n",
" download_url(naip_url + tile, naip_root)\n",
" url = planetary_computer.sign(naip_url + tile)\n",
" download_url(url, naip_root, filename=tile)\n",
"\n",
"naip = NAIP(naip_root)"
]
Expand Down

0 comments on commit e0dcd33

Please sign in to comment.