Skip to content

Commit

Permalink
NAIP 2023 Dataset (#317)
Browse files Browse the repository at this point in the history
* NAIP 2023 Dataset

* Collection metadata update
  • Loading branch information
ghidalgo3 authored Jan 14, 2025
1 parent b108932 commit ef49c8f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion datasets/naip/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# NAIP

## Collection Metadata Update

Run this if you need to update the collection STAC item without ingesting asset items.

```shell
pctasks dataset ingest-collection -d datasets/naip/dataset.yaml --submit -a registry pccomponents -arg year '2023'
```

## Running

Provide the year (or a regex of years) you want to process.

```shell
$ pctasks dataset process-items --dataset datasets/naip/dataset.yaml test-2023-04-24 --arg year '(2021|2022)'
pctasks dataset process-items --dataset datasets/naip/dataset.yaml my-chunkset-id --arg year '(2021|2022)' --arg registry pccomponents.azurecr.io --submit
```

## Docker container
Expand Down
2 changes: 1 addition & 1 deletion datasets/naip/collection/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"interval": [
[
"2010-01-01T00:00:00Z",
"2022-12-31T00:00:00Z"
"2023-12-31T00:00:00Z"
]
]
}
Expand Down
9 changes: 6 additions & 3 deletions datasets/naip/test_naip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"blob://naipeuwest/naip/v002/co/2021/co_060cm_2021/37102/63/m_3710263_sw_13_060_20210729.tif", # noqa: E501
"blob://naipeuwest/naip/v002/ca/2022/ca_060cm_2022/41120/m_4112001_sw_10_060_20220716.tif", # noqa: E501
"blob://naipeuwest/naip/v002/ca/2022/ca_030cm_2022/41120/m_4112001_ne_10_030_20220723.tif", # noqa: E501
"blob://naipeuwest/naip/v002/az/2023/az_030cm_2023/31109/m_3110901_ne_12_030_20231015_20240119.tif", # noqa: E501
],
)
def test_naip(href: str) -> None:
Expand All @@ -22,13 +23,15 @@ def test_naip(href: str) -> None:
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/projection/v1.0.0/schema.json",
]
if "/63/" in href:
if "/2023/" in href:
assert item.id == "az_m_3110901_ne_12_030_20231015_20240119"
elif "/63/" in href:
# verify that the new item ID includes both area & subarea
assert item.id == "co_m_3710263_sw_13_060_20210729"
if "/ca/2022/ca_060cm" in href:
elif "/ca/2022/ca_060cm" in href:
# verify that the new item ID includes both area & subarea
assert item.id == "ca_m_4112001_sw_10_060_20220716"
if "030cm" in href:
elif "030cm" in href:
# verify that the new item ID includes both area & subarea
assert item.id == "ca_m_4112001_ne_10_030_20220723"
assert item.common_metadata.gsd == 0.3

0 comments on commit ef49c8f

Please sign in to comment.