Library Reference

A series of helper functions / libraries have been made available on GitHub. This page provides an overview.

Tagged(dict)

tag(name)

returns the named tag structure if the named tag exists using a linear search. Otherwise, None is returned.

tag_value(name)

returns the named tag’s value or value structure if the named tag and its value exists using a linear search. Otherwise, None is returned.

Product(Tagged)

dataset

A property that references the parent Dataset of this Product

Dataset(Tagged)

acquisition_start_time

A property referencing a datetime with timezone of iso8601.Utc. This property is parsed from the dataset acquisitionStartTime metadata.

acquisition_end_time

A property referencing a datetime with timezone of iso8601.Utc. This property is parsed from the dataset acquisitionEndTime metadata.

products

A property referencing the list of Products associated with this Dataset

find_product(name=None, type=None, format=None)

If no name, type or format are specified, then the first product in the list of products is returned. If any of name, type and format are specified with values other than None, then a linear search is performed in an attempt to find a product meeting the specified criteria. If a match is found that Product is returned. Otherwise, None is returned.

Gipper

The Gipper class provides read only access to the underlying data using the following methods.

build_query_filter(filter_json)

Accepts filter_json as described below and generates the GIPPer query filter needed by other GIPPer methods.

aoi = {
 "coordinates": [
   [
     [-93.35100173950195, 43.34147216799038],
     [-93.31821441650389, 43.34147216799038],
     [-93.31821441650389, 43.35869836463847],
     [-93.35100173950195, 43.35869836463847],
     [-93.35100173950195, 43.34147216799038]
   ]
 ],
 "crs": {
   "properties": {
     "name": "EPSG:4326"
   },
   "type": "name"
 },
 "type": "Polygon"
}

toi = {
 "startTime": "2018-01-01T00:00:00.00Z",
 "endTime": datetime.now().strftime("%Y-%m-%dT%H:%M:%S.00Z")
}

platform_names = ["RapidEye", "Sentinel2"]
product_types": ["Raw", "GeoTrellisTiles"]

methods = {
 "geometry": "covers",
 "temporal": "range"
}

filter_json = {
 "aoi": aoi,
 "toi": toi,
 "methods": methods,
 "platformName": platform_names,
 "productType": product_types
}

get_dataset(dataset_id, exclude_ancillary_metadata=True)

returns the Dataset associated with the specified dataset_id. If exclude_ancillary_metadata is set to True, then the ancillary metadata is not returned with the Dataset. Otherwise, the ancillary metadata is returned with the Dataset. The ancillary metadata is sizeable, so it is excluded by default. If the dataset_id is not found then an HTTPError specifying 404 is raised.

query_datasets(filters, exclude_ancillary_metadata=True)

returns all Datasets found using the specified filters. The filters are generally created using build_query_filter(filter_json). If exclude_ancillary_metadata is set to True, then the ancillary metadata is not returned with the Dataset. Otherwise, the ancillary metadata is returned with the Dataset. The ancillary metadata is sizeable, so it is excluded by default.

query_products(filters, exclude_ancillary_metadata=True)

returns all Products found using the specified filters. The filters are generally created using build_query_filter(filter_json). If exclude_ancillary_metadata is set to True, then the ancillary metadata is not returned with the Dataset. Otherwise, the ancillary metadata is returned with the Dataset. The ancillary metadata is sizeable, so it is excluded by default.

get_dataset_products(dataset_id)

returns all Products of the specified dataset_id. If the dataset_id is not found then an HTTPError specifying 404 is raised.

get_product(product_id)

returns the Product associated with the specified product_id. If the product_id is not found then an HTTPError specifying 404 is raised.

get_provider_id(metadata)

using the specified metadata, attempts to identify the platform name and original provider identifier

get_geotiff_from_geometry(product_id, geometry, write_to_filename=None, write_to_file=None)

using the specified product_id and geometry, attempt to download a tif. If write_to_filename is not None, then open a file using write_to_filename and write the contents to the file. If write_to_file is not None, the use the already opened file and write the content to the file. If the product_id is not found then an HTTPError specifying 404 is raised.

download_imagery(bytes, product_id)

using the specified product_id, download the specified range of bytes of the tif. The byte range is specified as ‘bytes=start-end’. E.g. ‘bytes=0-1000’ If the product_id is not found then an HTTPError specifying 404 is raised.