Uploading imagery to the Platform

When users upload raster imagery to the Platform, it can be managed, queried, and retrieved alongside petabytes of other data

There are three key steps to uploading raster data to the Descartes Labs Catalog:

  1. Create a Product
  2. Add Bands
  3. Upload Data

The first two of these steps can be performed using the Catalog web interface. The last step can only be accomplished using the Python client.

See a full example on our documentation site here

Create a Product

Each Product uploaded to the Catalog has its own page in the Catalog web interface, and a unique identifier to access it programmatically. These are generated upon Product creation, the first step in uploading your own data to the Catalog.

From the Web Interface

The "+Add New Product" button at the top right of the Catalog web interface will take you to a form in which you can fill out details about your new Product.Catalog UI Create Product Button

From the Python Client

Using the Catalog module in the Python client:

from descarteslabs import Product

my_product = Product(
id='abcde'
name='My Test Product',
description='...'
)

my_product.save()

Add Bands

Next, we must tell the Catalog what kind of data we will be uploading, and how many different measurements there are within a single image.

For more information on band types, see the relevant documentation here

From the Web Interface

The "Add Band" and "+" buttons on a newly created product will bring you to a form where you can define the bands you want to create.Catalog UI Create Band Button

From the Python Client

Using the Catalog module in the Python client:

from descarteslabs import SpectralBand

band = SpectralBand(
product=product,
name=band,
...
)

band.save()

The imagery you upload to our Platform will often have more than one band. This example demonstrates one way to add three bands for optical imagery (red, green, and blue).

Upload Data

Now that we have a Product created and have defined the bands we want to save in it, the last step is to push data in. There are two cases in which data is added to the Catalog:

  1. You have imagery on your computer, or in another system, that you want to add to the Catalog
  2. You have output of analysis performed on the Descartes Labs Platform that you want to store in the Catalog

We will focus here on the first case. You can upload imagery directly as a GeoTIFF or as a NumPy array. Here we will assume you have a GeoTIFF you want to upload, stored in a file called my_image.geotiff.

from descarteslabs.catalog import Image

image = Image(
name='my_image',
product=product,
...
)

image.upload('my_image.geotiff')