Metadata

Warning

This low-level client has been deprecated in favor of the newer object-oriented Catalog client.


The Metadata API is a foundational resource for filtering datasets, so scientists and developers can analyze exactly the data they need. The most common interaction you will have with the Metdata API will be searching for available imagery. There are two methods that return subsets of our available imagery: Search and Features.

It is important to note that these methods return image IDs and their associated metadata. To obtain image data for analysis or plotting, you pass the desired IDs to the Raster API. This is a very popular workflow among our users.

Note

For information about API Quotas and limits see our Quotas & Limits page.

Features

Similar to Search, this is the most efficient method for accessing image IDs and their metadata. All parameters are optional. This method is built to handle requests resulting in 10000 returns or more, though it works well for smaller subsets, too. A generator of GeoJSON feature objects is returned, allowing you to efficiently scroll through and access the search results. The input parameters are exactly the same, except no limit is applicable. Instead, a Batch Size may be set to adjust the number of features to fetch per request.

Here’s an example of counting all Landsat 8 TOAR images over the US in our catalog captured in a 6 month period.

>>> from descarteslabs.client.services.metadata import Metadata
>>> metadata_client = Metadata()
>>> us_geom = {
...     "type": "Polygon",
...     "coordinates": [[
...         [-80.93337105360712, 24.93352171375889],
...         [-84.043431, 30.039755],
...         [-93.666188, 29.697788],
...         [-96.875264, 27.96992],
...         [-97.405537, 25.837754],
...         [-101.402319, 29.77119],
...         [-103.286986, 28.978172],
...         [-106.451165, 31.764361],
...         [-117.204917, 32.528832],
...         [-123.784676, 38.893728],
...         [-124.814815, 48.405923],
...         [-94.957439, 49.370066],
...         [-84.128925, 46.530119],
...         [-82.52064, 45.335902],
...         [-82.681119, 41.676328],
...         [-68.15488, 47.325185],
...         [-66.885444, 44.794208],
...         [-70.49323, 43.286829],
...         [-69.930953, 41.210543],
...         [-73.876778, 40.501127],
...         [-75.484571, 35.187577],
...         [-81.056623, 31.714875],
...         [-80.385069, 27.861362],
...         [-80.113644, 25.372757],
...         [-80.93337105360712, 24.93352171375889]
...     ]]
... }
>>> features = metadata_client.features(
...     "landsat:LC08:PRE:TOAR",
...     start_datetime='2016-01-01',
...     end_datetime='2016-06-30',
...     geom=us_geom
... )
...
>>> total = 0
>>> for f in features:
...         total += 1
...
>>> print(
...     "There were {} Landsat 8 TOAR images captured over the "
...     "US from January to June in 2016.".format(total)
... )
...
There were 8314 Landsat 8 TOAR images captured over the US from January to June in 2016.