Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for naip 2021 #41

Merged
merged 1 commit into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project attempts to match the major and minor versions of [stactools](https://github.com/stac-utils/stactools) and increments the patch number as needed.

## Unreleased

### Added

- Support for NAIP 2021

## [v0.3.2] - 2023-05-03

### Added
Expand Down
7 changes: 4 additions & 3 deletions src/stactools/naip/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import rasterio as rio
import shapely
from lxml import etree
from pystac import Item
from pystac.extensions.eo import EOExtension
from pystac.extensions.grid import GridExtension
from pystac.extensions.item_assets import ItemAssetsExtension
Expand Down Expand Up @@ -109,7 +110,7 @@ def create_item(
fgdc_metadata_href: Optional[str],
thumbnail_href=None,
additional_providers=None,
):
) -> Item:
"""Creates a STAC Item from NAIP data.

Args:
Expand Down Expand Up @@ -144,8 +145,8 @@ def create_item(
precision=6,
)

if fgdc_metadata_href is not None:
if year == "2020":
if fgdc_metadata_href:
if year in ["2020", "2021"]:
first_xpath = "gmd:fileIdentifier/gco:CharacterString"

second_xpath = "idinfo/citation/citeinfo/title"
Expand Down
Loading