Table of contents

EarthDaily Data

EarthDaily data comprises of Open collections, EDA specific collections, Mosaics and Cloudmasks. There are different ways to access this data and they are outlined below. Please note that for all of the below options, you will need to have authentication details available. You can find the details about all the available Collections, Mosaics and CloudMasks.

  1. API
  2. PySTAC library
  3. EarthDaily Python Client

Authentication

There are different ways outlined below for accessing the EarthDaily data. . The required client_id, client_secret and access_token_url values can be found on Account Management page. These API credentials are specific to your user account on EarthPlatform and should be kept confidential.

Client Credentials For more see: Authentication

API

Earthdaily provides STAC compliant restful APIs with various endpoints for you to access the data. You can also search the data with specific filters on fields and customize the output to include the data you are interested in. Find the detailed list of endpoints along with the examples.

API list gives you the detailed list of available endpoints

Postman Examples are available to se the example query and the response using Postman

Curl Examples are available in case you are interested to play around with our APIs using commandline

PySTAC

PySTAC is a library for working with SpatioTemporal Asset Catalogs (STAC). Please find all the features and capabilities of PySTAC along with the details of all the set up required.

Here is a small snippet to give you an idea

# Generate auth token

def get_new_token():
    token_req_payload = {'grant_type': 'client_credentials'}
    token_response = requests.post(auth_token_url,
    data=token_req_payload, verify=False, allow_redirects=False,
    auth=(client_id, client_secret))
    token_response.raise_for_status()

    tokens = json.loads(token_response.text)
    return tokens['access_token']

token = get_new_token()

# Configure pystac client

client = Client.open(api_url, headers={
    "Authorization": f"Bearer {token}"
})

# Get collections

for collection in client.get_all_collections():
    print(collection)

You can find the detailed examples using Python script

EarthDaily Python Client

The fastest way to get up and running is to use EDA’s Python Client Repository.

Build a new Conda Environment:

# Clone the repository and go inside
git clone git@github.com:earthdaily/earthdaily-python-client.git
cd earthdaily-python-client

# Create a virtual environment named earthdaily and install package dependencies
conda env create -n earthdaily -f requirements.yml
conda activate earthdaily

# Install package in editable mode
pip install -e .

copy-earthdaily-credentials-template --default

Test the Available Collections:

"""
from earthdaily.earthdatastore.cube_utils import asset_mapper
from rich.table import Table
from rich.console import Console

console = Console(force_interactive=True)

for collection, assets in asset_mapper._asset_mapper_config.items():
    table = Table(
        "asset",
        "EarthDaily Common band name",
        title=f"Earthdaily common names for {collection}",
    )
    for common_name, asset in assets[0].items():
        table.add_row(asset, common_name)
    console.print(table)

This will output a list of assets for all available collections to you in the platform.

Python Example Band Names

Other Examples

  1. Common Band Names
  2. Compare Scale with Sentinel-2
  3. EarthDaily Simulated Datasets
  4. Field Evolution
  5. Create a Data Cube
  6. Create a Multisensor Cube
  7. Stack Summary

The fastest way to get up and running is to use EDA’s Python Client Repository.