{
"cells": [
{
"cell_type": "markdown",
"id": "e861f4db-f66d-474f-95bc-eaefba6437ff",
"metadata": {},
"source": [
"## Accessing Planet - NICFI Data on the Planetary Computer\n",
"\n",
"We've partnered with the [Group on Earth Observation](https://www.earthobservations.org/geo_blog_obs.php?id=528) and [Planet](https://www.planet.com/pulse/nicfi-satellite-data-program-extended-to-include-recipients-of-the-geo-microsoft-planetary-computer-grants-program/) to provide access to data from the NICFI Satellite Data Program to winners of the GEO - Microsoft Planetary Computer grants program. Data from these collections are only available to the grantees. Others wishing to use the data can sign up and access it from Planet at https://www.planet.com/nicfi/.\n",
"\n",
"In this example, we'll use the STAC API to search for items matching some spatio-temporal query."
]
},
{
"cell_type": "markdown",
"id": "b7ddc6f4-374e-43b0-8f21-13ca3bdf79b7",
"metadata": {},
"source": [
"### Data access\n",
"\n",
"The datasets hosted by the Planetary Computer are available from [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": 1,
"id": "5b77a015-45fd-45a9-a8b8-4dccb8e002d5",
"metadata": {},
"outputs": [],
"source": [
"import pystac_client\n",
"import planetary_computer\n",
"\n",
"catalog = pystac_client.Client.open(\n",
" \"https://planetarycomputer.microsoft.com/api/stac/v1\",\n",
" modifier=planetary_computer.sign_inplace,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8d08ea6d-3c91-455c-8913-efda41e273b1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"24"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"point = {\"type\": \"Point\", \"coordinates\": (-60.556640599999994, -0.96674985)}\n",
"search = catalog.search(collections=[\"planet-nicfi-visual\"], intersects=point)\n",
"items = search.item_collection()\n",
"len(items)"
]
},
{
"cell_type": "markdown",
"id": "654ff5f7-c001-47ee-a8f1-a958c186cd9d",
"metadata": {},
"source": [
"Next, we'll load the oldest and newest items to visually compare the change in this area over the six years."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "325911a6-fad1-4d6a-9354-fa0e6c9eb5f7",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
"