tides

package
v0.0.0-...-4b68fce Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTidesToSearchResults

func AddTidesToSearchResults(context *Context, results []model.BrokerSearchResult) error

AddTidesToSearchResults does an *in-place* modification of the input broker search results to augment them with tides data

func CreateMockTidesServer

func CreateMockTidesServer() *httptest.Server

CreateMockTidesServer creates a mocked Tides server instance This is exported because it is needed in testing the planet module

func GetSingleTidesData

func GetSingleTidesData(context *Context, target model.BasicBrokerResult) (*model.TidesData, error)

func GetTides

func GetTides(fc *geojson.FeatureCollection, context *Context) (*geojson.FeatureCollection, error)

GetTides returns the tide information for the features provided. Features must have a geometry and an acquiredDate property.

func OutputToTidesData

func OutputToTidesData(output Output) []model.TidesData

Types

type Context

type Context struct {
	TidesURL string
	// contains filtered or unexported fields
}

Context is the context for this operation

func (*Context) AppName

func (c *Context) AppName() string

AppName returns an empty string

func (*Context) LogRootDir

func (c *Context) LogRootDir() string

LogRootDir returns an empty string

func (*Context) SessionID

func (c *Context) SessionID() string

SessionID returns a Session ID, creating one if needed

type Input

type Input struct {
	Locations []InputLocation `json:"locations"`
}

func InputForBasicBrokerResults

func InputForBasicBrokerResults(results []model.BasicBrokerResult) (*Input, error)

type InputLocation

type InputLocation struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
	Dtg string  `json:"dtg"`
}

func InputLocationForFeature

func InputLocationForFeature(feature *geojson.Feature, acquiredDate time.Time) InputLocation

type Output

type Output struct {
	Locations []OutputLocation `json:"locations"`
}

func QueryMultipleTides

func QueryMultipleTides(context *Context, input Input) (*Output, error)

type OutputData

type OutputData struct {
	MinTide  float64 `json:"minimumTide24Hours"`
	MaxTide  float64 `json:"maximumTide24Hours"`
	CurrTide float64 `json:"currentTide"`
}

type OutputLocation

type OutputLocation struct {
	Lat     float64    `json:"lat"`
	Lon     float64    `json:"lon"`
	Dtg     string     `json:"dtg"`
	Results OutputData `json:"results"`
}

Jump to

Keyboard shortcuts

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