stac

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CollectionKey = "collection"
View Source
var Conformance = []string{
	"http://www.opengis.net/spec/cql2/1.0/conf/basic-cql2",
	"http://www.opengis.net/spec/cql2/1.0/conf/cql2-json",

	"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core",
	"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson",
	"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30",
	"http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/filter",
	"http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter",
	"https://api.stacspec.org/v1.0.0/collections",
	"https://api.stacspec.org/v1.0.0/core",
	"https://api.stacspec.org/v1.0.0-rc.3/browseable",
	"https://api.stacspec.org/v1.0.0/item-search",
	"https://api.stacspec.org/v1.0.0-rc.2/item-search#context",
	"https://api.stacspec.org/v1.0.0-rc.3/item-search#fields",
	"https://api.stacspec.org/v1.0.0-rc.2/item-search#filter",
	"https://api.stacspec.org/v1.0.0-rc.2/item-search#query",
	"https://api.stacspec.org/v1.0.0-rc.2/item-search#sort",
	"https://api.stacspec.org/v1.0.0/ogcapi-features",
	"https://api.stacspec.org/v1.0.0-rc.3/ogcapi-features#fields",
	"https://api.stacspec.org/v1.0.0-rc.2/ogcapi-features#sort",
	"https://api.stacspec.org/v1.0.0-rc.2/ogcapi-features/extensions/transaction",
	"http://www.opengis.net/spec/ogcapi-features-4/1.0/conf/simpletx",
}
View Source
var DatabaseError = "DatabaseError"
View Source
var JSONParsingError = "JSONParsingError"
View Source
var NotFoundError = "NotFoundError"
View Source
var ParameterError = "ParameterError"
View Source
var ServerError = "ServerError"

Functions

func ValidateCollectionIDsMatch

func ValidateCollectionIDsMatch(c *fiber.Ctx, obj map[string]*json.RawMessage, expected string) error

func ValidateID

func ValidateID(c *fiber.Ctx, obj map[string]*json.RawMessage) (string, error)

Types

type CQL

type CQL struct {
	Collections []string         `json:"collections,omitempty"`
	Ids         []string         `json:"ids,omitempty"`
	Bbox        []float64        `json:"bbox,omitempty"`
	Intersects  *GeoJSON         `json:"intersects,omitempty"`
	DateTime    string           `json:"datetime,omitempty"`
	Limit       int              `json:"limit"`
	Conf        *json.RawMessage `json:"conf,omitempty"`
	Query       *json.RawMessage `json:"query,omitempty"`
	Fields      *CQLFields       `json:"fields,omitempty"`
	SortBy      []CQLSort        `json:"sortby,omitempty"`
	Filter      *json.RawMessage `json:"filter,omitempty"`
	FilterLang  string           `json:"filter-lang"`
	Token       string           `json:"token,omitempty"`
}

type CQLFields

type CQLFields struct {
	Include []string `json:"include"`
	Exclude []string `json:"exclude"`
}

type CQLSort

type CQLSort struct {
	Field     string `json:"field"`
	Direction string `json:"direction"`
}

type Catalog

type Catalog struct {
	Type        string   `json:"type"`
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Description string   `json:"description"`
	StacVersion string   `json:"stac_version"`
	ConformsTo  []string `json:"conformsTo"`
	Links       []Link   `json:"links"`
}

type GeoJSON

type GeoJSON struct {
	Type        string           `json:"type"`
	Coordinates *json.RawMessage `json:"coordinates"`
}
type Link struct {
	Rel    string           `json:"rel"`
	Type   string           `json:"type"`
	Title  string           `json:"title,omitempty"`
	Href   string           `json:"href"`
	Method string           `json:"method,omitempty"`
	Body   *json.RawMessage `json:"body,omitempty"`
}
func AddLink(links []Link, baseURL string, rel string, endpoint string, mimeType string) []Link

AddLink creates a new link reference in the Links array of a Feature rel is the name of the link relationship baseUrl baseUrl of this STAC server endpoint is the last portion of the URL i.e. <base url>/api/stac/v1/<endpoint>

func AddLinkPost

func AddLinkPost(links []Link, baseURL string, rel string, endpoint string, mimeType string, body *json.RawMessage) []Link

AddLinkPost creates a new link reference in the Links array of a Feature rel is the name of the link relationship baseUrl baseUrl of this STAC server endpoint is the last portion of the URL i.e. <base url>/api/stac/v1/<endpoint>

type Message

type Message struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

type SearchResponse

type SearchResponse struct {
	Context  *json.RawMessage              `json:"context"`
	Type     string                        `json:"string"`
	Features []map[string]*json.RawMessage `json:"features"`
	Next     string                        `json:"next"`
	Prev     string                        `json:"prev"`
}
func Search(params CQL) (*SearchResponse, error)

Item returns details of a specific item

Jump to

Keyboard shortcuts

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