Skip to content

Commit

Permalink
Merge pull request #41 from stactools-packages/pv/2021
Browse files Browse the repository at this point in the history
add support for naip 2021
  • Loading branch information
Phil Varner authored May 18, 2023
2 parents a05673f + 59311fa commit 98bee43
Show file tree
Hide file tree
Showing 6 changed files with 901 additions and 5 deletions.
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

0 comments on commit 98bee43

Please sign in to comment.