gbdx

package module
v0.0.0-...-24ce290 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GBDX_HTTP_TIMEOUT = 60 * time.Second

GBDX_HTTP_TIMEOUT is the default timeout used by the context in http requests.

Variables

This section is empty.

Functions

func Browse

func Browse(cid string, size string, json bool, w io.Writer) error

Browse writes a browse image with catalog id cid and requested size to w.

func BrowseMetadata

func BrowseMetadata(cid string, w io.Writer) error

BrowseMetadata writes the GeoJSON metadata of the catalog id cid to w.

func CatalogHeartbeat

func CatalogHeartbeat() error

CatalogHeartbeat checks if the catalog endpoint is alive and well.

func OrderingHeartbeat

func OrderingHeartbeat() error

OrderingHeartbeat checks if the ordering endpoint is alive and well.

func Thumbnail

func Thumbnail(cid string, dim int, orientation string, w io.Writer) error

Thumbnail writes a thumbnail image with catalog id cid, dimension dim, and orientation to w.

Types

type Acquisition

type Acquisition struct {
	ID       string `json:"acquisition_id"`
	State    string `json:"state"`
	Location string `json:"location"`
}

Acquisition holds the ID, ordering state, and location (an s3 path) of an order.

type Api

type Api struct {
	// contains filtered or unexported fields
}

Api holds GBDX authorized http clients and tokens.

func NewApi

func NewApi(c Config) (*Api, error)

NewApi returns an Api struct for interacting with GBDX.

func (*Api) GetRecords

func (a *Api) GetRecords(inVal []string) (*Result_Parent, error)

func (*Api) ListBucket

func (a *Api) ListBucket(requestedPrefix string, recursive bool, w io.Writer) (err error)

ListBucket writes a listing of contents of the GBDX customer bucket to w.

func (*Api) NewOrder

func (a *Api) NewOrder(IDs ...string) (*Order, error)

NewOrder submits a new order.

func (*Api) OrderLocation

func (a *Api) OrderLocation(IDs ...string) (*Order, error)

OrderLocation returns the location of orders in AWS.

func (*Api) OrderStatus

func (a *Api) OrderStatus(orderID string) (*Order, error)

OrderStatus returns the status of the order given the string identifying it.

func (*Api) RecordStatus

func (a *Api) RecordStatus(catID string) (*Record, error)

RecordStatus returns the status of the imagery given the string identifying it.

func (*Api) Token

func (a *Api) Token() (*oauth2.Token, error)

Token returns a GBDX auth token.

type Config

type Config struct {
	Username string `mapstructure:"gbdx_username" toml:"gbdx_username"`
	Password string `mapstructure:"gbdx_password" toml:"gbdx_password"`
	//ClientID     string        `mapstructure:"gbdx_client_id" toml:"gbdx_client_id"`
	//ClientSecret string        `mapstructure:"gbdx_client_secret" toml:"gbdx_client_secret"`
	Token *oauth2.Token `mapstructure:"gbdx_token" toml:"gbdx_token"`
}

Config holds the various configuation items we need to interact with GBDX.

type Order

type Order struct {
	ID           string        `json:"order_id"`
	Acquisitions []Acquisition `json:"acquisitions"`
}

Order holds the ID and all the associated Acquisitions of a submitted order.

type Record

type Record struct {
	Owner string        `json:"owner"`
	ID    string        `json:"identifier"`
	Type  string        `json:"type"`
	Props Record_Struct `json:"properties"`
}

Catalog holds the ID and all the associated Acquisitions of requested imagery.

type Record_Struct

type Record_Struct struct {
	Ordered              string `json:"ordered"`
	Type                 string `json:"type"`
	Sun_Elevation        string `json:"sunElevation"`
	Targert_Azimuth      string `json:"targetAzimuth"`
	Sensor_Platform_Name string `json:"sensorPlatformName"`
	Sun_Azimuth          string `json:"sunAzimuth"`
	Browse_URL           string `json:"browseURL"`
	Available            string `json:"available"`
	Cloud_Cover          string `json:"cloudCover"`
	Multi_Resolution     string `json:"multiResolution"`
	Vendor_Name          string `json:"vendorName"`
	Off_Nadir_Angle      string `json:"offNadirAngle"`
	Pan_Resolution       string `json:"panResolution"`
	Catalog_ID           string `json:"catalogID"`
	Image_Bands          string `json:"imageBands"`
	FootprintWkt         string `json:"footprintWkt"`
	Timestamp            string `json:"timestamp"`
}

Acquisition holds the ID, state, and location (an s3 path) of the catalog id.

type Result_Parent

type Result_Parent struct {
	Records   []Record `json:"results"`
	SearchTag string   `json:"searchTag,omitempty"`
}

Results from search holds results, searchTag and stats.

type Search_Json

type Search_Json struct {
	SearchAreaWkt string   `json:"searchAreaWkt,omitempty"`
	StartDate     string   `json:"startDate"`
	EndDate       string   `json:"endDate"`
	Types         []string `json:"types,omitempty"`
	Filters       []string `json:"filters,omitempty"`
	Limit         int      `json:"limit,omitempty"`
}

Search criteria holds stardDate, endDate, types and AOI.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL