Skip to main content

stactools package for USDA Cropland Data Layer

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stactools-usda-cdl-0.1.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

stactools_usda_cdl-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file stactools-usda-cdl-0.1.1.tar.gz.

File metadata

  • Download URL: stactools-usda-cdl-0.1.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for stactools-usda-cdl-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ecc501f2d2c3e93b701e0d9e84f1240358722fb930957735e0367186fd09814
MD5 795e7cb4ff1b9c7af82579db93ea54ae
BLAKE2b-256 d60379380591ece4d4f8a576d6966579c7b231fb4ab8599f3da8ed75dbdc6101

See more details on using hashes here.

Provenance

File details

Details for the file stactools_usda_cdl-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stactools_usda_cdl-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c340a5a0561a1db0cf89cb4a651a771a6b7730f692bf9a47487ee67ed39ba483
MD5 9aeb5953887c41f827bb5e0d1d1238ac
BLAKE2b-256 16e00d539d8d748b876b2e0b180a5b763a8eaf4345b086c5aa82c3661fb286fc

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page