Skip to main content

stactools-usda-cdl

PyPI

A stactools package for USDA Cropland Data Layer (CDL) product.

The USDA Cropland Data Layer (CDL) is a crop-specific land cover data layer. The data is provided at 30 m resolution over the Contiguous United States (CONUS) from 2008 to Present. The USDA CDL is produced using satellite imagery from the Landsat 8 OLI/TIRS sensor, the ISRO ResourceSat-2 LISS-3, and the ESA SENTINEL-2 sensors collected during the current growing season.

This package can generate STAC files from TIFF files that link to the Cloud-Optimized GeoTiff (COG) files.

Item types

There are three primary item types in this dataset:

  • cropland: Yearly crop-cover classification dataset, optionally with a confidence product.
  • cultivated: A boolean raster describing whether a given pixel was "cultivated" in the target year.
  • frequency: A set of four rasters that describe how often four main crop types were planted in the past fourteen years.

Examples

There is an example collection at examples/collection.json.

Tiling

While this stactools package can create items for the original, CONUS-wide GeoTIFFS, it also supports tiling the data into more manageable sized Cloud-Optimized GeoTIFFs. To tile a GeoTIFF:

stac usda-cdl tile --size 500 tests/data-files/2021_30m_cdls.tif tiles

If you have a bunch of hrefs to existing tiles, you can use stac.create_items_from_tiles to intelligantly partition those hrefs by product type and tile:

from stactools.usda_cdl import stac
from pathlib import Path
hrefs = list(Path("tests/data-files/tiles").glob("*.tif"))
items = stac.create_items_from_tiles(hrefs)

Installation

pip install stactools-usda-cdl

Command-line Usage

Use stac usda-cdl --help to see all subcommands and options.

Collection

Create a collection:

stac usda-cdl create-collection collection.json

Item

Create an item:

stac usda-cdl create-item /path/to/source/file.tif item.json

Get information about all options for item creation:

stac usda-cdl create-item --help

Contributing

We use pre-commit to check any changes. To set up your development environment:

pip install -e .
pip install -r requirements-dev.txt
pre-commit install

To check all files:

pre-commit run --all-files

To run the tests:

pytest -vv

Metadata

Release files for stactools-usda-cdl 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stactools-usda-cdl 0.1.3
File Size Uploaded
stactools-usda-cdl-0.1.3.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stactools-usda-cdl 0.1.3
File Interpreter ABI Platform
stactools_usda_cdl-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 31.8 kB

Release files / stactools-usda-cdl-0.1.3.tar.gz

Download URL stactools-usda-cdl-0.1.3.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
59c9bf15ced18964c81de73a2afdb9520ed66523ee5e1c5136d92a8cd6803eca
BLAKE2b-256 checksum
How to use checksums
9504d09167110d186beecb47ccf083faf9c781ab7bd22301d86cedea2b78d578
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / stactools_usda_cdl-0.1.3-py3-none-any.whl

Download URL stactools_usda_cdl-0.1.3-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4c79c87930d0a2323bd0cccbe29869c2ed74b40959321f44905897da0887bbe
BLAKE2b-256 checksum
How to use checksums
349a06c0ed864531d6a4d33a62321fffc2aa562783749b67a911ca13772dd329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page