import rioxarray as rioxr
import geopandas as gpd
import matplotlib.pyplot as plt
from shapely.geometry import shape # To turn GeoJSON dictionaries into geometries
from pystac_client import Client # To access STAC catalogs
import planetary_computer # To sign items from the MPC STAC catalog
from IPython.display import Image # To nicely display images18 STAC specification
So far in our course we have obtained data in two ways: by downloading it directly from the data provider or by obtaining a URL from a data repository. These can be convenient ways to access targeted datasets, often using graphical user interfaces (GUIs) for data discovery and filtering. However, relying on clicking and copy-pasting addresses and file names can make our workflows more error-prone and less reproducible. In particular, satellites around the world produce terabytes of new data daily and manually browsing through data repositories can make it difficult to access this data. Moreover, it can be inconvenient to learn a new way to access data from every single big data provider. This is where STAC comes in.

The SpatioTemporal Asset Catalog (STAC) is an open standard for geospatial data that aims to increase the interoperability of geospatial data, particularly satellite imagery. Many major data archives now follow the STAC specification.
In the next classes we’ll be working with the Microsoft Planetary Computer (MPC) STAC API. In this lesson we will learn about the main components of a STAC catalog and how to search for data using the MPC’s STAC API.
Item, collection, and catalog
The STAC item (or just item) is the building block of a STAC. An item is a GeoJSON feature with additional fields that make it easier to find it as we look for data across catalogs.
An item holds two types of information:
Metadata: The metadata for a STAC item includes core identifying information (such as ID, geometry, bounding box, and date), and additional properties (for example, place of collection).
Assets: Assets are links to the actual data of the item (for example, links to the spectral bands of a satellite image).
STAC items can be grouped into STAC collections. For example, while a single satellite scene (at a single time and location) would constitute an item, scenes across time and location from the same satellite can be organized in a collection. Finally, multiple collections can be organized into a single STAC catalog.
For example, we’ll be accessing the MPC STAC catalog. Two of its collections are the National Agriculture Imagery Program (NAIP) collection and the Copernicus Digital Elevation Model (DEM) collection. Each of these collections has multiple items, with each item containing metadata and assets (links to the data).

Application Programming Interface (API)
To request data from a catalog following the STAC standard we use an Application Programming Interface (API). We can think of an API as an intermediary tasked with sending our request for data to the data catalog and getting the response from the catalog back to us. The following diagram nicely explains what an API does using a real-life analogy of a restaurant:

The Python package to access APIs for STAC catalogs is pystac_client. Our goal in this lesson is to retrieve NAIP data from the MPC’s data catalog via its STAC API [1].
MPC catalog
First, load the necessary packages:
Access
We use the open() method of the Client class from the pystac_client package to access the catalog:
The modifier parameter is needed to access the data in the MPC catalog.
Catalog exploration
Let’s check out some of the catalog’s metadata:
# Explore catalog metadata
print('Title:', catalog.title)
print('Description:', catalog.description)Title: Microsoft Planetary Computer STAC API
Description: Searchable spatiotemporal metadata describing Earth science datasets hosted by the Microsoft Planetary Computer
We can access its collections by using the get_collections() method:
Notice the output of get_collections() is a generator. This is a special kind of lazy object in Python that you can loop over like a list. Unlike a list, the items in a generator do not exist in memory until you explicitly iterate over them or convert them to a list. This can allow for more efficient memory allocation. Once the generator is exhausted (i.e. iterated over completely), it cannot be reused unless it is recreated.
Let’s try getting the collections from the catalog again:
# Get collections and print their names
collections = list(catalog.get_collections()) # Turn generator into list
print('Number of collections:', len(collections))
print("Collection IDs (first 10):")
for i in range(10):
print('-', collections[i].id)Number of collections: 139
Collection IDs (first 10):
- 3dep-lidar-classification
- 3dep-lidar-copc
- 3dep-lidar-dsm
- 3dep-lidar-dtm
- 3dep-lidar-dtm-native
- 3dep-lidar-hag
- 3dep-lidar-intensity
- 3dep-lidar-pointsourceid
- 3dep-lidar-returns
- 3dep-seamless
Collection
The NAIP collection’s ID is 'naip'. We can select a single collection for exploration using the get_collection() method for the catalog and the collection ID as the parameter:
- type "Collection"
- id "naip"
- stac_version "1.1.0"
- description "The [National Agriculture Imagery Program](https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/) (NAIP) provides U.S.-wide, high-resolution aerial imagery, with four spectral bands (R, G, B, IR). NAIP is administered by the [Aerial Field Photography Office](https://www.fsa.usda.gov/programs-and-services/aerial-photography/) (AFPO) within the [US Department of Agriculture](https://www.usda.gov/) (USDA). Data are captured at least once every three years for each state. This dataset represents NAIP data from 2010-present, in [cloud-optimized GeoTIFF](https://www.cogeo.org/) format. You can visualize the coverage of current and past collections [here](https://naip-usdaonline.hub.arcgis.com/). "
links[] 5 items
0
- rel "items"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items"
- type "application/geo+json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
4
- rel "http://www.opengis.net/def/rel/ogc/1.0/queryables"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/queryables"
- type "application/schema+json"
- title "Queryables"
stac_extensions[] 1 items
- 0 "https://stac-extensions.github.io/storage/v2.0.0/schema.json"
item_assets
image
- type "image/tiff; application=geotiff; profile=cloud-optimized"
roles[] 1 items
- 0 "data"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
metadata
- type "text/plain"
roles[] 1 items
- 0 "metadata"
- title "FGDC Metdata"
thumbnail
- type "image/jpeg"
roles[] 1 items
- 0 "thumbnail"
- title "Thumbnail"
- msft:region "westeurope"
- msft:_created "2026-10-12T16:21:25.8976911Z"
- msft:_updated "2026-11-17T21:29:34.5002904Z"
- msft:container "naip"
storage:schemes
azure
- type "ms-azure"
- region "westeurope"
- account "naipeuwest"
- platform "https://{account}.blob.core.windows.net"
- container "naip"
- msft:storage_account "naipeuwest"
- msft:short_description "NAIP provides US-wide, high-resolution aerial imagery. This dataset includes NAIP images from 2010 to the present."
- title "NAIP: National Agriculture Imagery Program"
extent
spatial
bbox[] 4 items
0[] 4 items
- 0 -124.784
- 1 24.744
- 2 -66.951
- 3 49.346
1[] 4 items
- 0 -156.003
- 1 19.059
- 2 -154.809
- 3 20.127
2[] 4 items
- 0 -67.316
- 1 17.871
- 2 -65.596
- 3 18.565
3[] 4 items
- 0 -64.94
- 1 17.622
- 2 -64.56
- 3 17.814
temporal
interval[] 1 items
0[] 2 items
- 0 "2010-01-01T00:00:00Z"
- 1 "2025-12-31T23:59:59Z"
- license "proprietary"
keywords[] 7 items
- 0 "NAIP"
- 1 "Aerial"
- 2 "Imagery"
- 3 "USDA"
- 4 "AFPO"
- 5 "Agriculture"
- 6 "United States"
providers[] 3 items
0
- name "USDA Farm Service Agency"
roles[] 2 items
- 0 "producer"
- 1 "licensor"
- url "https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/"
1
- name "Esri"
roles[] 1 items
- 0 "processor"
- url "https://www.esri.com/"
2
- name "Microsoft"
roles[] 2 items
- 0 "host"
- 1 "processor"
- url "https://planetarycomputer.microsoft.com"
summaries
gsd[] 3 items
- 0 0.3
- 1 0.6
- 2 1
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
- description "visible red"
1
- name "Green"
- common_name "green"
- description "visible green"
2
- name "Blue"
- common_name "blue"
- description "visible blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
assets
thumbnail
- href "https://ai4edatasetspublicassets.blob.core.windows.net/assets/pc_thumbnails/naip.png"
- type "image/png"
- title "NAIP thumbnail"
roles[] 1 items
- 0 "thumbnail"
geoparquet-items
- href "abfs://items/naip.parquet"
- type "application/x-parquet"
- title "GeoParquet STAC items"
- description "Snapshot of the collection's STAC items exported to GeoParquet format."
msft:partition_info
- is_partitioned True
- partition_frequency "AS"
table:storage_options
- account_name "pcstacitems"
- credential "st=2026-11-18T19%3A16%3A20Z&se=2026-11-19T20%3A01%3A20Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-19T13%3A20%3A13Z&ske=2026-11-26T13%3A20%3A13Z&sks=b&skv=2025-07-05&sig=ExKMWDZ3he%2BcGv/6t1JrRhBBux/HuBNcSBrmXHdUtpA%3D"
roles[] 1 items
- 0 "stac-items"
Catalog search
We can narrow down the search within the catalog by specifying a time range, an area of interest, and the collection name. The simplest ways to define the area of interest to look for data in the catalog are:
- a GeoJSON-type dictionary with the coordinates of the bounding box,
- a list
[xmin, ymin, xmax, ymax]with the coordinate values defining the four corners of the bounding box.
In this lesson we will look for all the NAIP scenes over Santa Barbara available up to November 16, 2026. The .. at the start of the time range leaves the start date open, so the search returns every scene up to the end date. We’ll use the GeoJSON method to define the area of interest:
# Temporal range of interest
time_range = "../2026-11-16"
# NCEAS bounding box (as a GeoJSON, CRS=EPSG:4326)
aoi = {
"type": "Polygon",
"coordinates":[
[
[-119.70608227128903, 34.426300194372274],
[-119.70608227128903, 34.42041139020533],
[-119.6967885126002, 34.42041139020533],
[-119.6967885126002, 34.426300194372274],
[-119.70608227128903, 34.426300194372274]
]
],
}
# Catalog search
search = catalog.search(
collections = ['naip'],
intersects = aoi,
datetime = time_range)
search<pystac_client.item_search.ItemSearch at 0x700666e450>
To get the items found in the search (or check if there were any matches in the search) we use the item_collection() method:
This output tells us there were seven items in the catalog that matched our search!
- type "FeatureCollection"
features[] 7 items
0
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_060_20240625"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.683292
- 1 34.373269
1[] 2 items
- 0 -119.685448
- 1 34.440724
2[] 2 items
- 0 -119.754272
- 1 34.439192
3[] 2 items
- 0 -119.752061
- 1 34.371741
4[] 2 items
- 0 -119.683292
- 1 34.373269
bbox[] 4 items
- 0 -119.754272
- 1 34.371741
- 2 -119.683292
- 3 34.440724
properties
- gsd 0.6
- datetime "2024-06-25T16:00:00Z"
- naip:year "2024"
proj:bbox[] 4 items
- 0 246930.0
- 1 3806808.0
- 2 253260.0
- 3 3814296.0
- proj:code "EPSG:26911"
providers[] 1 items
0
- url "https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/"
- name "USDA Farm Service Agency"
roles[] 2 items
- 0 "producer"
- 1 "licensor"
- naip:state "ca"
proj:shape[] 2 items
- 0 12480
- 1 10550
proj:centroid
- lat 34.40624
- lon -119.71877
proj:transform[] 9 items
- 0 0.6
- 1 0.0
- 2 246930.0
- 3 0.0
- 4 -0.6
- 5 3814296.0
- 6 0.0
- 7 0.0
- 8 1.0
links[] 4 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_060_20240625"
- type "application/geo+json"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2024/ca_060cm_2024/34119/m_3411935_sw_11_060_20240625.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2024/ca_060cm_2024/34119/m_3411935_sw_11_060_20240625.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 2 items
- 0 "thumbnail"
- 1 "overview"
- collection "naip"
1
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_060_20220513"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.683292
- 1 34.373269
1[] 2 items
- 0 -119.685448
- 1 34.440724
2[] 2 items
- 0 -119.754272
- 1 34.439192
3[] 2 items
- 0 -119.752061
- 1 34.371741
4[] 2 items
- 0 -119.683292
- 1 34.373269
bbox[] 4 items
- 0 -119.754272
- 1 34.371741
- 2 -119.683292
- 3 34.440724
properties
- gsd 0.6
- datetime "2022-05-13T16:00:00Z"
- naip:year 2022
proj:bbox[] 4 items
- 0 246930.0
- 1 3806808.0
- 2 253260.0
- 3 3814296.0
providers[] 1 items
0
- url "https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/"
- name "USDA Farm Service Agency"
roles[] 2 items
- 0 "producer"
- 1 "licensor"
- naip:state "ca"
proj:shape[] 2 items
- 0 12480
- 1 10550
proj:centroid
- lat 34.40624
- lon -119.71877
proj:transform[] 9 items
- 0 0.6
- 1 0.0
- 2 246930.0
- 3 0.0
- 4 -0.6
- 5 3814296.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_060_20220513"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_060_20220513"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2022/ca_060cm_2022/34119/m_3411935_sw_11_060_20220513.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_060_20220513&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2022/ca_060cm_2022/34119/m_3411935_sw_11_060_20220513.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_060_20220513&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
2
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_060_20200521"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.683292
- 1 34.373269
1[] 2 items
- 0 -119.685448
- 1 34.440724
2[] 2 items
- 0 -119.754272
- 1 34.439192
3[] 2 items
- 0 -119.752061
- 1 34.371741
4[] 2 items
- 0 -119.683292
- 1 34.373269
bbox[] 4 items
- 0 -119.754272
- 1 34.371741
- 2 -119.683292
- 3 34.440724
properties
- gsd 0.6
- datetime "2020-05-21T00:00:00Z"
- naip:year 2020
proj:bbox[] 4 items
- 0 246930.0
- 1 3806808.0
- 2 253260.0
- 3 3814296.0
- naip:state "ca"
proj:shape[] 2 items
- 0 12480
- 1 10550
proj:transform[] 9 items
- 0 0.6
- 1 0.0
- 2 246930.0
- 3 0.0
- 4 -0.6
- 5 3814296.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_060_20200521"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_060_20200521"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2020/ca_060cm_2020/34119/m_3411935_sw_11_060_20200521.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_060_20200521&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2020/ca_060cm_2020/34119/m_3411935_sw_11_060_20200521.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_060_20200521&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
3
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_060_20180724_20190209"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.683827
- 1 34.37369
1[] 2 items
- 0 -119.685956
- 1 34.44028
2[] 2 items
- 0 -119.753736
- 1 34.438772
3[] 2 items
- 0 -119.751554
- 1 34.372185
4[] 2 items
- 0 -119.683827
- 1 34.37369
bbox[] 4 items
- 0 -119.753736
- 1 34.372185
- 2 -119.683827
- 3 34.44028
properties
- gsd 0.6
- datetime "2018-07-24T00:00:00Z"
- naip:year 2018
proj:bbox[] 4 items
- 0 246978.0
- 1 3806856.0
- 2 253212.0
- 3 3814248.0
- naip:state "ca"
proj:shape[] 2 items
- 0 12320
- 1 10390
proj:transform[] 9 items
- 0 0.6
- 1 0.0
- 2 246978.0
- 3 0.0
- 4 -0.6
- 5 3814248.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_060_20180724_20190209"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_060_20180724_20190209"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2018/ca_060cm_2018/34119/m_3411935_sw_11_060_20180724_20190209.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
metadata
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2018/ca_fgdc_2018/34119/m_3411935_sw_11_060_20180724.txt?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "text/plain"
- title "FGDC Metdata"
roles[] 1 items
- 0 "metadata"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_060_20180724_20190209&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2018/ca_060cm_2018/34119/m_3411935_sw_11_060_20180724_20190209.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_060_20180724_20190209&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
4
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_.6_20160713_20161004"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.683827
- 1 34.37369
1[] 2 items
- 0 -119.685956
- 1 34.44028
2[] 2 items
- 0 -119.753736
- 1 34.438772
3[] 2 items
- 0 -119.751554
- 1 34.372185
4[] 2 items
- 0 -119.683827
- 1 34.37369
bbox[] 4 items
- 0 -119.753736
- 1 34.372185
- 2 -119.683827
- 3 34.44028
properties
- gsd 0.6
- datetime "2016-07-13T00:00:00Z"
- naip:year 2016
proj:bbox[] 4 items
- 0 246978.0
- 1 3806856.0
- 2 253212.0
- 3 3814248.0
- naip:state "ca"
proj:shape[] 2 items
- 0 12320
- 1 10390
proj:transform[] 9 items
- 0 0.6
- 1 0.0
- 2 246978.0
- 3 0.0
- 4 -0.6
- 5 3814248.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_.6_20160713_20161004"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_.6_20160713_20161004"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2016/ca_060cm_2016/34119/m_3411935_sw_11_h_20160713.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
metadata
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2016/ca_fgdc_2016/34119/m_3411935_sw_11_h_20160713.txt?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "text/plain"
- title "FGDC Metdata"
roles[] 1 items
- 0 "metadata"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_.6_20160713_20161004&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2016/ca_060cm_2016/34119/m_3411935_sw_11_h_20160713.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_.6_20160713_20161004&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
5
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_1_20140601_20141030"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.682144
- 1 34.372402
1[] 2 items
- 0 -119.684357
- 1 34.441668
2[] 2 items
- 0 -119.755401
- 1 34.440086
3[] 2 items
- 0 -119.753129
- 1 34.370825
4[] 2 items
- 0 -119.682144
- 1 34.372402
bbox[] 4 items
- 0 -119.755401
- 1 34.370825
- 2 -119.682144
- 3 34.441668
properties
- gsd 1.0
- datetime "2014-06-01T00:00:00Z"
- naip:year 2014
proj:bbox[] 4 items
- 0 246829.0
- 1 3806709.0
- 2 253363.0
- 3 3814398.0
- naip:state "ca"
proj:shape[] 2 items
- 0 7689
- 1 6534
proj:transform[] 9 items
- 0 1.0
- 1 0.0
- 2 246829.0
- 3 0.0
- 4 -1.0
- 5 3814398.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_1_20140601_20141030"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_1_20140601_20141030"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2014/ca_100cm_2014/34119/m_3411935_sw_11_1_20140601.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
metadata
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2014/ca_fgdc_2014/34119/m_3411935_sw_11_1_20140601.txt?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "text/plain"
- title "FGDC Metdata"
roles[] 1 items
- 0 "metadata"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_1_20140601_20141030&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2014/ca_100cm_2014/34119/m_3411935_sw_11_1_20140601.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_1_20140601_20141030&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
6
- type "Feature"
- stac_version "1.1.0"
stac_extensions[] 2 items
- 0 "https://stac-extensions.github.io/eo/v1.1.0/schema.json"
- 1 "https://stac-extensions.github.io/projection/v2.0.0/schema.json"
- id "ca_m_3411935_sw_11_1_20120505_20120730"
geometry
- type "Polygon"
coordinates[] 1 items
0[] 5 items
0[] 2 items
- 0 -119.681957
- 1 34.372325
1[] 2 items
- 0 -119.684176
- 1 34.44178
2[] 2 items
- 0 -119.755611
- 1 34.44019
3[] 2 items
- 0 -119.753333
- 1 34.370739
4[] 2 items
- 0 -119.681957
- 1 34.372325
bbox[] 4 items
- 0 -119.755611
- 1 34.370739
- 2 -119.681957
- 3 34.44178
properties
- gsd 1.0
- datetime "2012-05-05T00:00:00Z"
- naip:year 2012
proj:bbox[] 4 items
- 0 246810.0
- 1 3806700.0
- 2 253380.0
- 3 3814410.0
- naip:state "ca"
proj:shape[] 2 items
- 0 7710
- 1 6570
proj:transform[] 9 items
- 0 1.0
- 1 0.0
- 2 246810.0
- 3 0.0
- 4 -1.0
- 5 3814410.0
- 6 0.0
- 7 0.0
- 8 1.0
- proj:code "EPSG:26911"
links[] 5 items
0
- rel "collection"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
1
- rel "parent"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
2
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
- title "Microsoft Planetary Computer STAC API"
3
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip/items/ca_m_3411935_sw_11_1_20120505_20120730"
- type "application/geo+json"
4
- rel "preview"
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=naip&item=ca_m_3411935_sw_11_1_20120505_20120730"
- type "text/html"
- title "Map of item"
assets
image
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2012/ca_100cm_2012/34119/m_3411935_sw_11_1_20120505.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/tiff; application=geotiff; profile=cloud-optimized"
- title "RGBIR COG tile"
eo:bands[] 4 items
0
- name "Red"
- common_name "red"
1
- name "Green"
- common_name "green"
2
- name "Blue"
- common_name "blue"
3
- name "NIR"
- common_name "nir"
- description "near-infrared"
roles[] 1 items
- 0 "data"
metadata
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2012/ca_fgdc_2012/34119/m_3411935_sw_11_1_20120505.txt?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "text/plain"
- title "FGDC Metdata"
roles[] 1 items
- 0 "metadata"
tilejson
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=naip&item=ca_m_3411935_sw_11_1_20120505_20120730&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "application/json"
- title "TileJSON with default rendering"
roles[] 1 items
- 0 "tiles"
thumbnail
- href "https://naipeuwest.blob.core.windows.net/naip/v002/ca/2012/ca_100cm_2012/34119/m_3411935_sw_11_1_20120505.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D"
- type "image/jpeg"
- title "Thumbnail"
roles[] 1 items
- 0 "thumbnail"
rendered_preview
- href "https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=naip&item=ca_m_3411935_sw_11_1_20120505_20120730&assets=image&asset_bidx=image%7C1%2C2%2C3"
- type "image/png"
- title "Rendered preview"
- rel "preview"
roles[] 1 items
- 0 "overview"
- collection "naip"
Item
Our search returned several items. Run the code below to see what distinguishes them.
Here gsd stands for ground sample distance at the sensor, in meters (m). This is the pixel size of the raster.
- What differs between the items besides the year?
- Suppose you want to compare the vegetation around NCEAS with the 2018 image from the
rioxarraylesson. Which item would you pick, and why?
In our search the items are listed from newest to oldest, so items[0] is the most recent scene. We’ll work with this one for the rest of the lesson:
Remember the STAC item is the core object in a STAC catalog. The item does not contain the data itself, but rather metadata and assets. The assets contain links to access the actual data. Some of the metadata:
ID: ca_m_3411935_sw_11_060_20240625
{'gsd': 0.6,
'datetime': '2024-06-25T16:00:00Z',
'naip:year': '2024',
'proj:bbox': [246930.0, 3806808.0, 253260.0, 3814296.0],
'proj:code': 'EPSG:26911',
'providers': [{'url': 'https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/',
'name': 'USDA Farm Service Agency',
'roles': ['producer', 'licensor']}],
'naip:state': 'ca',
'proj:shape': [12480, 10550],
'proj:centroid': {'lat': 34.40624, 'lon': -119.71877},
'proj:transform': [0.6, 0.0, 246930.0, 0.0, -0.6, 3814296.0, 0.0, 0.0, 1.0]}
From the item’s properties, when was this image taken, at what resolution, and in what CRS? Is the time of day in datetime believable?
Footprint
The footprint of the item is the area on the ground its data covers. We can access it with the geometry attribute:
{'type': 'Polygon',
'coordinates': [[[-119.683292, 34.373269],
[-119.685448, 34.440724],
[-119.754272, 34.439192],
[-119.752061, 34.371741],
[-119.683292, 34.373269]]]}
Before loading the data we want to see how the item intersects with our aoi around NCEAS. To do this, we create a gpd.GeoDataFrame for each of the geometries. The new piece is the shape() function from the shapely package, which turns a GeoJSON-type dictionary into a geometry. Both our aoi and the item’s geometry are GeoJSON-type dictionaries, and STAC geometries always use longitude and latitude coordinates (EPSG:4326).
The code below plots the item’s footprint together with our area of interest.
# Plot the footprint outline and the AOI on the same axis
fig, ax = plt.subplots()
footprint.plot(ax=ax, color='none', edgecolor='black')
aoi_gdf.plot(ax=ax, color='red')
ax.set_title('NAIP item footprint (black) and our area of interest (red)')
plt.show()
Our area of interest is a small part of the item. When we search with intersects, the catalog returns every whole item that touches our area of interest. It doesn’t clip the data to it.
Assets
Just as the item properties, the item assets are given in a dictionary, with each value being a pystac.Asset. Let’s check the assets in the item:
{'image': <Asset href=https://naipeuwest.blob.core.windows.net/naip/v002/ca/2024/ca_060cm_2024/34119/m_3411935_sw_11_060_20240625.tif?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D>,
'thumbnail': <Asset href=https://naipeuwest.blob.core.windows.net/naip/v002/ca/2024/ca_060cm_2024/34119/m_3411935_sw_11_060_20240625.200.jpg?st=2026-11-18T19%3A17%3A23Z&se=2026-11-19T20%3A02%3A23Z&sp=rl&sv=2025-07-05&sr=c&skoid=9c8ff44a-6a2c-4dfb-b298-1c9212f64d9a&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2026-11-15T01%3A08%3A54Z&ske=2026-11-22T01%3A08%3A54Z&sks=b&skv=2025-07-05&sig=AXVjdMs3A8O1iDVo8i8nV20KsOuUuOJzQPupzmv7bE4%3D>}
image -- RGBIR COG tile
thumbnail -- Thumbnail
Notice each asset has an href, which is a link to the data. For example, we can use the URL for the 'thumbnail' asset to plot a small preview of the scene:
Load data
The raster data in our current item is in the image asset. Again, we access this data via its URL. This time, we open it using rioxr.open_rasterio() directly:
<xarray.DataArray (band: 4, y: 12480, x: 10550)> Size: 527MB
[526656000 values with dtype=uint8]
Coordinates:
* band (band) int64 32B 1 2 3 4
* x (x) float64 84kB 2.469e+05 2.469e+05 ... 2.533e+05 2.533e+05
* y (y) float64 100kB 3.814e+06 3.814e+06 ... 3.807e+06 3.807e+06
spatial_ref int64 8B 0
Attributes:
TIFFTAG_XRESOLUTION: 1
TIFFTAG_YRESOLUTION: 1
TIFFTAG_RESOLUTIONUNIT: 1 (unitless)
AREA_OR_POINT: Area
scale_factor: 1.0
add_offset: 0.0- band: 4
- y: 12480
- x: 10550
- ...
[526656000 values with dtype=uint8]
- band(band)int641 2 3 4
array([1, 2, 3, 4])
- x(x)float642.469e+05 2.469e+05 ... 2.533e+05
array([246930.3, 246930.9, 246931.5, ..., 253258.5, 253259.1, 253259.7])
- y(y)float643.814e+06 3.814e+06 ... 3.807e+06
array([3814295.7, 3814295.1, 3814294.5, ..., 3806809.5, 3806808.9, 3806808.3])
- spatial_ref()int640
- crs_wkt :
- PROJCS["NAD83 / UTM zone 11N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26911"]]
- semi_major_axis :
- 6378137.0
- semi_minor_axis :
- 6356752.314140356
- inverse_flattening :
- 298.257222101
- reference_ellipsoid_name :
- GRS 1980
- longitude_of_prime_meridian :
- 0.0
- prime_meridian_name :
- Greenwich
- geographic_crs_name :
- NAD83
- horizontal_datum_name :
- North American Datum 1983
- projected_crs_name :
- NAD83 / UTM zone 11N
- grid_mapping_name :
- transverse_mercator
- latitude_of_projection_origin :
- 0.0
- longitude_of_central_meridian :
- -117.0
- false_easting :
- 500000.0
- false_northing :
- 0.0
- scale_factor_at_central_meridian :
- 0.9996
- spatial_ref :
- PROJCS["NAD83 / UTM zone 11N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","26911"]]
- GeoTransform :
- 246930.0 0.6 0.0 3814296.0 0.0 -0.6
array(0)
- bandPandasIndex
PandasIndex(Index([1, 2, 3, 4], dtype='int64', name='band'))
- xPandasIndex
PandasIndex(Index([ 246930.3, 246930.9, 246931.5, 246932.09999999998, 246932.69999999998, 246933.3, 246933.9, 246934.5, 246935.09999999998, 246935.69999999998, ... 253254.3, 253254.9, 253255.5, 253256.09999999998, 253256.69999999998, 253257.3, 253257.9, 253258.5, 253259.09999999998, 253259.69999999998], dtype='float64', name='x', length=10550)) - yPandasIndex
PandasIndex(Index([ 3814295.7, 3814295.1, 3814294.5, 3814293.9000000004, 3814293.3000000003, 3814292.7, 3814292.1, 3814291.5, 3814290.9000000004, 3814290.3000000003, ... 3806813.7, 3806813.1, 3806812.5, 3806811.9000000004, 3806811.3000000003, 3806810.7, 3806810.1, 3806809.5, 3806808.9000000004, 3806808.3000000003], dtype='float64', name='y', length=12480))
- TIFFTAG_XRESOLUTION :
- 1
- TIFFTAG_YRESOLUTION :
- 1
- TIFFTAG_RESOLUTIONUNIT :
- 1 (unitless)
- AREA_OR_POINT :
- Area
- scale_factor :
- 1.0
- add_offset :
- 0.0
Notice the output doesn’t show any data values, only [526656000 values with dtype=uint8]. That’s because open_rasterio() only read the file’s metadata: its dimensions, coordinates and CRS. The data itself (about 500 MB) stays in the cloud until we use it, for example to plot it or to compute a statistic. This is the same lazy behavior we saw with generators. The NAIP files are stored as Cloud-Optimized GeoTIFFs (COGs), a format designed so we can read just the part of a file we need instead of downloading all of it.
Notice this raster has four bands (red, green, blue, nir), so we cannot plot it directly: .plot.imshow() would read the fourth band (NIR) as transparency. Thus we need to select the bands we want to plot (RGB) before plotting:

Exercises
The Copernicus Digital Elevation Model (DEM) collection contains elevation data at 90 m spatial resolution [2]. The collection ID in the MPC catalog is 'cop-dem-glo-90'.
Suppose you want to know how high above sea level the area around NCEAS is, for example to start thinking about its flood or sea-level-rise risk.
- Explore the dataset’s landing page in the MPC catalog. Who produced this data, how was it made and what is its spatial resolution?
- Search the catalog for items in this collection that intersect our
aoi. How many items did you get? - Get the first item in the search and look at its properties. What is its
gsd? What is itsdatetime? - Before plotting, predict: will this item’s footprint be larger or smaller than the NAIP item’s? Then create a geodataframe with the DEM item’s footprint and plot it together with the NAIP
footprintandaoi_gdf. - Open the item’s
'data'asset usingrioxarrayand save it into a variable nameddem. Check its CRS, resolution and nodata value, and plot it.
- Obtain the maximum and minimum elevation in
demas numbers, and print them rounded to two decimal places using f-strings. For vertical units, consult the data’s handbook. - Read the collection’s description (
catalog.get_collection('cop-dem-glo-90').description). What kind of elevation model is this? Over the NCEAS building, what would it measure? - Look at your plots from steps 4 and 5. Are the maximum and minimum from step 6 the highest and lowest points in Santa Barbara? Where do you think they are?
- Count how many pixels in
demare exactly 0 using(dem == 0).sum(). What fraction of the raster is that, and what do you think these pixels are? Comparedem.mean()withdem.where(dem != 0).mean(). Which one would you report as the average elevation of this area, and why? - Clip
demto the NAIPfootprintusingdem.rio.clip_box(*footprint.total_bounds). Plot it and recompute the maximum, minimum and the number of 0 pixels. - Your call: would you use this dataset to estimate the ground elevation at NCEAS for a sea-level-rise question? Write two or three sentences justifying your answer. Consider what the data measures, its pixel size and when it was made.
Further reading
STAC Documentation: