[go: up one dir, main page]

File: api.rst

package info (click to toggle)
usgs 0.3.5-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,368 kB
  • sloc: python: 769; makefile: 153
file content (41 lines) | stat: -rw-r--r-- 908 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. module:: usgs

.. api:

USGS API
=============

Examples
********

The ``where`` parameter used for searching a USGS dataset is best understood by example.

.. code-block:: python


    from usgs import api


    def submit_where_query():

        # USGS uses numerical codes to identify queryable fields
        # To see which fields are queryable for a specific dataset,
        # send off a request to dataset-fields

        results = api.dataset_fields('LANDSAT_8_C1', 'EE')

        for field in results['data']:
            print field

        # WRS Path happens to have the field id 20514
        where = {
            20514: '043'
        }
        results = api.search('LANDSAT_8_C1', 'EE', where=where, start_date='2017-04-01', end_date='2017-05-01', max_results=10, extended=True)

        for scene in results['data']['results']:
            print scene


.. automodule:: usgs.api
	:members: