From 89cf609867fef8df32b384b0c5220843137a5ce7 Mon Sep 17 00:00:00 2001 From: Paola Holleway Date: Thu, 29 Dec 2022 08:18:48 -0700 Subject: [PATCH 1/2] feat: add ESA CCI notebook --- datasets/esa-cci/esa-cci-example.ipynb | 318 +++++++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 datasets/esa-cci/esa-cci-example.ipynb diff --git a/datasets/esa-cci/esa-cci-example.ipynb b/datasets/esa-cci/esa-cci-example.ipynb new file mode 100644 index 00000000..c9f841a2 --- /dev/null +++ b/datasets/esa-cci/esa-cci-example.ipynb @@ -0,0 +1,318 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6375c368-81b1-4cf0-8312-de57feabc89a", + "metadata": {}, + "source": [ + "## Accessing ESA Climate Change Initiative (CCI) Land Cover with the Planetary Computer STAC API\n", + "\n", + "The [ESA Climate Change Initiative (CCI) Land Cover](https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover?tab=overview) 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)](https://www.fao.org/land-water/land/land-governance/land-resources-planning-toolbox/category/details/en/c/1036361/). In addition to the land cover maps, four quality flags are produced to document the reliability of the classification and change detection.\n", + "\n", + "The data in this Collection have been converted from the original NetCDF format to a set of tiled [Cloud Optimized GeoTIFFs (COGs](https://www.cogeo.org/).\n", + "\n", + "Documentation for this dataset is available at the [Planetary Computer Data Catalog](https://planetarycomputer.microsoft.com/dataset/usgs-lcmap-conus-v13)." + ] + }, + { + "cell_type": "markdown", + "id": "7d45d525-eca8-40ec-95d2-6bf3f2d7d396", + "metadata": {}, + "source": [ + "### Data Access\n", + "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](https://planetarycomputer.microsoft.com/compute) sets the environment variable \"PC_SDK_SUBSCRIPTION_KEY\" when your server is started. The API key may be manually set via the following code:\n", + "\n", + "```python\n", + "pc.settings.set_subscription_key()\n", + "```" + ] + }, + { + "cell_type": "markdown", + "id": "527d242e-32b4-49fb-a513-a74ee38495da", + "metadata": { + "tags": [] + }, + "source": [ + "The datasets hosted by the Planetary Computer are available in [Azure Blob Storage](https://docs.microsoft.com/en-us/azure/storage/blobs/). We'll use [pystac-client](https://pystac-client.readthedocs.io/) to search the Planetary Computer's [STAC API](https://planetarycomputer.microsoft.com/api/stac/v1/docs) 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](https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/) and [Using tokens for data access](https://planetarycomputer.microsoft.com/docs/concepts/sas/) for more." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "914344e5", + "metadata": {}, + "outputs": [], + "source": [ + "import planetary_computer\n", + "import pystac_client\n", + "\n", + "# Open the Planetary Computer STAC API\n", + "catalog = pystac_client.Client.open(\n", + " \"https://pct-apis-staging.westeurope.cloudapp.azure.com/stac/\",\n", + " modifier=planetary_computer.sign_inplace,\n", + ")\n", + "collection = catalog.get_collection(\"esa-cci-lc\")\n", + "collection" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63ddd01e-2ae3-4b5d-af8f-cdcbb56f0423", + "metadata": {}, + "outputs": [], + "source": [ + "# Search the catalog and collection for desired items\n", + "latitude = 39.50\n", + "longitude = -98.35\n", + "\n", + "Location = [longitude, latitude]\n", + "geometry = {\n", + " \"type\": \"Point\",\n", + " \"coordinates\": Location,\n", + "}\n", + "\n", + "search = catalog.search(collections=collection, intersects=geometry, datetime=\"2017\")\n", + "items = list(search.get_items())\n", + "items" + ] + }, + { + "cell_type": "markdown", + "id": "69f3564c-bd52-452d-875d-34d9309a64c9", + "metadata": {}, + "source": [ + "### Available Assets & Metadata" + ] + }, + { + "cell_type": "markdown", + "id": "cfd0f626-55bb-4bcf-a2b6-d276df55a0d4", + "metadata": {}, + "source": [ + "Let's display the available [assets](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#asset-object) and metadata. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2cc1ebf2-1188-42db-90b5-17026d7770b7", + "metadata": {}, + "outputs": [], + "source": [ + "import rich.table\n", + "\n", + "# Assets\n", + "t_assets = rich.table.Table(\"Key\", \"Value\")\n", + "for key, asset in items[0].assets.items():\n", + " t_assets.add_row(key, asset.title)\n", + "t_assets" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1c6ae738-7e4d-4718-9c67-22783557bff6", + "metadata": {}, + "outputs": [], + "source": [ + "# Metadata\n", + "t_metadata = rich.table.Table(\"Key\", \"Value\")\n", + "for k, v in sorted(items[0].properties.items()):\n", + " t_metadata.add_row(k, str(v))\n", + "t_metadata" + ] + }, + { + "cell_type": "markdown", + "id": "fcd49bc9-32ac-4b10-83f8-e9fbd2a870ac", + "metadata": {}, + "source": [ + "### Loading the gridded data\n", + "Now let's load STAC items into an xarray dataset using [odc-stac](https://github.com/opendatacube/odc-stac)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "353e9c79-1826-4b3a-a743-f5de84af2a25", + "metadata": {}, + "outputs": [], + "source": [ + "import odc.stac\n", + "\n", + "latitude = 39.50\n", + "longitude = -98.35\n", + "buffer = 5\n", + "bbox = [longitude - buffer, latitude - buffer, longitude + buffer, latitude + buffer]\n", + "\n", + "\n", + "ds = odc.stac.load(items, bbox=bbox)\n", + "ds" + ] + }, + { + "cell_type": "markdown", + "id": "f76a3b43-7827-4e8d-9305-6af33794bbce", + "metadata": {}, + "source": [ + "### Displaying the data" + ] + }, + { + "cell_type": "markdown", + "id": "71778207-c848-4890-844c-afc780f89f74", + "metadata": {}, + "source": [ + "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." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "64ce99ee-5ab4-4471-b30a-c3386aa3d2f4", + "metadata": {}, + "outputs": [], + "source": [ + "from pystac.extensions.item_assets import ItemAssetsExtension\n", + "\n", + "ia = ItemAssetsExtension.ext(collection)\n", + "x = ia.item_assets[\"lccs_class\"]\n", + "\n", + "class_names = {\n", + " x[\"description\"]: x[\"value\"] for x in x.properties[\"classification:classes\"]\n", + "}\n", + "class_values = {v: k for k, v in class_names.items()}\n", + "\n", + "t = rich.table.Table(\"Description\", \"Value\")\n", + "for k, v in class_names.items():\n", + " t.add_row(k, str(v))\n", + "t" + ] + }, + { + "cell_type": "markdown", + "id": "08cd3d3a-fd87-4eab-b824-ba0a585ae961", + "metadata": {}, + "source": [ + "And the Planetary Computer's [Data API](https://planetarycomputer.microsoft.com/api/data/v1/docs) includes the colormap." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ead41860-4c83-4ffe-b261-7fb99ef8f0b7", + "metadata": {}, + "outputs": [], + "source": [ + "import requests\n", + "\n", + "classmap = requests.get(\n", + " \"https://pct-apis-staging.westeurope.cloudapp.azure.com/data/legend/classmap/esa-cci-lc\"\n", + ").json()\n", + "classmap" + ] + }, + { + "cell_type": "markdown", + "id": "ad55957c-4289-4d7c-8397-c185a1e59654", + "metadata": {}, + "source": [ + "We'll convert those values to a [matplotlib Colormap](https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.ListedColormap.html) for plotting." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ec66f389-bbd6-4647-a46a-7ce008a107bd", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.colors\n", + "import numpy as np\n", + "\n", + "colors = [matplotlib.colors.to_rgba([x / 255 for x in c]) for c in classmap.values()] #\n", + "cmap = matplotlib.colors.ListedColormap(colors, name=\"esa-cci-lc\")\n", + "ticks = np.arange(cmap.N)\n", + "labels = [class_values.get(value, \"nodata\") for value in ticks]" + ] + }, + { + "cell_type": "markdown", + "id": "814dda76-d53f-4e32-a485-2cfe7ee94147", + "metadata": {}, + "source": [ + "Finally, we can read and plot the data. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "323491b4-cc69-4627-9558-011206d007f7", + "metadata": {}, + "outputs": [], + "source": [ + "import rioxarray\n", + "\n", + "item = items[0]\n", + "ds = rioxarray.open_rasterio(item.assets[\"lccs_class\"].href).squeeze()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c6eeab35-0568-4051-a11b-d3d8b2dec112", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "fig, ax = plt.subplots(figsize=(16, 12))\n", + "\n", + "p = ds.plot(\n", + " ax=ax,\n", + " cmap=cmap,\n", + ")\n", + "\n", + "ax.set_axis_off()\n", + "ax.set_title(\"ESA CCI \\n Baja California Peninsula\")\n", + "\n", + "colorbar = fig.axes[1]" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "PlanetaryComputerExamples", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.6" + }, + "vscode": { + "interpreter": { + "hash": "e948087a60c74a7365deb7ebdb8258aef9e35befc5ff622dcc77bee1eb899c9c" + } + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 7d811b60368476b17962697ff7590a18a5630b90 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 13 Jan 2023 08:33:23 -0600 Subject: [PATCH 2/2] fixup --- datasets/esa-cci/esa-cci-example.ipynb | 1936 +++++++++++++++++++++++- 1 file changed, 1899 insertions(+), 37 deletions(-) mode change 100644 => 100755 datasets/esa-cci/esa-cci-example.ipynb diff --git a/datasets/esa-cci/esa-cci-example.ipynb b/datasets/esa-cci/esa-cci-example.ipynb old mode 100644 new mode 100755 index c9f841a2..30016aa4 --- a/datasets/esa-cci/esa-cci-example.ipynb +++ b/datasets/esa-cci/esa-cci-example.ipynb @@ -39,17 +39,1171 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "914344e5", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

\n", + " CollectionClient: esa-cci-lc\n", + "

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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. \n", + "\n", + "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).\n", + "
Providers:\n", + "
    \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " VITO \n", + " \n", + " (licensor): Provides the PROBA-V source data (for v2.0). \n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " UCLouvain \n", + " \n", + " (producer): UCLouvain produces the dataset (v2.1) for the ESA Climate Change Initiative. \n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " Brockmann Consult \n", + " \n", + " (processor): Brockmann Consult is responsible for the required pre-processing and the distribution of the dataset (v2.1). \n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " ESA Climate Change Initiative \n", + " \n", + " (licensor): The ESA Climate Change Initiative (CCI) is leading the product creation. \n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " Copernicus \n", + " \n", + " (licensor): Hosts the data on the Copernicus Climate Data Store (CDS). \n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
  • \n", + "\n", + "
    \n", + " \n", + " Microsoft \n", + " \n", + " (processor, host)\n", + " \n", + "
    \n", + "
  • \n", + " \n", + "
\n", + "
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-12T14%3A32%3A07Z&se=2023-01-20T14%3A32%3A07Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A06Z&ske=2023-01-20T14%3A32%3A06Z&sks=b&skv=2021-06-08&sig=q1BhqoTt3c%2BKoiiy7hkulEnEyE2/wzwplWg7TPSpp6U%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
\n", + " \n", + "
\n", + " \n", + "

STAC Extensions

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + "

Items

\n", + "
\n", + " Only the first item shown \n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Item: C3S-LC-L4-LCCS-Map-300m-P1Y-2020-v2.1.1-S90W180

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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']
\n", + " \n", + "
\n", + " \n", + "

STAC Extensions

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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
\n", + "
\n", + " \n", + " \n", + "
\n", + " \n", + "

Assets

\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Land Cover Class Defined in the Land Cover Classification System

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A08Z&se=2023-01-20T14%3A32%3A08Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A07Z&ske=2023-01-20T14%3A32%3A07Z&sks=b&skv=2021-06-08&sig=srm1ayQTJBRT%2BXeAJpIr1Kfw7mY3xOzya2dc1MevPOE%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'}]
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Number of Class Changes

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A08Z&se=2023-01-20T14%3A32%3A08Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A07Z&ske=2023-01-20T14%3A32%3A07Z&sks=b&skv=2021-06-08&sig=srm1ayQTJBRT%2BXeAJpIr1Kfw7mY3xOzya2dc1MevPOE%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}]
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Land Cover Map Processed Area Flag

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A08Z&se=2023-01-20T14%3A32%3A08Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A07Z&ske=2023-01-20T14%3A32%3A07Z&sks=b&skv=2021-06-08&sig=srm1ayQTJBRT%2BXeAJpIr1Kfw7mY3xOzya2dc1MevPOE%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'}]
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Number of Valid Observations

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A08Z&se=2023-01-20T14%3A32%3A08Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A07Z&ske=2023-01-20T14%3A32%3A07Z&sks=b&skv=2021-06-08&sig=srm1ayQTJBRT%2BXeAJpIr1Kfw7mY3xOzya2dc1MevPOE%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}]
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Land Cover Pixel Type Mask

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A08Z&se=2023-01-20T14%3A32%3A08Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A07Z&ske=2023-01-20T14%3A32%3A07Z&sks=b&skv=2021-06-08&sig=srm1ayQTJBRT%2BXeAJpIr1Kfw7mY3xOzya2dc1MevPOE%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'}]
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: TileJSON with default rendering

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href: https://planetarycomputer-staging.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:
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: Rendered preview

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href: https://planetarycomputer-staging.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
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + " \n", + " \n", + "
\n", + " \n", + "

Links

\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: collection
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/collections/esa-cci-lc
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: parent
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/collections/esa-cci-lc
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: root
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: self
Target: https://planetarycomputer-staging.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
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Source NetCDF Item

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: derived_from
Target: https://planetarycomputer-staging.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
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Map of item

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: preview
Target: https://planetarycomputer-staging.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
\n", + " \n", + "
\n", + "
\n", + " \n", + "
\n", + " \n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + " \n", + " \n", + "
\n", + " \n", + "

Links

\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: items
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/collections/esa-cci-lc/items
Media Type: application/geo+json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: parent
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Microsoft Planetary Computer STAC API

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: root
Target:
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: self
Target: https://planetarycomputer-staging.microsoft.com/api/stac/v1/collections/esa-cci-lc
Media Type: application/json
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

ESA CCI license

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: license
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/satellite-land-cover.pdf
Media Type: text/html
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

COPERNICUS license

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: license
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/licence-to-use-copernicus-products.pdf
Media Type: text/html
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

VITO License

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: license
Target: https://cds.climate.copernicus.eu/api/v2/terms/static/vito-proba-v.pdf
Media Type: text/html
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Product Landing Page

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: about
Target: https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-land-cover
Media Type: text/html
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Product user guide for version 2.1

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Product user guide for version 2.0

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: cite-as
Target: https://doi.org/10.24381/cds.006f2c9a
\n", + " \n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "

Link:

\n", + " \n", + "

Human readable dataset overview and reference

\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Rel: describedby
Target: https://planetarycomputer.microsoft.com/dataset/esa-cci-lc
Media Type: text/html
\n", + " \n", + "
\n", + "
\n", + " \n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + "

Assets

\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: ESA CCI Land Cover COGs Thumbnail

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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:
\n", + "
\n", + "
\n", + "
\n", + " \n", + " \n", + "\n", + "
\n", + "
\n", + "
\n", + "
\n", + "
\n", + " \n", + "

Asset: GeoParquet STAC items

\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
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-12T14%3A32%3A07Z&se=2023-01-20T14%3A32%3A07Z&sp=rl&sv=2021-06-08&sr=c&skoid=c85c15d6-d1ae-42d4-af60-e2ca0f81359b&sktid=72f988bf-86f1-41af-91ab-2d7cd011db47&skt=2023-01-13T14%3A32%3A06Z&ske=2023-01-20T14%3A32%3A06Z&sks=b&skv=2021-06-08&sig=q1BhqoTt3c%2BKoiiy7hkulEnEyE2/wzwplWg7TPSpp6U%3D'}
\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + " \n", + "\n", + "
\n", + "
\n", + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import planetary_computer\n", "import pystac_client\n", "\n", "# Open the Planetary Computer STAC API\n", "catalog = pystac_client.Client.open(\n", - " \"https://pct-apis-staging.westeurope.cloudapp.azure.com/stac/\",\n", + " \"https://planetarycomputer-staging.microsoft.com/api/stac/v1/\",\n", " modifier=planetary_computer.sign_inplace,\n", ")\n", "collection = catalog.get_collection(\"esa-cci-lc\")\n", @@ -58,10 +1212,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "63ddd01e-2ae3-4b5d-af8f-cdcbb56f0423", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Search the catalog and collection for desired items\n", "latitude = 39.50\n", @@ -74,10 +1239,44 @@ "}\n", "\n", "search = catalog.search(collections=collection, intersects=geometry, datetime=\"2017\")\n", - "items = list(search.get_items())\n", + "items = list(search.items())\n", "items" ] }, + { + "cell_type": "markdown", + "id": "71250a4f-0611-4afa-bdb9-6fe5d7767baa", + "metadata": {}, + "source": [ + "Each item contains a `rendered_preview` asset that we can use to quickly visualize the data using the Planetary Computer's `data` API." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "e71be737-4fcd-4f9a-9382-8fc4094574f9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import Image\n", + "\n", + "Image(url=items[0].assets[\"rendered_preview\"].href)" + ] + }, { "cell_type": "markdown", "id": "69f3564c-bd52-452d-875d-34d9309a64c9", @@ -96,10 +1295,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "2cc1ebf2-1188-42db-90b5-17026d7770b7", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+       "┃ Key                  Value                                                            ┃\n",
+       "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+       "│ lccs_class          │ Land Cover Class Defined in the Land Cover Classification System │\n",
+       "│ change_count        │ Number of Class Changes                                          │\n",
+       "│ processed_flag      │ Land Cover Map Processed Area Flag                               │\n",
+       "│ observation_count   │ Number of Valid Observations                                     │\n",
+       "│ current_pixel_state │ Land Cover Pixel Type Mask                                       │\n",
+       "│ tilejson            │ TileJSON with default rendering                                  │\n",
+       "│ rendered_preview    │ Rendered preview                                                 │\n",
+       "└─────────────────────┴──────────────────────────────────────────────────────────────────┘\n",
+       "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mKey \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mValue \u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ lccs_class │ Land Cover Class Defined in the Land Cover Classification System │\n", + "│ change_count │ Number of Class Changes │\n", + "│ processed_flag │ Land Cover Map Processed Area Flag │\n", + "│ observation_count │ Number of Valid Observations │\n", + "│ current_pixel_state │ Land Cover Pixel Type Mask │\n", + "│ tilejson │ TileJSON with default rendering │\n", + "│ rendered_preview │ Rendered preview │\n", + "└─────────────────────┴──────────────────────────────────────────────────────────────────┘\n" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import rich.table\n", "\n", @@ -112,10 +1346,51 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "1c6ae738-7e4d-4718-9c67-22783557bff6", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
+       "┃ Key                 Value                                                                               ┃\n",
+       "┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
+       "│ created            │ 2023-01-11T20:59:49.119291Z                                                         │\n",
+       "│ datetime           │ None                                                                                │\n",
+       "│ end_datetime       │ 2017-12-31T23:59:59Z                                                                │\n",
+       "│ esa_cci_lc:tile    │ N00W135                                                                             │\n",
+       "│ esa_cci_lc:version │ v2.1.1                                                                              │\n",
+       "│ proj:epsg          │ 4326                                                                                │\n",
+       "│ proj:shape         │ [16200, 16200]                                                                      │\n",
+       "│ proj:transform     │ [0.002777777777777778, 0.0, -135.0, 0.0, -0.0027777777777777783, 45.00000000000001] │\n",
+       "│ start_datetime     │ 2017-01-01T00:00:00Z                                                                │\n",
+       "│ title              │ ESA CCI Land Cover Map for Year 2017, Tile N00W135                                  │\n",
+       "└────────────────────┴─────────────────────────────────────────────────────────────────────────────────────┘\n",
+       "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mKey \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mValue \u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n", + "│ created │ 2023-01-11T20:59:49.119291Z │\n", + "│ datetime │ None │\n", + "│ end_datetime │ 2017-12-31T23:59:59Z │\n", + "│ esa_cci_lc:tile │ N00W135 │\n", + "│ esa_cci_lc:version │ v2.1.1 │\n", + "│ proj:epsg │ 4326 │\n", + "│ proj:shape │ [16200, 16200] │\n", + "│ proj:transform │ [0.002777777777777778, 0.0, -135.0, 0.0, -0.0027777777777777783, 45.00000000000001] │\n", + "│ start_datetime │ 2017-01-01T00:00:00Z │\n", + "│ title │ ESA CCI Land Cover Map for Year 2017, Tile N00W135 │\n", + "└────────────────────┴─────────────────────────────────────────────────────────────────────────────────────┘\n" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Metadata\n", "t_metadata = rich.table.Table(\"Key\", \"Value\")\n", @@ -135,10 +1410,460 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "353e9c79-1826-4b3a-a743-f5de84af2a25", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset>\n",
+       "Dimensions:              (latitude: 3600, longitude: 3600, time: 1)\n",
+       "Coordinates:\n",
+       "  * latitude             (latitude) float64 44.5 44.5 44.49 ... 34.51 34.5 34.5\n",
+       "  * longitude            (longitude) float64 -103.3 -103.3 ... -93.35 -93.35\n",
+       "    spatial_ref          int32 4326\n",
+       "  * time                 (time) datetime64[ns] 2017-01-01\n",
+       "Data variables:\n",
+       "    lccs_class           (time, latitude, longitude) uint8 130 130 130 ... 60 90\n",
+       "    change_count         (time, latitude, longitude) uint8 0 0 0 0 0 ... 0 0 0 0\n",
+       "    processed_flag       (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1\n",
+       "    observation_count    (time, latitude, longitude) uint16 267 263 ... 234 238\n",
+       "    current_pixel_state  (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1
" + ], + "text/plain": [ + "\n", + "Dimensions: (latitude: 3600, longitude: 3600, time: 1)\n", + "Coordinates:\n", + " * latitude (latitude) float64 44.5 44.5 44.49 ... 34.51 34.5 34.5\n", + " * longitude (longitude) float64 -103.3 -103.3 ... -93.35 -93.35\n", + " spatial_ref int32 4326\n", + " * time (time) datetime64[ns] 2017-01-01\n", + "Data variables:\n", + " lccs_class (time, latitude, longitude) uint8 130 130 130 ... 60 90\n", + " change_count (time, latitude, longitude) uint8 0 0 0 0 0 ... 0 0 0 0\n", + " processed_flag (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1\n", + " observation_count (time, latitude, longitude) uint16 267 263 ... 234 238\n", + " current_pixel_state (time, latitude, longitude) uint8 1 1 1 1 1 ... 1 1 1 1" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import odc.stac\n", "\n", @@ -170,10 +1895,107 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "64ce99ee-5ab4-4471-b30a-c3386aa3d2f4", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┓\n",
+       "┃ Description                                                                         Value ┃\n",
+       "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━┩\n",
+       "│ No data                                                                            │ 0     │\n",
+       "│ Cropland, rainfed                                                                  │ 10    │\n",
+       "│ Cropland, rainfed, herbaceous cover                                                │ 11    │\n",
+       "│ Cropland, rainfed, tree, or shrub cover                                            │ 12    │\n",
+       "│ Cropland, irrigated or post-flooding                                               │ 20    │\n",
+       "│ Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%) │ 30    │\n",
+       "│ Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%) │ 40    │\n",
+       "│ Tree cover, broadleaved, evergreen, closed to open (>15%)                          │ 50    │\n",
+       "│ Tree cover, broadleaved, deciduous, closed to open (>15%)                          │ 60    │\n",
+       "│ Tree cover, broadleaved, deciduous, closed (>40%)                                  │ 61    │\n",
+       "│ Tree cover, broadleaved, deciduous, open (15-40%)                                  │ 62    │\n",
+       "│ Tree cover, needleleaved, evergreen, closed to open (>15%)                         │ 70    │\n",
+       "│ Tree cover, needleleaved, evergreen, closed (>40%)                                 │ 71    │\n",
+       "│ Tree cover, needleleaved, evergreen, open (15-40%)                                 │ 72    │\n",
+       "│ Tree cover, needleleaved, deciduous, closed to open (>15%)                         │ 80    │\n",
+       "│ Tree cover, needleleaved, deciduous, closed (>40%)                                 │ 81    │\n",
+       "│ Tree cover, needleleaved, deciduous, open (15-40%)                                 │ 82    │\n",
+       "│ Tree cover, mixed leaf type (broadleaved and needleleaved)                         │ 90    │\n",
+       "│ Mosaic tree and shrub (>50%) / herbaceous cover (<50%)                             │ 100   │\n",
+       "│ Mosaic herbaceous cover (>50%) / tree and shrub (<50%)                             │ 110   │\n",
+       "│ Shrubland                                                                          │ 120   │\n",
+       "│ Evergreen shrubland                                                                │ 121   │\n",
+       "│ Deciduous shrubland                                                                │ 122   │\n",
+       "│ Grassland                                                                          │ 130   │\n",
+       "│ Lichens and mosses                                                                 │ 140   │\n",
+       "│ Sparse vegetation (tree, shrub, herbaceous cover) (<15%)                           │ 150   │\n",
+       "│ Sparse tree (<15%)                                                                 │ 151   │\n",
+       "│ Sparse shrub (<15%)                                                                │ 152   │\n",
+       "│ Sparse herbaceous cover (<15%)                                                     │ 153   │\n",
+       "│ Tree cover, flooded, fresh or brackish water                                       │ 160   │\n",
+       "│ Tree cover, flooded, saline water                                                  │ 170   │\n",
+       "│ Shrub or herbaceous cover, flooded, fresh/saline/brackish water                    │ 180   │\n",
+       "│ Urban areas                                                                        │ 190   │\n",
+       "│ Bare areas                                                                         │ 200   │\n",
+       "│ Consolidated bare areas                                                            │ 201   │\n",
+       "│ Unconsolidated bare areas                                                          │ 202   │\n",
+       "│ Water bodies                                                                       │ 210   │\n",
+       "│ Permanent snow and ice                                                             │ 220   │\n",
+       "└────────────────────────────────────────────────────────────────────────────────────┴───────┘\n",
+       "
\n" + ], + "text/plain": [ + "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┓\n", + "┃\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mValue\u001b[0m\u001b[1m \u001b[0m┃\n", + "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━┩\n", + "│ No data │ 0 │\n", + "│ Cropland, rainfed │ 10 │\n", + "│ Cropland, rainfed, herbaceous cover │ 11 │\n", + "│ Cropland, rainfed, tree, or shrub cover │ 12 │\n", + "│ Cropland, irrigated or post-flooding │ 20 │\n", + "│ Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%) │ 30 │\n", + "│ Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%) │ 40 │\n", + "│ Tree cover, broadleaved, evergreen, closed to open (>15%) │ 50 │\n", + "│ Tree cover, broadleaved, deciduous, closed to open (>15%) │ 60 │\n", + "│ Tree cover, broadleaved, deciduous, closed (>40%) │ 61 │\n", + "│ Tree cover, broadleaved, deciduous, open (15-40%) │ 62 │\n", + "│ Tree cover, needleleaved, evergreen, closed to open (>15%) │ 70 │\n", + "│ Tree cover, needleleaved, evergreen, closed (>40%) │ 71 │\n", + "│ Tree cover, needleleaved, evergreen, open (15-40%) │ 72 │\n", + "│ Tree cover, needleleaved, deciduous, closed to open (>15%) │ 80 │\n", + "│ Tree cover, needleleaved, deciduous, closed (>40%) │ 81 │\n", + "│ Tree cover, needleleaved, deciduous, open (15-40%) │ 82 │\n", + "│ Tree cover, mixed leaf type (broadleaved and needleleaved) │ 90 │\n", + "│ Mosaic tree and shrub (>50%) / herbaceous cover (<50%) │ 100 │\n", + "│ Mosaic herbaceous cover (>50%) / tree and shrub (<50%) │ 110 │\n", + "│ Shrubland │ 120 │\n", + "│ Evergreen shrubland │ 121 │\n", + "│ Deciduous shrubland │ 122 │\n", + "│ Grassland │ 130 │\n", + "│ Lichens and mosses │ 140 │\n", + "│ Sparse vegetation (tree, shrub, herbaceous cover) (<15%) │ 150 │\n", + "│ Sparse tree (<15%) │ 151 │\n", + "│ Sparse shrub (<15%) │ 152 │\n", + "│ Sparse herbaceous cover (<15%) │ 153 │\n", + "│ Tree cover, flooded, fresh or brackish water │ 160 │\n", + "│ Tree cover, flooded, saline water │ 170 │\n", + "│ Shrub or herbaceous cover, flooded, fresh/saline/brackish water │ 180 │\n", + "│ Urban areas │ 190 │\n", + "│ Bare areas │ 200 │\n", + "│ Consolidated bare areas │ 201 │\n", + "│ Unconsolidated bare areas │ 202 │\n", + "│ Water bodies │ 210 │\n", + "│ Permanent snow and ice │ 220 │\n", + "└────────────────────────────────────────────────────────────────────────────────────┴───────┘\n" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from pystac.extensions.item_assets import ItemAssetsExtension\n", "\n", @@ -201,15 +2023,63 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "ead41860-4c83-4ffe-b261-7fb99ef8f0b7", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'0': [0, 0, 0, 0],\n", + " '10': [255, 255, 100, 255],\n", + " '11': [255, 255, 100, 255],\n", + " '12': [255, 255, 0, 255],\n", + " '20': [170, 240, 240, 255],\n", + " '30': [220, 240, 100, 255],\n", + " '40': [200, 200, 100, 255],\n", + " '50': [0, 100, 0, 255],\n", + " '60': [0, 160, 0, 255],\n", + " '61': [0, 160, 0, 255],\n", + " '62': [170, 200, 0, 255],\n", + " '70': [0, 60, 0, 255],\n", + " '71': [0, 60, 0, 255],\n", + " '72': [0, 80, 0, 255],\n", + " '80': [40, 80, 0, 255],\n", + " '81': [40, 80, 0, 255],\n", + " '82': [40, 100, 0, 255],\n", + " '90': [120, 130, 0, 255],\n", + " '100': [140, 160, 0, 255],\n", + " '110': [190, 150, 0, 255],\n", + " '120': [150, 100, 0, 255],\n", + " '121': [150, 100, 0, 255],\n", + " '122': [150, 100, 0, 255],\n", + " '130': [255, 180, 50, 255],\n", + " '140': [255, 220, 210, 255],\n", + " '150': [255, 235, 175, 255],\n", + " '151': [255, 200, 100, 255],\n", + " '152': [255, 210, 120, 255],\n", + " '153': [255, 235, 175, 255],\n", + " '160': [0, 120, 90, 255],\n", + " '170': [0, 150, 120, 255],\n", + " '180': [0, 220, 130, 255],\n", + " '190': [195, 20, 0, 255],\n", + " '200': [255, 245, 215, 255],\n", + " '201': [220, 220, 220, 255],\n", + " '202': [255, 245, 215, 255],\n", + " '210': [0, 70, 200, 255],\n", + " '220': [255, 255, 255, 255]}" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import requests\n", "\n", "classmap = requests.get(\n", - " \"https://pct-apis-staging.westeurope.cloudapp.azure.com/data/legend/classmap/esa-cci-lc\"\n", + " \"https://planetarycomputer-staging.microsoft.com/api/data/v1/legend/classmap/esa-cci-lc\"\n", ").json()\n", "classmap" ] @@ -224,7 +2094,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "ec66f389-bbd6-4647-a46a-7ce008a107bd", "metadata": {}, "outputs": [], @@ -246,19 +2116,6 @@ "Finally, we can read and plot the data. " ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "323491b4-cc69-4627-9558-011206d007f7", - "metadata": {}, - "outputs": [], - "source": [ - "import rioxarray\n", - "\n", - "item = items[0]\n", - "ds = rioxarray.open_rasterio(item.assets[\"lccs_class\"].href).squeeze()" - ] - }, { "cell_type": "code", "execution_count": null, @@ -270,13 +2127,18 @@ "\n", "fig, ax = plt.subplots(figsize=(16, 12))\n", "\n", - "p = ds.plot(\n", - " ax=ax,\n", - " cmap=cmap,\n", + "p = (\n", + " ds[\"lccs_class\"]\n", + " .isel(time=0)\n", + " .plot(\n", + " ax=ax,\n", + " cmap=cmap,\n", + " )\n", ")\n", "\n", "ax.set_axis_off()\n", - "ax.set_title(\"ESA CCI \\n Baja California Peninsula\")\n", + "\n", + "ax.set_title(\"ESA CCI \\n Kansas, United States\")\n", "\n", "colorbar = fig.axes[1]" ] @@ -284,7 +2146,7 @@ ], "metadata": { "kernelspec": { - "display_name": "PlanetaryComputerExamples", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -298,7 +2160,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.8" }, "vscode": { "interpreter": {