STAC Metadata Visualizations#
This notebook illustrates a simple way to display footprints of discovered Items after searching a STAC API, and making simple plots using Pandas and Holoviews. Only the metadata is visualized in these examples through maps and plots. The actual STAC data (i.e., Item Assets) are not accessed.
The libraries GeoPandas and hvplot are used for visualizations.
[1]:
from pystac_client import Client
# set pystac_client logger to DEBUG to see API calls
import logging
logging.basicConfig()
logger = logging.getLogger('pystac_client')
logger.setLevel(logging.DEBUG)
Define the STAC API to use, along with any custom headers (such as for authentication)
[2]:
# STAC API root URL
URL = 'https://planetarycomputer.microsoft.com/api/stac/v1'
# custom headers
headers = []
cat = Client.open(URL, headers=headers)
cat
DEBUG:pystac_client.stac_api_io:GET https://planetarycomputer.microsoft.com/api/stac/v1 Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive'}
[2]:
- type "Catalog"
- id "microsoft-pc"
- stac_version "1.0.0"
- description "Searchable spatiotemporal metadata describing Earth science datasets hosted by the Microsoft Planetary Computer"
links[] 131 items
0
- rel "self"
- href "https://planetarycomputer.microsoft.com/api/stac/v1"
- type "application/json"
1
- rel "root"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/"
- type "application/json"
2
- rel "data"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections"
- type "application/json"
3
- rel "conformance"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/conformance"
- type "application/json"
- title "STAC/WFS3 conformance classes implemented by this server"
4
- rel "search"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/search"
- type "application/geo+json"
- title "STAC search"
- method "GET"
5
- rel "search"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/search"
- type "application/geo+json"
- title "STAC search"
- method "POST"
6
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-annual-pr"
- type "application/json"
- title "Daymet Annual Puerto Rico"
7
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-daily-hi"
- type "application/json"
- title "Daymet Daily Hawaii"
8
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-seamless"
- type "application/json"
- title "USGS 3DEP Seamless DEMs"
9
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-dsm"
- type "application/json"
- title "USGS 3DEP Lidar Digital Surface Model"
10
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/fia"
- type "application/json"
- title "Forest Inventory and Analysis"
11
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-rtc"
- type "application/json"
- title "Sentinel 1 Radiometrically Terrain Corrected (RTC)"
12
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gridmet"
- type "application/json"
- title "gridMET"
13
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-annual-na"
- type "application/json"
- title "Daymet Annual North America"
14
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-monthly-na"
- type "application/json"
- title "Daymet Monthly North America"
15
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-annual-hi"
- type "application/json"
- title "Daymet Annual Hawaii"
16
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-monthly-hi"
- type "application/json"
- title "Daymet Monthly Hawaii"
17
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-monthly-pr"
- type "application/json"
- title "Daymet Monthly Puerto Rico"
18
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gnatsgo-tables"
- type "application/json"
- title "gNATSGO Soil Database - Tables"
19
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/hgb"
- type "application/json"
- title "HGB: Harmonized Global Biomass for 2010"
20
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/cop-dem-glo-30"
- type "application/json"
- title "Copernicus DEM GLO-30"
21
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/cop-dem-glo-90"
- type "application/json"
- title "Copernicus DEM GLO-90"
22
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/goes-cmi"
- type "application/json"
- title "GOES-R Cloud & Moisture Imagery"
23
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/terraclimate"
- type "application/json"
- title "TerraClimate"
24
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/nasa-nex-gddp-cmip6"
- type "application/json"
- title "Earth Exchange Global Daily Downscaled Projections (NEX-GDDP-CMIP6)"
25
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gpm-imerg-hhr"
- type "application/json"
- title "GPM IMERG"
26
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gnatsgo-rasters"
- type "application/json"
- title "gNATSGO Soil Database - Rasters"
27
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-hag"
- type "application/json"
- title "USGS 3DEP Lidar Height above Ground"
28
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/io-lulc-annual-v02"
- type "application/json"
- title "10m Annual Land Use Land Cover (9-class) V2"
29
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-intensity"
- type "application/json"
- title "USGS 3DEP Lidar Intensity"
30
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-pointsourceid"
- type "application/json"
- title "USGS 3DEP Lidar Point Source"
31
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/mtbs"
- type "application/json"
- title "MTBS: Monitoring Trends in Burn Severity"
32
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-c-cap"
- type "application/json"
- title "C-CAP Regional Land Cover and Change"
33
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-copc"
- type "application/json"
- title "USGS 3DEP Lidar Point Cloud"
34
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-64A1-061"
- type "application/json"
- title "MODIS Burned Area Monthly"
35
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/alos-fnf-mosaic"
- type "application/json"
- title "ALOS Forest/Non-Forest Annual Mosaic"
36
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-returns"
- type "application/json"
- title "USGS 3DEP Lidar Returns"
37
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/mobi"
- type "application/json"
- title "MoBI: Map of Biodiversity Importance"
38
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2"
- type "application/json"
- title "Landsat Collection 2 Level-2"
39
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/era5-pds"
- type "application/json"
- title "ERA5 - PDS"
40
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/chloris-biomass"
- type "application/json"
- title "Chloris Biomass"
41
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/kaza-hydroforecast"
- type "application/json"
- title "HydroForecast - Kwando & Upper Zambezi Rivers"
42
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/planet-nicfi-analytic"
- type "application/json"
- title "Planet-NICFI Basemaps (Analytic)"
43
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-17A2H-061"
- type "application/json"
- title "MODIS Gross Primary Productivity 8-Day"
44
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-11A2-061"
- type "application/json"
- title "MODIS Land Surface Temperature/Emissivity 8-Day"
45
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-daily-pr"
- type "application/json"
- title "Daymet Daily Puerto Rico"
46
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-dtm-native"
- type "application/json"
- title "USGS 3DEP Lidar Digital Terrain Model (Native)"
47
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-classification"
- type "application/json"
- title "USGS 3DEP Lidar Classification"
48
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/3dep-lidar-dtm"
- type "application/json"
- title "USGS 3DEP Lidar Digital Terrain Model"
49
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gap"
- type "application/json"
- title "USGS Gap Land Cover"
50
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-17A2HGF-061"
- type "application/json"
- title "MODIS Gross Primary Productivity 8-Day Gap-Filled"
51
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/planet-nicfi-visual"
- type "application/json"
- title "Planet-NICFI Basemaps (Visual)"
52
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gbif"
- type "application/json"
- title "Global Biodiversity Information Facility (GBIF)"
53
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-17A3HGF-061"
- type "application/json"
- title "MODIS Net Primary Production Yearly Gap-Filled"
54
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-09A1-061"
- type "application/json"
- title "MODIS Surface Reflectance 8-Day (500m)"
55
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/alos-dem"
- type "application/json"
- title "ALOS World 3D-30m"
56
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/alos-palsar-mosaic"
- type "application/json"
- title "ALOS PALSAR Annual Mosaic"
57
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/deltares-water-availability"
- type "application/json"
- title "Deltares Global Water Availability"
58
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-16A3GF-061"
- type "application/json"
- title "MODIS Net Evapotranspiration Yearly Gap-Filled"
59
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-21A2-061"
- type "application/json"
- title "MODIS Land Surface Temperature/3-Band Emissivity 8-Day"
60
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/us-census"
- type "application/json"
- title "US Census"
61
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/jrc-gsw"
- type "application/json"
- title "JRC Global Surface Water"
62
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/deltares-floods"
- type "application/json"
- title "Deltares Global Flood Maps"
63
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-43A4-061"
- type "application/json"
- title "MODIS Nadir BRDF-Adjusted Reflectance (NBAR) Daily"
64
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-09Q1-061"
- type "application/json"
- title "MODIS Surface Reflectance 8-Day (250m)"
65
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-14A1-061"
- type "application/json"
- title "MODIS Thermal Anomalies/Fire Daily"
66
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/hrea"
- type "application/json"
- title "HREA: High Resolution Electricity Access"
67
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-13Q1-061"
- type "application/json"
- title "MODIS Vegetation Indices 16-Day (250m)"
68
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-14A2-061"
- type "application/json"
- title "MODIS Thermal Anomalies/Fire 8-Day"
69
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a"
- type "application/json"
- title "Sentinel-2 Level-2A"
70
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-15A2H-061"
- type "application/json"
- title "MODIS Leaf Area Index/FPAR 8-Day"
71
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-11A1-061"
- type "application/json"
- title "MODIS Land Surface Temperature/Emissivity Daily"
72
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-15A3H-061"
- type "application/json"
- title "MODIS Leaf Area Index/FPAR 4-Day"
73
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-13A1-061"
- type "application/json"
- title "MODIS Vegetation Indices 16-Day (500m)"
74
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/daymet-daily-na"
- type "application/json"
- title "Daymet Daily North America"
75
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/nrcan-landcover"
- type "application/json"
- title "Land Cover of Canada"
76
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-10A2-061"
- type "application/json"
- title "MODIS Snow Cover 8-day"
77
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/ecmwf-forecast"
- type "application/json"
- title "ECMWF Open Data (real-time)"
78
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-mrms-qpe-24h-pass2"
- type "application/json"
- title "NOAA MRMS QPE 24-Hour Pass 2"
79
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-grd"
- type "application/json"
- title "Sentinel 1 Level-1 Ground Range Detected (GRD)"
80
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/nasadem"
- type "application/json"
- title "NASADEM HGT v001"
81
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/io-lulc"
- type "application/json"
- title "Esri 10-Meter Land Cover (10-class)"
82
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l1"
- type "application/json"
- title "Landsat Collection 2 Level-1"
83
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/drcog-lulc"
- type "application/json"
- title "Denver Regional Council of Governments Land Use Land Cover"
84
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/chesapeake-lc-7"
- type "application/json"
- title "Chesapeake Land Cover (7-class)"
85
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/chesapeake-lc-13"
- type "application/json"
- title "Chesapeake Land Cover (13-class)"
86
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/chesapeake-lu"
- type "application/json"
- title "Chesapeake Land Use"
87
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-mrms-qpe-1h-pass1"
- type "application/json"
- title "NOAA MRMS QPE 1-Hour Pass 1"
88
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-mrms-qpe-1h-pass2"
- type "application/json"
- title "NOAA MRMS QPE 1-Hour Pass 2"
89
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-nclimgrid-monthly"
- type "application/json"
- title "Monthly NOAA U.S. Climate Gridded Dataset (NClimGrid)"
90
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/goes-glm"
- type "application/json"
- title "GOES-R Lightning Detection"
91
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/usda-cdl"
- type "application/json"
- title "USDA Cropland Data Layers (CDLs)"
92
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/eclipse"
- type "application/json"
- title "Urban Innovation Eclipse Sensor Data"
93
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc"
- type "application/json"
- title "ESA Climate Change Initiative Land Cover Maps (Cloud Optimized GeoTIFF)"
94
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc-netcdf"
- type "application/json"
- title "ESA Climate Change Initiative Land Cover Maps (NetCDF)"
95
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/fws-nwi"
- type "application/json"
- title "FWS National Wetlands Inventory"
96
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/usgs-lcmap-conus-v13"
- type "application/json"
- title "USGS LCMAP CONUS Collection 1.3"
97
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/usgs-lcmap-hawaii-v10"
- type "application/json"
- title "USGS LCMAP Hawaii Collection 1.0"
98
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-climate-normals-tabular"
- type "application/json"
- title "NOAA US Tabular Climate Normals"
99
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-climate-normals-netcdf"
- type "application/json"
- title "NOAA US Gridded Climate Normals (NetCDF)"
100
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-climate-normals-gridded"
- type "application/json"
- title "NOAA US Gridded Climate Normals (Cloud-Optimized GeoTIFF)"
101
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/aster-l1t"
- type "application/json"
- title "ASTER L1T"
102
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/cil-gdpcir-cc-by-sa"
- type "application/json"
- title "CIL Global Downscaled Projections for Climate Impacts Research (CC-BY-SA-4.0)"
103
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/naip"
- type "application/json"
- title "NAIP: National Agriculture Imagery Program"
104
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/io-lulc-9-class"
- type "application/json"
- title "10m Annual Land Use Land Cover (9-class) V1"
105
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/io-biodiversity"
- type "application/json"
- title "Biodiversity Intactness"
106
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-cdr-sea-surface-temperature-whoi"
- type "application/json"
- title "Sea Surface Temperature - WHOI CDR"
107
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-cdr-ocean-heat-content"
- type "application/json"
- title "Global Ocean Heat Content CDR"
108
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/cil-gdpcir-cc0"
- type "application/json"
- title "CIL Global Downscaled Projections for Climate Impacts Research (CC0-1.0)"
109
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/cil-gdpcir-cc-by"
- type "application/json"
- title "CIL Global Downscaled Projections for Climate Impacts Research (CC-BY-4.0)"
110
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-cdr-sea-surface-temperature-whoi-netcdf"
- type "application/json"
- title "Sea Surface Temperature - WHOI CDR NetCDFs"
111
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-cdr-sea-surface-temperature-optimum-interpolation"
- type "application/json"
- title "Sea Surface Temperature - Optimum Interpolation CDR"
112
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/modis-10A1-061"
- type "application/json"
- title "MODIS Snow Cover Daily"
113
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-5p-l2-netcdf"
- type "application/json"
- title "Sentinel-5P Level-2"
114
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-olci-wfr-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Water (Full Resolution)"
115
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/noaa-cdr-ocean-heat-content-netcdf"
- type "application/json"
- title "Global Ocean Heat Content CDR NetCDFs"
116
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-synergy-aod-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Global Aerosol"
117
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-synergy-v10-l2-netcdf"
- type "application/json"
- title "Sentinel-3 10-Day Surface Reflectance and NDVI (SPOT VEGETATION)"
118
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-olci-lfr-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Land (Full Resolution)"
119
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-sral-lan-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Land Radar Altimetry"
120
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-slstr-lst-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Land Surface Temperature"
121
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-slstr-wst-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Sea Surface Temperature"
122
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-sral-wat-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Ocean Radar Altimetry"
123
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/ms-buildings"
- type "application/json"
- title "Microsoft Building Footprints"
124
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-slstr-frp-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Fire Radiative Power"
125
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-synergy-syn-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Land Surface Reflectance and Aerosol"
126
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-synergy-vgp-l2-netcdf"
- type "application/json"
- title "Sentinel-3 Top of Atmosphere Reflectance (SPOT VEGETATION)"
127
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-3-synergy-vg1-l2-netcdf"
- type "application/json"
- title "Sentinel-3 1-Day Surface Reflectance and NDVI (SPOT VEGETATION)"
128
- rel "child"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-worldcover"
- type "application/json"
- title "ESA WorldCover"
129
- rel "service-desc"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/openapi.json"
- type "application/vnd.oai.openapi+json;version=3.0"
- title "OpenAPI service description"
130
- rel "service-doc"
- href "https://planetarycomputer.microsoft.com/api/stac/v1/docs"
- type "text/html"
- title "OpenAPI service documentation"
conformsTo[] 15 items
- 0 "http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2"
- 1 "http://www.opengis.net/spec/cql2/1.0/conf/cql2-json"
- 2 "http://www.opengis.net/spec/cql2/1.0/conf/cql2-text"
- 3 "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core"
- 4 "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"
- 5 "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30"
- 6 "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter"
- 7 "https://api.stacspec.org/v1.0.0-rc.1/collections"
- 8 "https://api.stacspec.org/v1.0.0-rc.1/core"
- 9 "https://api.stacspec.org/v1.0.0-rc.1/item-search"
- 10 "https://api.stacspec.org/v1.0.0-rc.1/item-search#fields"
- 11 "https://api.stacspec.org/v1.0.0-rc.1/item-search#filter"
- 12 "https://api.stacspec.org/v1.0.0-rc.1/item-search#query"
- 13 "https://api.stacspec.org/v1.0.0-rc.1/item-search#sort"
- 14 "https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features"
- title "Microsoft Planetary Computer STAC API"
Search#
Perform a spatio-temporal search of ASTER data for a small AOI in the northern part of The Netherlands between 2000 and 2010.
[3]:
# AOI around Delfzijl, in northern Netherlands
geom = {
"type": "Polygon",
"coordinates": [
[
[
6.42425537109375,
53.174765470134616
],
[
7.344360351562499,
53.174765470134616
],
[
7.344360351562499,
53.67393435835391
],
[
6.42425537109375,
53.67393435835391
],
[
6.42425537109375,
53.174765470134616
]
]
]
}
# limit sets the # of items per page so we can see multiple pages getting fetched
search = cat.search(
max_items = 50,
collections = "aster-l1t",
intersects = geom,
datetime = "2000-01-01/2010-12-31",
)
# retrieve the items as dictionaries, rather than Item objects
items = list(search.items_as_dicts())
len(items)
DEBUG:pystac_client.stac_api_io:GET https://planetarycomputer.microsoft.com/api/stac/v1/ Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive'}
DEBUG:pystac_client.stac_api_io:POST https://planetarycomputer.microsoft.com/api/stac/v1/search Headers: {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '341', 'Content-Type': 'application/json'} Payload: {"datetime": "2000-01-01T00:00:00Z/2010-12-31T23:59:59Z", "collections": ["aster-l1t"], "intersects": {"type": "Polygon", "coordinates": [[[6.42425537109375, 53.174765470134616], [7.344360351562499, 53.174765470134616], [7.344360351562499, 53.67393435835391], [6.42425537109375, 53.67393435835391], [6.42425537109375, 53.174765470134616]]]}}
[3]:
50
GeoPandas#
A GeoDataFrame is constructed from the AOI geometry, in order to make visualizations easy.
The STAC Items, which are a GeoJSON FeatureCollection can be converted to a GeoDataFrame.
[4]:
from copy import deepcopy
import geopandas as gpd
import pandas as pd
from shapely.geometry import shape
# convert a list of STAC Items into a GeoDataFrame
def items_to_geodataframe(items):
_items = []
for i in items:
_i = deepcopy(i)
_i['geometry'] = shape(_i['geometry'])
_items.append(_i)
gdf = gpd.GeoDataFrame(pd.json_normalize(_items))
for field in ['properties.datetime', 'properties.created', 'properties.updated']:
if field in gdf:
gdf[field] = pd.to_datetime(gdf[field])
gdf.set_index('properties.datetime', inplace=True)
return gdf
[5]:
# convert geometry to a GeoDataFrame
aoi_gdf = gpd.GeoDataFrame([{'geometry': shape(geom)}])
aoi_gdf
[5]:
geometry | |
---|---|
0 | POLYGON ((6.42426 53.17477, 7.34436 53.17477, ... |
[6]:
# convert found items to a GeoDataFrame
items_gdf = items_to_geodataframe(items)
items_gdf.head()
[6]:
id | bbox | type | links | geometry | collection | stac_extensions | stac_version | assets.TIR.href | assets.TIR.type | ... | assets.vnir-browse.href | assets.vnir-browse.type | assets.vnir-browse.roles | assets.vnir-browse.title | assets.vnir-browse.description | assets.qa-txt.href | assets.qa-txt.type | assets.qa-txt.roles | assets.qa-txt.title | assets.qa-txt.description | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties.datetime | |||||||||||||||||||||
2006-12-14 21:25:39.910000+00:00 | AST_L1T_00312142006212539_20150517105406 | [5.8893619, 53.006463, 7.079664, 53.6760341] | Feature | [{'rel': 'collection', 'type': 'application/js... | POLYGON ((6.83853 53.67589, 6.84669 53.67603, ... | aster-l1t | [https://stac-extensions.github.io/eo/v1.0.0/s... | 1.0.0 | https://astersa.blob.core.windows.net/aster/im... | image/tiff; application=geotiff; profile=cloud... | ... | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2006-09-19 10:50:24.192000+00:00 | AST_L1T_00309192006105024_20150516061550 | [6.2313306, 52.613738, 7.4219194, 53.2988665] | Feature | [{'rel': 'collection', 'type': 'application/js... | POLYGON ((7.42138 53.15465, 7.42093 53.15377, ... | aster-l1t | [https://stac-extensions.github.io/eo/v1.0.0/s... | 1.0.0 | https://astersa.blob.core.windows.net/aster/im... | image/tiff; application=geotiff; profile=cloud... | ... | https://astersa.blob.core.windows.net/aster/im... | image/jpeg | [thumbnail] | VNIR browse file | Standalone reduced resolution VNIR | NaN | NaN | NaN | NaN | NaN |
2006-09-19 10:50:15.355000+00:00 | AST_L1T_00309192006105015_20150516061540 | [6.4862887, 53.1318137, 7.6929281, 53.8181412] | Feature | [{'rel': 'collection', 'type': 'application/js... | POLYGON ((7.69274 53.67237, 7.69231 53.67153, ... | aster-l1t | [https://stac-extensions.github.io/eo/v1.0.0/s... | 1.0.0 | https://astersa.blob.core.windows.net/aster/im... | image/tiff; application=geotiff; profile=cloud... | ... | https://astersa.blob.core.windows.net/aster/im... | image/jpeg | [thumbnail] | VNIR browse file | Standalone reduced resolution VNIR | https://astersa.blob.core.windows.net/aster/im... | text/plain | [metadata] | QA browse file | Geometric quality assessment report. |
2006-07-17 10:50:29.170000+00:00 | AST_L1T_00307172006105029_20150515082245 | [5.4068552, 53.3010121, 6.5997335, 53.9797445] | Feature | [{'rel': 'collection', 'type': 'application/js... | POLYGON ((6.09500 53.91815, 6.11773 53.91475, ... | aster-l1t | [https://stac-extensions.github.io/eo/v1.0.0/s... | 1.0.0 | https://astersa.blob.core.windows.net/aster/im... | image/tiff; application=geotiff; profile=cloud... | ... | https://astersa.blob.core.windows.net/aster/im... | image/jpeg | [thumbnail] | VNIR browse file | Standalone reduced resolution VNIR | https://astersa.blob.core.windows.net/aster/im... | text/plain | [metadata] | QA browse file | Geometric quality assessment report. |
2006-07-03 10:38:13.100000+00:00 | AST_L1T_00307032006103813_20150515031748 | [7.2238549, 52.9288706, 8.4058086, 53.6021029] | Feature | [{'rel': 'collection', 'type': 'application/js... | POLYGON ((8.37763 53.47724, 8.40581 53.47338, ... | aster-l1t | [https://stac-extensions.github.io/eo/v1.0.0/s... | 1.0.0 | https://astersa.blob.core.windows.net/aster/im... | image/tiff; application=geotiff; profile=cloud... | ... | https://astersa.blob.core.windows.net/aster/im... | image/jpeg | [thumbnail] | VNIR browse file | Standalone reduced resolution VNIR | https://astersa.blob.core.windows.net/aster/im... | text/plain | [metadata] | QA browse file | Geometric quality assessment report. |
5 rows × 76 columns
Plot Geometries on a Map#
Holoviews is used to display geometries on a map by using hvplot
. The The *
Holoviews operator to overlay two plots
[7]:
import hvplot.pandas
# plot polygons on a map with background tiles.
def plot_polygons(data, *args, **kwargs):
return data.hvplot.polygons(*args, geo=True, projection="GOOGLE_MERCATOR", xaxis=None, yaxis=None,
frame_width=600, frame_height=600, fill_alpha=0,
line_width=4, **kwargs)
[8]:
plot_polygons(aoi_gdf, tiles="OSM", line_color="red")
[8]:
[9]:
plot_polygons(items_gdf, tiles="OSM")
[9]:
[10]:
plot_polygons(items_gdf, tiles="OSM") * plot_polygons(aoi_gdf, line_color="red")
[10]:
Line Plots#
Numeric STAC metadata can also be plotted, most often this will be plotted vs the Item datetime
.
[11]:
items_df = pd.DataFrame(items_gdf)
plot_fields = [
'properties.eo:cloud_cover',
'properties.view:sun_azimuth',
'properties.view:sun_elevation'
]
items_df[plot_fields].hvplot(height=500, width=800).opts(legend_position="top_right")
[11]: