The ESA Climate Change Initiative (CCI) Land Cover dataset provides consistent global annual land cover maps at 300m spatial resolution from 1992 to 2020. The land cover classes are defined using the United Nations Food and Agriculture Organization's (UN FAO) Land Cover Classification System (LCCS). In addition to the land cover maps, four quality flags are produced to document the reliability of the classification and change detection.
The data in this Collection have been converted from the original NetCDF format to a set of tiled Cloud Optimized GeoTIFFs (COGs.
Documentation for this dataset is available at the Planetary Computer Data Catalog.
This notebook works with or without an API key, but you will be given more permissive access to the data with an API key. The Planetary Computer Hub sets the environment variable "PC_SDK_SUBSCRIPTION_KEY" when your server is started. The API key may be manually set via the following code:
pc.settings.set_subscription_key(<YOUR API Key>)
The datasets hosted by the Planetary Computer are available in Azure Blob Storage. We'll use pystac-client to search the Planetary Computer's STAC API for the subset of the data that we care about, and then we'll load the data directly from Azure Blob Storage. We'll specify a modifier
so that we can access the data stored in the Planetary Computer's private Blob Storage Containers. See Reading from the STAC API and Using tokens for data access for more.
import planetary_computer
import pystac_client
# Open the Planetary Computer STAC API
catalog = pystac_client.Client.open(
"https://planetarycomputer.microsoft.com/api/stac/v1/",
modifier=planetary_computer.sign_inplace,
)
collection = catalog.get_collection("esa-cci-lc")
collection
ID: esa-cci-lc |
Title: ESA Climate Change Initiative Land Cover Maps (Cloud Optimized GeoTIFF) |
Description: The ESA Climate Change Initiative (CCI) [Land Cover dataset](https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover?tab=overview) provides consistent global annual land cover maps at 300m spatial resolution from 1992 to 2020. The land cover classes are defined using the United Nations Food and Agriculture Organization's (UN FAO) [Land Cover Classification System](https://www.fao.org/land-water/land/land-governance/land-resources-planning-toolbox/category/details/en/c/1036361/) (LCCS). In addition to the land cover maps, four quality flags are produced to document the reliability of the classification and change detection. The data in this Collection have been converted from the [original NetCDF data](https://planetarycomputer.microsoft.com/dataset/esa-cci-lc-netcdf) to a set of tiled [Cloud Optimized GeoTIFFs](https://www.cogeo.org/) (COGs). |
Providers:
|
type: Collection |
title: ESA Climate Change Initiative Land Cover Maps (Cloud Optimized GeoTIFF) |
assets: {'thumbnail': {'href': 'https://ai4edatasetspublicassets.blob.core.windows.net/assets/pc_thumbnails/esa-cci-lc-thumb.png', 'type': 'image/png', 'roles': ['thumbnail'], 'title': 'ESA CCI Land Cover COGs Thumbnail'}, 'geoparquet-items': {'href': 'abfs://items/esa-cci-lc.parquet', 'type': 'application/x-parquet', 'roles': ['stac-items'], 'title': 'GeoParquet STAC items', 'description': "Snapshot of the collection's STAC items exported to GeoParquet format.", 'msft:partition_info': {'is_partitioned': False}, 'table:storage_options': {'account_name': 'pcstacitems', 'credential': 'st=2023-01-16T19%3A57%3A45Z&se=2023-01-24T19%3A57%3A45Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A44Z&ske=2023-01-24T19%3A57%3A44Z&sks=b&skv=2021-06-08&sig=96VdHIskIBKFrcuMKv4n8zuZp829zbpuO03f6I1RKBo%3D'}}} |
sci:doi: 10.24381/cds.006f2c9a |
keywords: ['Land Cover', 'ESA', 'CCI', 'Global'] |
providers: [{'url': 'https://vito.be', 'name': 'VITO', 'roles': ['licensor'], 'description': 'Provides the PROBA-V source data (for v2.0).'}, {'url': 'https://uclouvain.be', 'name': 'UCLouvain', 'roles': ['producer'], 'description': 'UCLouvain produces the dataset (v2.1) for the ESA Climate Change Initiative.'}, {'url': 'https://brockmann-consult.de', 'name': 'Brockmann Consult', 'roles': ['processor'], 'description': 'Brockmann Consult is responsible for the required pre-processing and the distribution of the dataset (v2.1).'}, {'url': 'http://esa-landcover-cci.org', 'name': 'ESA Climate Change Initiative', 'roles': ['licensor'], 'description': 'The ESA Climate Change Initiative (CCI) is leading the product creation.'}, {'url': 'https://copernicus.eu', 'name': 'Copernicus', 'roles': ['licensor'], 'description': 'Hosts the data on the Copernicus Climate Data Store (CDS).'}, {'url': 'https://planetarycomputer.microsoft.com', 'name': 'Microsoft', 'roles': ['processor', 'host']}] |
summaries: {'esa_cci_lc:version': ['2.0.7cds', '2.1.1']} |
item_assets: {'lccs_class': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['data'], 'title': 'Land Cover Class Defined in the Land Cover Classification System', 'description': 'Land cover class per pixel, defined using the Land Cover Classification System developed by the United Nations Food and Agriculture Organization.', 'raster:bands': [{'nodata': 0, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}], 'classification:classes': [{'name': 'no-data', 'value': 0, 'no_data': True, 'color_hint': '000000', 'description': 'No data'}, {'name': 'cropland-1', 'value': 10, 'color_hint': 'FFFF64', 'description': 'Cropland, rainfed'}, {'name': 'cropland-1a', 'value': 11, 'regional': True, 'color_hint': 'FFFF64', 'description': 'Cropland, rainfed, herbaceous cover'}, {'name': 'cropland-1b', 'value': 12, 'regional': True, 'color_hint': 'FFFF00', 'description': 'Cropland, rainfed, tree, or shrub cover'}, {'name': 'cropland-2', 'value': 20, 'color_hint': 'AAF0F0', 'description': 'Cropland, irrigated or post-flooding'}, {'name': 'cropland-3', 'value': 30, 'color_hint': 'DCF064', 'description': 'Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%)'}, {'name': 'natural-veg', 'value': 40, 'color_hint': 'C8C864', 'description': 'Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%)'}, {'name': 'tree-1', 'value': 50, 'color_hint': '006400', 'description': 'Tree cover, broadleaved, evergreen, closed to open (>15%)'}, {'name': 'tree-2', 'value': 60, 'color_hint': '00A000', 'description': 'Tree cover, broadleaved, deciduous, closed to open (>15%)'}, {'name': 'tree-2a', 'value': 61, 'regional': True, 'color_hint': '00A000', 'description': 'Tree cover, broadleaved, deciduous, closed (>40%)'}, {'name': 'tree-2b', 'value': 62, 'regional': True, 'color_hint': 'AAC800', 'description': 'Tree cover, broadleaved, deciduous, open (15-40%)'}, {'name': 'tree-3', 'value': 70, 'color_hint': '003C00', 'description': 'Tree cover, needleleaved, evergreen, closed to open (>15%)'}, {'name': 'tree-3a', 'value': 71, 'regional': True, 'color_hint': '003C00', 'description': 'Tree cover, needleleaved, evergreen, closed (>40%)'}, {'name': 'tree-3b', 'value': 72, 'regional': True, 'color_hint': '005000', 'description': 'Tree cover, needleleaved, evergreen, open (15-40%)'}, {'name': 'tree-4', 'value': 80, 'color_hint': '285000', 'description': 'Tree cover, needleleaved, deciduous, closed to open (>15%)'}, {'name': 'tree-4a', 'value': 81, 'regional': True, 'color_hint': '285000', 'description': 'Tree cover, needleleaved, deciduous, closed (>40%)'}, {'name': 'tree-4b', 'value': 82, 'regional': True, 'color_hint': '286400', 'description': 'Tree cover, needleleaved, deciduous, open (15-40%)'}, {'name': 'tree-5', 'value': 90, 'color_hint': '788200', 'description': 'Tree cover, mixed leaf type (broadleaved and needleleaved)'}, {'name': 'tree-shrub', 'value': 100, 'color_hint': '8CA000', 'description': 'Mosaic tree and shrub (>50%) / herbaceous cover (<50%)'}, {'name': 'herbaceous', 'value': 110, 'color_hint': 'BE9600', 'description': 'Mosaic herbaceous cover (>50%) / tree and shrub (<50%)'}, {'name': 'shrubland', 'value': 120, 'color_hint': '966400', 'description': 'Shrubland'}, {'name': 'shrubland-a', 'value': 121, 'regional': True, 'color_hint': '966400', 'description': 'Evergreen shrubland'}, {'name': 'shrubland-b', 'value': 122, 'regional': True, 'color_hint': '966400', 'description': 'Deciduous shrubland'}, {'name': 'grassland', 'value': 130, 'color_hint': 'FFB432', 'description': 'Grassland'}, {'name': 'lichens-moses', 'value': 140, 'color_hint': 'FFDCD2', 'description': 'Lichens and mosses'}, {'name': 'sparse-veg', 'value': 150, 'color_hint': 'FFEBAF', 'description': 'Sparse vegetation (tree, shrub, herbaceous cover) (<15%)'}, {'name': 'sparse-veg-a', 'value': 151, 'regional': True, 'color_hint': 'FFC864', 'description': 'Sparse tree (<15%)'}, {'name': 'sparse-veg-b', 'value': 152, 'regional': True, 'color_hint': 'FFD278', 'description': 'Sparse shrub (<15%)'}, {'name': 'sparse-veg-c', 'value': 153, 'regional': True, 'color_hint': 'FFEBAF', 'description': 'Sparse herbaceous cover (<15%)'}, {'name': 'flooded-tree-1', 'value': 160, 'color_hint': '00785A', 'description': 'Tree cover, flooded, fresh or brackish water'}, {'name': 'flooded-tree-2', 'value': 170, 'color_hint': '009678', 'description': 'Tree cover, flooded, saline water'}, {'name': 'flooded-shrub-herbaceous', 'value': 180, 'color_hint': '00DC82', 'description': 'Shrub or herbaceous cover, flooded, fresh/saline/brackish water'}, {'name': 'urban', 'value': 190, 'color_hint': 'C31400', 'description': 'Urban areas'}, {'name': 'bare', 'value': 200, 'color_hint': 'FFF5D7', 'description': 'Bare areas'}, {'name': 'bare-a', 'value': 201, 'regional': True, 'color_hint': 'DCDCDC', 'description': 'Consolidated bare areas'}, {'name': 'bare-b', 'value': 202, 'regional': True, 'color_hint': 'FFF5D7', 'description': 'Unconsolidated bare areas'}, {'name': 'water', 'value': 210, 'color_hint': '0046C8', 'description': 'Water bodies'}, {'name': 'snow-ice', 'value': 220, 'color_hint': 'FFFFFF', 'description': 'Permanent snow and ice'}]}, 'change_count': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['quality'], 'title': 'Number of Class Changes', 'description': 'Number of years where land cover class changes have occurred, since 1992. 0 for stable, greater than 0 for changes.', 'raster:bands': [{'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}]}, 'processed_flag': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['quality'], 'title': 'Land Cover Map Processed Area Flag', 'description': 'Flag to mark areas that could not be classified.', 'raster:bands': [{'nodata': 255, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}], 'classification:classes': [{'name': 'not_processed', 'value': 0, 'description': 'Not processed'}, {'name': 'processed', 'value': 1, 'description': 'Processed'}]}, 'observation_count': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['quality'], 'title': 'Number of Valid Observations', 'description': "Number of valid satellite observations that have contributed to each pixel's classification.", 'raster:bands': [{'sampling': 'area', 'data_type': 'uint16', 'spatial_resolution': 300}]}, 'current_pixel_state': {'type': 'image/tiff; application=geotiff; profile=cloud-optimized', 'roles': ['quality'], 'title': 'Land Cover Pixel Type Mask', 'description': 'Pixel identification from satellite surface reflectance observations, mainly distinguishing between land, water, and snow/ice.', 'raster:bands': [{'nodata': 255, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}], 'classification:classes': [{'name': 'land', 'value': 1, 'description': 'Clear land'}, {'name': 'water', 'value': 2, 'description': 'Clear water'}, {'name': 'snow', 'value': 3, 'description': 'Clear snow / ice'}, {'name': 'cloud', 'value': 4, 'description': 'Cloud'}, {'name': 'cloud_shadow', 'value': 5, 'description': 'Cloud shadow'}, {'name': 'filled', 'value': 6, 'description': 'Filled'}]}} |
msft:group_id: esa-cci-lc |
msft:container: esa-cci-lc |
stac_extensions: ['https://stac-extensions.github.io/classification/v1.1.0/schema.json', 'https://stac-extensions.github.io/projection/v1.0.0/schema.json', 'https://stac-extensions.github.io/raster/v1.1.0/schema.json', 'https://stac-extensions.github.io/scientific/v1.0.0/schema.json', 'https://stac-extensions.github.io/item-assets/v1.0.0/schema.json'] |
msft:storage_account: landcoverdata |
msft:short_description: Tiled ESA CCI global land cover maps in COG format |
ID: C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180 |
Bounding Box: [-180.0, -90.00000000000003, -135.0, -45.000000000000014] |
title: ESA CCI Land Cover Map for Year 2020, Tile S90W180 |
created: 2023-01-11T23:08:36.109666Z |
datetime: None |
proj:epsg: 4326 |
proj:shape: [16200, 16200] |
end_datetime: 2020-12-31T23:59:59Z |
proj:transform: [0.002777777777777778, 0.0, -180.0, 0.0, -0.0027777777777777783, -45.000000000000014] |
start_datetime: 2020-01-01T00:00:00Z |
esa_cci_lc:tile: S90W180 |
esa_cci_lc:version: v2.1.1 |
stac_extensions: ['https://stac-extensions.github.io/projection/v1.0.0/schema.json', 'https://stac-extensions.github.io/classification/v1.1.0/schema.json', 'https://stac-extensions.github.io/raster/v1.1.0/schema.json'] |
https://stac-extensions.github.io/projection/v1.0.0/schema.json |
https://stac-extensions.github.io/classification/v1.1.0/schema.json |
https://stac-extensions.github.io/raster/v1.1.0/schema.json |
href: https://landcoverdata.blob.core.windows.net/esa-cci-lc/cog/v2.1.1/S90W180/2020/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180-lccs_class.tif?st=2023-01-16T19%3A57%3A46Z&se=2023-01-24T19%3A57%3A46Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A45Z&ske=2023-01-24T19%3A57%3A45Z&sks=b&skv=2021-06-08&sig=YAbi5WVAjD83gcrIxl4pPmVV9kuLnhL6G1GvSkUe/24%3D |
Title: Land Cover Class Defined in the Land Cover Classification System |
Description: Land cover class per pixel, defined using the Land Cover Classification System developed by the United Nations Food and Agriculture Organization. |
Media type: image/tiff; application=geotiff; profile=cloud-optimized |
Roles: ['data'] |
Owner: |
raster:bands: [{'nodata': 0, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}] |
classification:classes: [{'name': 'no-data', 'value': 0, 'no_data': True, 'color_hint': '000000', 'description': 'No data'}, {'name': 'cropland-1', 'value': 10, 'color_hint': 'FFFF64', 'description': 'Cropland, rainfed'}, {'name': 'cropland-1a', 'value': 11, 'regional': True, 'color_hint': 'FFFF64', 'description': 'Cropland, rainfed, herbaceous cover'}, {'name': 'cropland-1b', 'value': 12, 'regional': True, 'color_hint': 'FFFF00', 'description': 'Cropland, rainfed, tree, or shrub cover'}, {'name': 'cropland-2', 'value': 20, 'color_hint': 'AAF0F0', 'description': 'Cropland, irrigated or post-flooding'}, {'name': 'cropland-3', 'value': 30, 'color_hint': 'DCF064', 'description': 'Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%)'}, {'name': 'natural-veg', 'value': 40, 'color_hint': 'C8C864', 'description': 'Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%)'}, {'name': 'tree-1', 'value': 50, 'color_hint': '006400', 'description': 'Tree cover, broadleaved, evergreen, closed to open (>15%)'}, {'name': 'tree-2', 'value': 60, 'color_hint': '00A000', 'description': 'Tree cover, broadleaved, deciduous, closed to open (>15%)'}, {'name': 'tree-2a', 'value': 61, 'regional': True, 'color_hint': '00A000', 'description': 'Tree cover, broadleaved, deciduous, closed (>40%)'}, {'name': 'tree-2b', 'value': 62, 'regional': True, 'color_hint': 'AAC800', 'description': 'Tree cover, broadleaved, deciduous, open (15-40%)'}, {'name': 'tree-3', 'value': 70, 'color_hint': '003C00', 'description': 'Tree cover, needleleaved, evergreen, closed to open (>15%)'}, {'name': 'tree-3a', 'value': 71, 'regional': True, 'color_hint': '003C00', 'description': 'Tree cover, needleleaved, evergreen, closed (>40%)'}, {'name': 'tree-3b', 'value': 72, 'regional': True, 'color_hint': '005000', 'description': 'Tree cover, needleleaved, evergreen, open (15-40%)'}, {'name': 'tree-4', 'value': 80, 'color_hint': '285000', 'description': 'Tree cover, needleleaved, deciduous, closed to open (>15%)'}, {'name': 'tree-4a', 'value': 81, 'regional': True, 'color_hint': '285000', 'description': 'Tree cover, needleleaved, deciduous, closed (>40%)'}, {'name': 'tree-4b', 'value': 82, 'regional': True, 'color_hint': '286400', 'description': 'Tree cover, needleleaved, deciduous, open (15-40%)'}, {'name': 'tree-5', 'value': 90, 'color_hint': '788200', 'description': 'Tree cover, mixed leaf type (broadleaved and needleleaved)'}, {'name': 'tree-shrub', 'value': 100, 'color_hint': '8CA000', 'description': 'Mosaic tree and shrub (>50%) / herbaceous cover (<50%)'}, {'name': 'herbaceous', 'value': 110, 'color_hint': 'BE9600', 'description': 'Mosaic herbaceous cover (>50%) / tree and shrub (<50%)'}, {'name': 'shrubland', 'value': 120, 'color_hint': '966400', 'description': 'Shrubland'}, {'name': 'shrubland-a', 'value': 121, 'regional': True, 'color_hint': '966400', 'description': 'Evergreen shrubland'}, {'name': 'shrubland-b', 'value': 122, 'regional': True, 'color_hint': '966400', 'description': 'Deciduous shrubland'}, {'name': 'grassland', 'value': 130, 'color_hint': 'FFB432', 'description': 'Grassland'}, {'name': 'lichens-moses', 'value': 140, 'color_hint': 'FFDCD2', 'description': 'Lichens and mosses'}, {'name': 'sparse-veg', 'value': 150, 'color_hint': 'FFEBAF', 'description': 'Sparse vegetation (tree, shrub, herbaceous cover) (<15%)'}, {'name': 'sparse-veg-a', 'value': 151, 'regional': True, 'color_hint': 'FFC864', 'description': 'Sparse tree (<15%)'}, {'name': 'sparse-veg-b', 'value': 152, 'regional': True, 'color_hint': 'FFD278', 'description': 'Sparse shrub (<15%)'}, {'name': 'sparse-veg-c', 'value': 153, 'regional': True, 'color_hint': 'FFEBAF', 'description': 'Sparse herbaceous cover (<15%)'}, {'name': 'flooded-tree-1', 'value': 160, 'color_hint': '00785A', 'description': 'Tree cover, flooded, fresh or brackish water'}, {'name': 'flooded-tree-2', 'value': 170, 'color_hint': '009678', 'description': 'Tree cover, flooded, saline water'}, {'name': 'flooded-shrub-herbaceous', 'value': 180, 'color_hint': '00DC82', 'description': 'Shrub or herbaceous cover, flooded, fresh/saline/brackish water'}, {'name': 'urban', 'value': 190, 'color_hint': 'C31400', 'description': 'Urban areas'}, {'name': 'bare', 'value': 200, 'color_hint': 'FFF5D7', 'description': 'Bare areas'}, {'name': 'bare-a', 'value': 201, 'regional': True, 'color_hint': 'DCDCDC', 'description': 'Consolidated bare areas'}, {'name': 'bare-b', 'value': 202, 'regional': True, 'color_hint': 'FFF5D7', 'description': 'Unconsolidated bare areas'}, {'name': 'water', 'value': 210, 'color_hint': '0046C8', 'description': 'Water bodies'}, {'name': 'snow-ice', 'value': 220, 'color_hint': 'FFFFFF', 'description': 'Permanent snow and ice'}] |
href: https://landcoverdata.blob.core.windows.net/esa-cci-lc/cog/v2.1.1/S90W180/2020/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180-change_count.tif?st=2023-01-16T19%3A57%3A46Z&se=2023-01-24T19%3A57%3A46Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A45Z&ske=2023-01-24T19%3A57%3A45Z&sks=b&skv=2021-06-08&sig=YAbi5WVAjD83gcrIxl4pPmVV9kuLnhL6G1GvSkUe/24%3D |
Title: Number of Class Changes |
Description: Number of years where land cover class changes have occurred, since 1992. 0 for stable, greater than 0 for changes. |
Media type: image/tiff; application=geotiff; profile=cloud-optimized |
Roles: ['quality'] |
Owner: |
raster:bands: [{'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}] |
href: https://landcoverdata.blob.core.windows.net/esa-cci-lc/cog/v2.1.1/S90W180/2020/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180-processed_flag.tif?st=2023-01-16T19%3A57%3A46Z&se=2023-01-24T19%3A57%3A46Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A45Z&ske=2023-01-24T19%3A57%3A45Z&sks=b&skv=2021-06-08&sig=YAbi5WVAjD83gcrIxl4pPmVV9kuLnhL6G1GvSkUe/24%3D |
Title: Land Cover Map Processed Area Flag |
Description: Flag to mark areas that could not be classified. |
Media type: image/tiff; application=geotiff; profile=cloud-optimized |
Roles: ['quality'] |
Owner: |
raster:bands: [{'nodata': 255, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}] |
classification:classes: [{'name': 'not_processed', 'value': 0, 'description': 'Not processed'}, {'name': 'processed', 'value': 1, 'description': 'Processed'}] |
href: https://landcoverdata.blob.core.windows.net/esa-cci-lc/cog/v2.1.1/S90W180/2020/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180-observation_count.tif?st=2023-01-16T19%3A57%3A46Z&se=2023-01-24T19%3A57%3A46Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A45Z&ske=2023-01-24T19%3A57%3A45Z&sks=b&skv=2021-06-08&sig=YAbi5WVAjD83gcrIxl4pPmVV9kuLnhL6G1GvSkUe/24%3D |
Title: Number of Valid Observations |
Description: Number of valid satellite observations that have contributed to each pixel's classification. |
Media type: image/tiff; application=geotiff; profile=cloud-optimized |
Roles: ['quality'] |
Owner: |
raster:bands: [{'sampling': 'area', 'data_type': 'uint16', 'spatial_resolution': 300}] |
href: https://landcoverdata.blob.core.windows.net/esa-cci-lc/cog/v2.1.1/S90W180/2020/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180-current_pixel_state.tif?st=2023-01-16T19%3A57%3A46Z&se=2023-01-24T19%3A57%3A46Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A45Z&ske=2023-01-24T19%3A57%3A45Z&sks=b&skv=2021-06-08&sig=YAbi5WVAjD83gcrIxl4pPmVV9kuLnhL6G1GvSkUe/24%3D |
Title: Land Cover Pixel Type Mask |
Description: Pixel identification from satellite surface reflectance observations, mainly distinguishing between land, water, and snow/ice. |
Media type: image/tiff; application=geotiff; profile=cloud-optimized |
Roles: ['quality'] |
Owner: |
raster:bands: [{'nodata': 255, 'sampling': 'area', 'data_type': 'uint8', 'spatial_resolution': 300}] |
classification:classes: [{'name': 'land', 'value': 1, 'description': 'Clear land'}, {'name': 'water', 'value': 2, 'description': 'Clear water'}, {'name': 'snow', 'value': 3, 'description': 'Clear snow / ice'}, {'name': 'cloud', 'value': 4, 'description': 'Cloud'}, {'name': 'cloud_shadow', 'value': 5, 'description': 'Cloud shadow'}, {'name': 'filled', 'value': 6, 'description': 'Filled'}] |
href: https://planetarycomputer.microsoft.com/api/data/v1/item/tilejson.json?collection=esa-cci-lc&item=C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180&assets=lccs_class&tile_format=png&colormap_name=esa-cci-lc&format=png |
Title: TileJSON with default rendering |
Media type: application/json |
Roles: ['tiles'] |
Owner: |
href: https://planetarycomputer.microsoft.com/api/data/v1/item/preview.png?collection=esa-cci-lc&item=C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180&assets=lccs_class&tile_format=png&colormap_name=esa-cci-lc&format=png |
Title: Rendered preview |
Media type: image/png |
Roles: ['overview'] |
Owner: |
rel: preview |
Rel: collection |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc |
Media Type: application/json |
Rel: parent |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc |
Media Type: application/json |
Rel: root |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/ |
Media Type: application/json |
Rel: self |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc/items/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180 |
Media Type: application/geo+json |
Source NetCDF Item
Rel: derived_from |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc-netcdf/items/C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1 |
Media Type: application/json |
Map of item
Rel: preview |
Target: https://planetarycomputer.microsoft.com/api/data/v1/item/map?collection=esa-cci-lc&item=C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180 |
Media Type: text/html |
Rel: items |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc/items |
Media Type: application/geo+json |
Rel: parent |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/ |
Media Type: application/json |
Microsoft Planetary Computer STAC API
Rel: root |
Target: |
Media Type: application/json |
Rel: self |
Target: https://planetarycomputer.microsoft.com/api/stac/v1/collections/esa-cci-lc |
Media Type: application/json |
ESA CCI license
Rel: license |
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/satellite-land-cover.pdf |
Media Type: text/html |
COPERNICUS license
Rel: license |
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/licence-to-use-copernicus-products.pdf |
Media Type: text/html |
VITO License
Rel: license |
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/vito-proba-v.pdf |
Media Type: text/html |
Product Landing Page
Rel: about |
Target: https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover |
Media Type: text/html |
Product user guide for version 2.1
Rel: about |
Target: https://datastore.copernicus-climate.eu/documents/satellite-land-cover/D5.3.1_PUGS_ICDR_LC_v2.1.x_PRODUCTS_v1.1.pdf |
Media Type: application/pdf |
Product user guide for version 2.0
Rel: about |
Target: https://datastore.copernicus-climate.eu/documents/satellite-land-cover/D3.3.11-v1.0_PUGS_CDR_LC-CCI_v2.0.7cds_Products_v1.0.1_APPROVED_Ver1.pdf |
Media Type: application/pdf |
Rel: cite-as |
Target: https://doi.org/10.24381/cds.006f2c9a |
Human readable dataset overview and reference
Rel: describedby |
Target: https://planetarycomputer.microsoft.com/dataset/esa-cci-lc |
Media Type: text/html |
href: https://ai4edatasetspublicassets.blob.core.windows.net/assets/pc_thumbnails/esa-cci-lc-thumb.png |
Title: ESA CCI Land Cover COGs Thumbnail |
Media type: image/png |
Roles: ['thumbnail'] |
Owner: |
href: abfs://items/esa-cci-lc.parquet |
Title: GeoParquet STAC items |
Description: Snapshot of the collection's STAC items exported to GeoParquet format. |
Media type: application/x-parquet |
Roles: ['stac-items'] |
Owner: |
msft:partition_info: {'is_partitioned': False} |
table:storage_options: {'account_name': 'pcstacitems', 'credential': 'st=2023-01-16T19%3A57%3A45Z&se=2023-01-24T19%3A57%3A45Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-17T19%3A57%3A44Z&ske=2023-01-24T19%3A57%3A44Z&sks=b&skv=2021-06-08&sig=96VdHIskIBKFrcuMKv4n8zuZp829zbpuO03f6I1RKBo%3D'} |
# Search the catalog and collection for desired items
latitude = 39.50
longitude = -98.35
Location = [longitude, latitude]
geometry = {
"type": "Point",
"coordinates": Location,
}
search = catalog.search(collections=collection, intersects=geometry, datetime="2017")
items = list(search.items())
items
[<Item id=C3S-LC-L4-LCCS-Map-300m-P1Y-2017-v2.1.1-N00W135>]
Each item contains a rendered_preview
asset that we can use to quickly visualize the data using the Planetary Computer's data
API.
from IPython.display import Image
Image(url=items[0].assets["rendered_preview"].href)
Let's display the available assets and metadata.
import rich.table
# Assets
t_assets = rich.table.Table("Key", "Value")
for key, asset in items[0].assets.items():
t_assets.add_row(key, asset.title)
t_assets
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Key ┃ Value ┃ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ lccs_class │ Land Cover Class Defined in the Land Cover Classification System │ │ change_count │ Number of Class Changes │ │ processed_flag │ Land Cover Map Processed Area Flag │ │ observation_count │ Number of Valid Observations │ │ current_pixel_state │ Land Cover Pixel Type Mask │ │ tilejson │ TileJSON with default rendering │ │ rendered_preview │ Rendered preview │ └─────────────────────┴──────────────────────────────────────────────────────────────────┘
# Metadata
t_metadata = rich.table.Table("Key", "Value")
for k, v in sorted(items[0].properties.items()):
t_metadata.add_row(k, str(v))
t_metadata
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Key ┃ Value ┃ ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ created │ 2023-01-11T20:59:49.119291Z │ │ datetime │ None │ │ end_datetime │ 2017-12-31T23:59:59Z │ │ esa_cci_lc:tile │ N00W135 │ │ esa_cci_lc:version │ v2.1.1 │ │ proj:epsg │ 4326 │ │ proj:shape │ [16200, 16200] │ │ proj:transform │ [0.002777777777777778, 0.0, -135.0, 0.0, -0.0027777777777777783, 45.00000000000001] │ │ start_datetime │ 2017-01-01T00:00:00Z │ │ title │ ESA CCI Land Cover Map for Year 2017, Tile N00W135 │ └────────────────────┴─────────────────────────────────────────────────────────────────────────────────────┘
import odc.stac
latitude = 39.50
longitude = -98.35
buffer = 5
bbox = [longitude - buffer, latitude - buffer, longitude + buffer, latitude + buffer]
ds = odc.stac.load(items, bbox=bbox)
ds
<xarray.Dataset> Dimensions: (latitude: 3600, longitude: 3600, time: 1) Coordinates: * latitude (latitude) float64 44.5 44.5 44.49 ... 34.51 34.5 34.5 * longitude (longitude) float64 -103.3 -103.3 ... -93.35 -93.35 spatial_ref int32 4326 * time (time) datetime64[ns] 2017-01-01 Data variables: lccs_class (time, latitude, longitude) uint8 130 130 130 ... 60 90 change_count (time, latitude, longitude) uint8 0 0 0 0 0 ... 0 0 0 0 processed_flag (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1 observation_count (time, latitude, longitude) uint16 267 263 ... 234 238 current_pixel_state (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1
This dataset includes a preferred colormap mapping raster values to colors. The Collection's item_assets
field includes an overview of the class descriptions and values.
from pystac.extensions.item_assets import ItemAssetsExtension
ia = ItemAssetsExtension.ext(collection)
x = ia.item_assets["lccs_class"]
class_names = {
x["description"]: x["value"] for x in x.properties["classification:classes"]
}
class_values = {v: k for k, v in class_names.items()}
t = rich.table.Table("Description", "Value")
for k, v in class_names.items():
t.add_row(k, str(v))
t
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┓ ┃ Description ┃ Value ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━┩ │ No data │ 0 │ │ Cropland, rainfed │ 10 │ │ Cropland, rainfed, herbaceous cover │ 11 │ │ Cropland, rainfed, tree, or shrub cover │ 12 │ │ Cropland, irrigated or post-flooding │ 20 │ │ Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%) │ 30 │ │ Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%) │ 40 │ │ Tree cover, broadleaved, evergreen, closed to open (>15%) │ 50 │ │ Tree cover, broadleaved, deciduous, closed to open (>15%) │ 60 │ │ Tree cover, broadleaved, deciduous, closed (>40%) │ 61 │ │ Tree cover, broadleaved, deciduous, open (15-40%) │ 62 │ │ Tree cover, needleleaved, evergreen, closed to open (>15%) │ 70 │ │ Tree cover, needleleaved, evergreen, closed (>40%) │ 71 │ │ Tree cover, needleleaved, evergreen, open (15-40%) │ 72 │ │ Tree cover, needleleaved, deciduous, closed to open (>15%) │ 80 │ │ Tree cover, needleleaved, deciduous, closed (>40%) │ 81 │ │ Tree cover, needleleaved, deciduous, open (15-40%) │ 82 │ │ Tree cover, mixed leaf type (broadleaved and needleleaved) │ 90 │ │ Mosaic tree and shrub (>50%) / herbaceous cover (<50%) │ 100 │ │ Mosaic herbaceous cover (>50%) / tree and shrub (<50%) │ 110 │ │ Shrubland │ 120 │ │ Evergreen shrubland │ 121 │ │ Deciduous shrubland │ 122 │ │ Grassland │ 130 │ │ Lichens and mosses │ 140 │ │ Sparse vegetation (tree, shrub, herbaceous cover) (<15%) │ 150 │ │ Sparse tree (<15%) │ 151 │ │ Sparse shrub (<15%) │ 152 │ │ Sparse herbaceous cover (<15%) │ 153 │ │ Tree cover, flooded, fresh or brackish water │ 160 │ │ Tree cover, flooded, saline water │ 170 │ │ Shrub or herbaceous cover, flooded, fresh/saline/brackish water │ 180 │ │ Urban areas │ 190 │ │ Bare areas │ 200 │ │ Consolidated bare areas │ 201 │ │ Unconsolidated bare areas │ 202 │ │ Water bodies │ 210 │ │ Permanent snow and ice │ 220 │ └────────────────────────────────────────────────────────────────────────────────────┴───────┘
And the Planetary Computer's Data API includes the colormap.
import requests
classmap = requests.get(
"https://planetarycomputer.microsoft.com/api/data/v1/legend/classmap/esa-cci-lc"
).json()
classmap
{'0': [0, 0, 0, 0], '10': [255, 255, 100, 255], '11': [255, 255, 100, 255], '12': [255, 255, 0, 255], '20': [170, 240, 240, 255], '30': [220, 240, 100, 255], '40': [200, 200, 100, 255], '50': [0, 100, 0, 255], '60': [0, 160, 0, 255], '61': [0, 160, 0, 255], '62': [170, 200, 0, 255], '70': [0, 60, 0, 255], '71': [0, 60, 0, 255], '72': [0, 80, 0, 255], '80': [40, 80, 0, 255], '81': [40, 80, 0, 255], '82': [40, 100, 0, 255], '90': [120, 130, 0, 255], '100': [140, 160, 0, 255], '110': [190, 150, 0, 255], '120': [150, 100, 0, 255], '121': [150, 100, 0, 255], '122': [150, 100, 0, 255], '130': [255, 180, 50, 255], '140': [255, 220, 210, 255], '150': [255, 235, 175, 255], '151': [255, 200, 100, 255], '152': [255, 210, 120, 255], '153': [255, 235, 175, 255], '160': [0, 120, 90, 255], '170': [0, 150, 120, 255], '180': [0, 220, 130, 255], '190': [195, 20, 0, 255], '200': [255, 245, 215, 255], '201': [220, 220, 220, 255], '202': [255, 245, 215, 255], '210': [0, 70, 200, 255], '220': [255, 255, 255, 255]}
We'll convert those values to a matplotlib Colormap for plotting.
import matplotlib.colors
import numpy as np
colors = [matplotlib.colors.to_rgba([x / 255 for x in c]) for c in classmap.values()] #
cmap = matplotlib.colors.ListedColormap(colors, name="esa-cci-lc")
ticks = np.arange(cmap.N)
labels = [class_values.get(value, "nodata") for value in ticks]
Finally, we can read and plot the data.
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(16, 12))
p = (
ds["lccs_class"]
.isel(time=0)
.plot(
ax=ax,
cmap=cmap,
)
)
ax.set_axis_off()
ax.set_title("ESA CCI \n Kansas, United States")
colorbar = fig.axes[1]