earthsearch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package earthsearch is the library behind the earthsearch command line: the HTTP client, wire types, and typed data models for the AWS Earth Search STAC API (SpatioTemporal Asset Catalog).

Index

Constants

View Source
const BaseURL = "https://earth-search.aws.element84.com/v1"
View Source
const Host = "earth-search.aws.element84.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client talks to the Earth Search STAC API.

func NewClient

func NewClient() *Client

NewClient returns a Client with default config.

func NewClientAt

func NewClientAt(baseURL string) *Client

NewClientAt returns a Client targeting a custom base URL (useful in tests).

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) ([]*Collection, error)

ListCollections returns all available satellite imagery collections.

func (*Client) ListCollectionsAt

func (c *Client) ListCollectionsAt(ctx context.Context, baseURL string) ([]*Collection, error)

ListCollectionsAt is like ListCollections but targets a custom base URL (useful in tests).

func (*Client) SearchItems

func (c *Client) SearchItems(ctx context.Context, collections []string, limit int, nextToken string) ([]*Item, int, string, error)

SearchItems posts a STAC search request and returns (items, totalMatched, nextToken, error).

func (*Client) SearchItemsAt

func (c *Client) SearchItemsAt(ctx context.Context, baseURL string, collections []string, limit int, nextToken string) ([]*Item, int, string, error)

SearchItemsAt is like SearchItems but targets a custom base URL (useful in tests).

type Collection

type Collection struct {
	ID          string `json:"id"           kit:"id"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

Collection is a named group of satellite imagery scenes.

type Config

type Config struct {
	BaseURL   string
	Rate      time.Duration
	Retries   int
	Timeout   time.Duration
	UserAgent string
}

Config holds tunable knobs for a Client.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns sensible defaults.

type Domain

type Domain struct{}

Domain is the earthsearch driver for the AWS Earth Search STAC API.

func (Domain) Classify

func (Domain) Classify(input string) (string, string, error)

func (Domain) Info

func (Domain) Info() kit.DomainInfo

func (Domain) Locate

func (Domain) Locate(uriType, id string) (string, error)

func (Domain) Register

func (Domain) Register(app *kit.App)

type Item

type Item struct {
	ID            string  `json:"id"                kit:"id"`
	Collection    string  `json:"collection,omitempty"`
	DateTime      string  `json:"datetime,omitempty"`
	Platform      string  `json:"platform,omitempty"`
	Constellation string  `json:"constellation,omitempty"`
	CloudCover    float64 `json:"cloud_cover,omitempty"`
	BBoxMinLon    float64 `json:"bbox_min_lon,omitempty"`
	BBoxMinLat    float64 `json:"bbox_min_lat,omitempty"`
	BBoxMaxLon    float64 `json:"bbox_max_lon,omitempty"`
	BBoxMaxLat    float64 `json:"bbox_max_lat,omitempty"`
	Thumbnail     string  `json:"thumbnail,omitempty"`
}

Item is a single STAC item (satellite imagery scene).

Jump to

Keyboard shortcuts

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