24.04.2016 Views

gbdxtools Documentation

gbdxtools

gbdxtools

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 1<br />

Getting started<br />

1.1 Getting access to GBDX<br />

All operations on GBDX require credentials. Instantiating an Interface object automatically logs you in:<br />

>>> from <strong>gbdxtools</strong> import Interface<br />

>>> gbdx = Interface()<br />

<strong>gbdxtools</strong> expects a config file to exist at ~/.gbdx-config with your GBDX credentials. See formatting for this<br />

file here: https://github.com/tdg-platform/gbdx-auth#ini-file. To get a GBDX username, password and API key,<br />

please email geobigdata@digitalglobe.com. For future reference, remember that your credentials are listed in<br />

https://gbdx.geobigdata.io/account/user/settings/.<br />

1.2 Getting your S3 information<br />

Use the s3 member of the Interface:<br />

>>> gbdx.s3.info<br />

>>> {u'S3_access_key': u'blah',<br />

u'S3_secret_key': u'blah',<br />

u'S3_session_token': u'blah',<br />

u'bucket': u'gbd-customer-data',<br />

u'prefix': u'58600248-2927-4523-b44b-5fec3d278c09'}<br />

>>> item = 'testdata/test1.tif'<br />

>>> gbdx.s3.download(item)<br />

You can see the contents of your bucket/prefix using this link: http://s3browser-env.elasticbeanstalk.com/login.html.<br />

1.3 Ordering imagery<br />

This guide uses v2 of the GBDX ordering API. Ordering API v1 was deprecated on 02/25/2016.<br />

Use the ordering member of the Interface to order and status imagery.<br />

To order the image with DG factory catalog id 10400100143FC900:<br />

>>> order_id = gbdx.ordering.order('10400100143FC900')<br />

>>> print order_id<br />

04aa8df5-8ac8-4b86-8b58-aa55d7353987<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!