USGS SOAP

The USGS uses the Simple Object Access protocol (SOAP) to receive requests.

Note

A JSON API started development after this library was originally written.

usgs.soap.clear_bulk_download_order(dataset, node, api_key=None)[source]

This method is used to clear bulk download order information from the item basket.

Parameters:
  • dataset
  • node
  • api_key – API key is required.
usgs.soap.clear_order(dataset, node, api_key=None)[source]

This method is used to clear order information from the item basket.

Parameters:
  • dataset
  • node
  • api_key – API key is required.
usgs.soap.dataset_fields(dataset, node, api_key=None)[source]

This request is used to return the metadata filter fields for the specified dataset. These values can be used as additional criteria when submitting search and hit queries.

Parameters:
  • dataset
  • node
  • api_key – API key is not required.
usgs.soap.datasets(dataset, node, ll=None, ur=None, start_date=None, end_date=None, api_key=None)[source]

This method is used to find datasets available for searching. By passing no parameters except node, all available datasets are returned. Additional parameters such as temporal range and spatial bounding box can be used to find datasets that provide more specific data. The dataset name parameter can be used to limit the results based on matching the supplied value against the dataset name with assumed wildcards at the beginning and end. All parameters are optional except for the ‘node’ parameter.

Parameters:
  • dataset – Dataset Identifier
  • ll

    Lower left corner of an AOI bounding box - in decimal form Longitude/Latitude dictionary

    e.g. { “longitude”: 0.0, “latitude”: 0.0 }

  • ur

    Upper right corner of an AOI bounding box - in decimal form Longitude/Latitude dictionary

    e.g. { “longitude”: 0.0, “latitude”: 0.0 }

  • start_date – Used for searching scene acquisition - will accept anything that the PHP strtotime function can understand
  • end_date – Used for searching scene acquisition - will accept anything that the PHP strtotime function can understand
  • node – The requested Catalog
  • api_key – API key is not required.
usgs.soap.download(dataset, node, entityids, products, api_key=None)[source]

The use of this request will be to obtain valid data download URLs.

Parameters:
  • dataset
  • entityIds – list
  • products – list
  • node
  • api_key – API key is required.
usgs.soap.download_options(dataset, node, entityids, api_key=None)[source]

The use of the download options request is to discover the different download options for each scene. Some download options may exist but still be unavailable due to disk usage and many other factors. If a download is unavailable it may need to be ordered.

Parameters:
  • dataset
  • node
  • entityIds
  • api_key – API key is not required.
usgs.soap.get_bulk_download_products(dataset, node, entityids, api_key)[source]

Retrieve bulk download products on a scene-by-scene basis.

Parameters:
  • dataset
  • node
  • entityid – String or list of strings.
  • api_key – API key is required.
usgs.soap.get_order_products(dataset, node, entityids, api_key=None)[source]

Retrieve orderable products on a scene-by-scene basis.

Parameters:
  • dataset
  • node
  • entityid
  • api_key – API key is required.

Todo

Support multiple scene request.

usgs.soap.item_basket(api_key=None)[source]

Returns the current item basket for the current user.

Parameters:api_key – API key is required.
usgs.soap.login(username, password)[source]

This method requires SSL be used due to the sensitive nature of users passwords. Upon a successful login, an API key will be returned. This key will be active for one hour and should be destroyed upon final use of the service by calling the logout method. Users must have “Machine to Machine” access based on a user-based role in the users profile.

Parameters:
  • username
  • password
usgs.soap.logout(api_key=None)[source]

Remove the users API key from being used in the future.

Parameters:api_key – API key is required.
usgs.soap.metadata(dataset, node, sceneids, api_key=None)[source]

The use of the metadata request is intended for those who have acquired scene IDs from a different source. It will return the same metadata that is available via the search request.

Parameters:
  • dataset
  • node
  • sceneid
  • api_key
usgs.soap.search(dataset, node, lat=None, lng=None, distance=100, ll=None, ur=None, start_date=None, end_date=None, where=None, max_results=50000, starting_number=1, sort_order='DESC', api_key=None)[source]
Parameters:
  • dataset
  • node
  • lat
  • lng
  • ll
  • distance
  • ur
  • start_date
  • end_date
  • where – Specify additional search criteria
  • max_results
  • starting_number
  • sort_order
  • api_key – API key is not required.