Documentation ¶
Index ¶
- Constants
- Variables
- func Code(err error) codes.Code
- func GeometryFromAOI(aoi AOI) geojson.Geometry
- func GroupBy(records []*Record, funcKey GroupByKeyFunc) [][]string
- func GroupByDayKey(record *Record) string
- type AOI
- type Client
- func (c Client) AddRecordsTags(ctx context.Context, ids []string, tags map[string]string) (int64, error)
- func (c Client) CancelJob(ctx context.Context, jobID string) error
- func (c Client) CleanJobs(ctx context.Context, nameLike, state string) (int32, error)
- func (c Client) ConfigConsolidation(ctx context.Context, variableID string, dformat *DataFormat, exponent float64, ...) error
- func (c Client) ConsolidateDatasetsFromFilters(ctx context.Context, name string, instanceID, layoutName string, ...) (string, error)
- func (c Client) ConsolidateDatasetsFromRecords(ctx context.Context, name string, instanceID, layoutName string, ...) (string, error)
- func (c Client) CreateAOI(ctx context.Context, g AOI) (string, error)
- func (c Client) CreateLayout(ctx context.Context, name string, gridFlags []string, ...) error
- func (c Client) CreatePalette(ctx context.Context, name string, colors []ColorPoint, replace bool) error
- func (c Client) CreateRecord(ctx context.Context, name, aoiID string, date time.Time, ...) ([]string, error)
- func (c Client) CreateRecords(ctx context.Context, names, aoiIDs []string, dates []time.Time, ...) ([]string, error)
- func (c Client) CreateVariable(ctx context.Context, name, unit, description string, dformat *DataFormat, ...) (string, error)
- func (c Client) DeleteInstance(ctx context.Context, instanceID string) error
- func (c Client) DeleteRecords(ctx context.Context, ids []string) (int64, error)
- func (c Client) DeleteVariable(ctx context.Context, variableID string) error
- func (c Client) GetAOI(ctx context.Context, aoiID string) (AOI, error)
- func (c Client) GetConsolidationParams(ctx context.Context, variableID string) (*ConsolidationParams, error)
- func (c Client) GetCubeFromFilters(ctx context.Context, tags map[string]string, fromTime, toTime time.Time, ...) (*CubeIterator, error)
- func (c Client) GetCubeFromGroupedRecords(ctx context.Context, recordsID [][]string, instanceID string, crs string, ...) (*CubeIterator, error)
- func (c Client) GetCubeFromRecords(ctx context.Context, recordsID []string, instanceID string, crs string, ...) (*CubeIterator, error)
- func (c Client) GetCubeFromTile(ctx context.Context, tile *Tile, instanceID string, recordIDs []string, ...) (*CubeIterator, error)
- func (clt *Client) GetDownloaderClient() DownloaderClient
- func (c Client) GetJob(ctx context.Context, jobID string) (*Job, error)
- func (c Client) GetVariable(ctx context.Context, id string) (*Variable, error)
- func (c Client) GetVariableFromInstanceID(ctx context.Context, id string) (*VariableInstance, error)
- func (c Client) GetVariableFromName(ctx context.Context, name string) (*Variable, error)
- func (c Client) IndexDataset(ctx context.Context, uri string, managed bool, ...) error
- func (c Client) IndexDatasets(ctx context.Context, uri string, managed bool, datasets []*pb.Dataset) error
- func (c Client) InstantiateVariable(ctx context.Context, variableID, name string, metadata map[string]string) (string, error)
- func (c Client) ListJobs(ctx context.Context, nameLike string) ([]*Job, error)
- func (c Client) ListLayouts(ctx context.Context, nameLike string) ([]*Layout, error)
- func (c Client) ListRecords(ctx context.Context, name string, tags map[string]string, aoi AOI, ...) ([]*Record, error)
- func (c Client) ListVariables(ctx context.Context, namelike string, limit, page int) ([]Variable, error)
- func (c Client) RemoveRecordsTags(ctx context.Context, ids []string, tags []string) (int64, error)
- func (c Client) RetryJob(ctx context.Context, jobID string, forceAnyState bool) error
- func (c *Client) ServerVersion(ctx context.Context) (string, error)
- func (c Client) TileAOI(ctx context.Context, aoi AOI, layoutName string, layout *Layout) (<-chan Tile, error)
- func (c Client) UpdateInstance(ctx context.Context, instanceID string, name *string, ...) error
- func (c Client) UpdateVariable(ctx context.Context, id string, ...) error
- type ClientConnector
- type ClientStream
- type ColorPoint
- type Connector
- type ConsolidationParams
- type CubeElem
- type CubeHeader
- type CubeIterator
- type CubeResponse
- type CubeStream
- type DataFormat
- type DatasetMeta
- type DownloaderClient
- type DownloaderConnector
- type DownloaderStream
- type Format
- type GroupByKeyFunc
- type InternalMeta
- type Job
- type Layout
- type Record
- type Tile
- type TokenAuth
- type Variable
- func (v *Variable) Instance(name string) *VariableInstance
- func (v *Variable) SetDescription(ctx context.Context, description string) error
- func (v *Variable) SetName(ctx context.Context, name string) error
- func (v *Variable) SetPalette(ctx context.Context, palette string) error
- func (v *Variable) SetResamplingAlg(ctx context.Context, resamplingAlg string) error
- func (v *Variable) SetUnit(ctx context.Context, unit string) error
- func (v *Variable) ToString() string
- type VariableInstance
Constants ¶
const ( Format_Raw = Format(pb.FileFormat_Raw) Format_GTiff = Format(pb.FileFormat_GTiff) )
const ( // AuthorizationHeader is the header key to get the authorization token AuthorizationHeader = "authorization" // ESRIAuthorizationHeader is the header key to get the authorization token ESRIAuthorizationHeader = "X-Esri-Authorization" )
Variables ¶
var COGPattern = "R>Z=1:>T>B;R>Z=0>T>B"
var MUCOGPattern = "Z=0>T>R>B;R>Z=1:>T>B"
Functions ¶
func GeometryFromAOI ¶
GeometryFromAOI converts an AOI to a geometry
func GroupBy ¶ added in v1.0.0
func GroupBy(records []*Record, funcKey GroupByKeyFunc) [][]string
GroupBy groups the records of the list by the key provided by the func_key(Record) Returns a list of grouped records ID
func GroupByDayKey ¶ added in v1.0.0
Types ¶
type AOI ¶
type AOI [][][][2]float64
func AOIFromFile ¶
AOIFromFile extracts the geometry from the given file. For Geojson File : it merges all the polygons and multipolygons into one multipolygon If provided, the CRS is ignored
func AOIFromGeometry ¶
AOIFromGeometry converts a geometry to an AOI
func AOIFromMultiPolygonArray ¶
AOIFromMultiPolygonArray converts a multipolygon as an array to an AOI
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AddRecordsTags ¶
func (c Client) AddRecordsTags(ctx context.Context, ids []string, tags map[string]string) (int64, error)
AddRecordsTags add or update existing tag form list of records returns the number of updated records
func (Client) CleanJobs ¶
CleanJobs removes the terminated jobs nameLike, state : [optional] filter by name or state (DONE/FAILED)
func (Client) ConfigConsolidation ¶
func (c Client) ConfigConsolidation(ctx context.Context, variableID string, dformat *DataFormat, exponent float64, compression int, resamplingAlg string, storageClass int) error
ConfigConsolidation configures the parameters associated to this variable
func (Client) ConsolidateDatasetsFromFilters ¶
func (c Client) ConsolidateDatasetsFromFilters(ctx context.Context, name string, instanceID, layoutName string, tags map[string]string, fromTime, toTime time.Time) (string, error)
ConsolidateDatasetsFromFilters starts a consolidation job of the datasets defined by the given parameters
func (Client) ConsolidateDatasetsFromRecords ¶
func (c Client) ConsolidateDatasetsFromRecords(ctx context.Context, name string, instanceID, layoutName string, recordsID []string) (string, error)
ConsolidateDatasetsFromRecords starts a consolidation job of the datasets defined by the given parameters
func (Client) CreateAOI ¶
CreateAOI creates an aoi from a geometry If error EntityAlreadyExists, returns the id of the existing one and the error.
func (Client) CreateLayout ¶
func (Client) CreatePalette ¶
func (c Client) CreatePalette(ctx context.Context, name string, colors []ColorPoint, replace bool) error
CreatePalette defines (or redefines) a palette as a ramp of colors
func (Client) CreateRecord ¶ added in v0.4.0
func (c Client) CreateRecord(ctx context.Context, name, aoiID string, date time.Time, tags map[string]string) ([]string, error)
CreateRecord creates a record with an aoi, a name and a date
func (Client) CreateRecords ¶
func (c Client) CreateRecords(ctx context.Context, names, aoiIDs []string, dates []time.Time, tags []map[string]string) ([]string, error)
CreateRecords creates a batch of records with aois, names and dates
func (Client) CreateVariable ¶
func (c Client) CreateVariable(ctx context.Context, name, unit, description string, dformat *DataFormat, bandsName []string, palette, resamplingAlg string) (string, error)
CreateVariable creates a variable
func (Client) DeleteInstance ¶
DeleteInstance deletes the Instance if and only if it's a pending instance (with no datasets) DeleteInstance does not delete the Variable
func (Client) DeleteRecords ¶
DeleteRecords deletes a batch of records iif no dataset has reference on Returns the number of deleted records
func (Client) DeleteVariable ¶
DeleteVariable deletes the Variable and all its instances if and only if all instances are pending
func (Client) GetConsolidationParams ¶
func (c Client) GetConsolidationParams(ctx context.Context, variableID string) (*ConsolidationParams, error)
GetConsolidationParams read the consolidation parameters associated to this variable
func (Client) GetCubeFromFilters ¶ added in v1.0.0
func (c Client) GetCubeFromFilters(ctx context.Context, tags map[string]string, fromTime, toTime time.Time, instanceID string, crs string, pix2crs [6]float64, sizeX, sizeY int32, format Format, compression int, headersOnly bool) (*CubeIterator, error)
GetCubeFromFilters gets a cube from a list of filters
func (Client) GetCubeFromGroupedRecords ¶ added in v1.0.0
func (c Client) GetCubeFromGroupedRecords(ctx context.Context, recordsID [][]string, instanceID string, crs string, pix2crs [6]float64, sizeX, sizeY int32, format Format, compression int, headersOnly bool) (*CubeIterator, error)
GetCubeFromGroupedRecords gets a cube from a list of grouped records
func (Client) GetCubeFromRecords ¶
func (c Client) GetCubeFromRecords(ctx context.Context, recordsID []string, instanceID string, crs string, pix2crs [6]float64, sizeX, sizeY int32, format Format, compression int, headersOnly bool) (*CubeIterator, error)
GetCubeFromRecords gets a cube from a list of records
func (Client) GetCubeFromTile ¶ added in v0.4.0
func (c Client) GetCubeFromTile(ctx context.Context, tile *Tile, instanceID string, recordIDs []string, gRecordIDs [][]string, tags map[string]string, fromTime, toTime time.Time, format Format, compression int, headersOnly bool) (*CubeIterator, error)
GetCubeFromTile gets a cube from a tile and a list of records or filters
func (*Client) GetDownloaderClient ¶ added in v0.4.0
func (clt *Client) GetDownloaderClient() DownloaderClient
func (Client) GetVariable ¶
GetVariable returns the variable that id
func (Client) GetVariableFromInstanceID ¶
func (c Client) GetVariableFromInstanceID(ctx context.Context, id string) (*VariableInstance, error)
GetVariableFromInstanceID returns the variable & instance with that instance id
func (Client) GetVariableFromName ¶
GetVariableFromName returns the variable with that name
func (Client) IndexDataset ¶
func (c Client) IndexDataset(ctx context.Context, uri string, managed bool, containerSubdir, recordID, instanceID string, bands []int64, dformat *DataFormat, realMin, realMax, exponent float64) error
IndexDataset indexes a dataset
func (Client) IndexDatasets ¶
func (c Client) IndexDatasets(ctx context.Context, uri string, managed bool, datasets []*pb.Dataset) error
IndexDatasets indexes a batch of datasets
func (Client) InstantiateVariable ¶
func (c Client) InstantiateVariable(ctx context.Context, variableID, name string, metadata map[string]string) (string, error)
InstantiateVariable instantiates a variable with name and metadata
func (Client) ListLayouts ¶
func (Client) ListRecords ¶
func (c Client) ListRecords(ctx context.Context, name string, tags map[string]string, aoi AOI, fromTime, toTime time.Time, limit, page int, returnAOI bool) ([]*Record, error)
ListRecords lists records that fit the search parameters (all are optionnal)
func (Client) ListVariables ¶
func (c Client) ListVariables(ctx context.Context, namelike string, limit, page int) ([]Variable, error)
ListVariables returns a list of variables that fit the search parameters
func (Client) RemoveRecordsTags ¶
AddRecordsTags delete tags from list of records returns the number of updated records
func (*Client) ServerVersion ¶
ServerVersion returns the version of the Geocube serveur
type ClientConnector ¶ added in v0.4.0
type ClientConnector struct { Connector DownloaderConnector *DownloaderConnector }
func (*ClientConnector) Dial ¶ added in v0.4.0
func (c *ClientConnector) Dial() (Client, error)
Dial creates a new client connected to the server
type ClientStream ¶ added in v0.4.0
type ClientStream struct{ pb.Geocube_GetCubeClient }
func (ClientStream) Recv ¶ added in v0.4.0
func (s ClientStream) Recv() (CubeResponse, error)
type ColorPoint ¶
type ColorPoint pb.ColorPoint
type Connector ¶ added in v0.4.0
type Connector struct { Server string Creds credentials.TransportCredentials ApiKey string }
type ConsolidationParams ¶
type ConsolidationParams pb.ConsolidationParams
type CubeElem ¶
type CubeElem struct { Data []byte Shape [3]int32 DType pb.DataFormat_Dtype Records []*Record DatasetsMeta *DatasetMeta Order pb.ByteOrder Err string }
type CubeHeader ¶
type CubeHeader struct { Count int64 NbDatasets int64 RefDformat *DataFormat ResamplingAlg pb.Resampling Geotransform *pb.GeoTransform Crs string Width, Height int32 }
type CubeIterator ¶
type CubeIterator struct {
// contains filtered or unexported fields
}
func NewCubeIterator ¶
func NewCubeIterator(stream CubeStream, width, height int32) (*CubeIterator, error)
func (*CubeIterator) Err ¶
func (cit *CubeIterator) Err() error
Err returns the error if the iterator failed to go to next Element.
func (*CubeIterator) Next ¶
func (cit *CubeIterator) Next() bool
Next loads the next element of the cube and returns true. It returns false if there is no more elements or an error occured. In the latter case, check .Err().
func (*CubeIterator) Value ¶
func (cit *CubeIterator) Value() *CubeElem
Value returns a pointer to the current element. The pointer remains valid as long as cubeiterator is. The value is updated when cit.Next() is called. Check CubeElem.Err for a potential error on this element.
type CubeResponse ¶ added in v0.4.0
type CubeResponse interface { GetGlobalHeader() *pb.GetCubeResponseHeader GetHeader() *pb.ImageHeader GetChunk() *pb.ImageChunk }
type CubeStream ¶ added in v0.4.0
type CubeStream interface {
Recv() (CubeResponse, error)
}
type DataFormat ¶ added in v0.4.0
type DataFormat pb.DataFormat
func ToDFormat ¶ added in v0.4.0
func ToDFormat(s string) (*DataFormat, error)
ToDFormat returns a DataFormat from the user-defined string Format is "datatype,nodata,min,max" with datatype in {"byte, uint8, uint16, uint32, int8,int16, int32, float32, float64, complex64, auto, u1, u2, u4, i1, i2, i4, f4, f8, c8"} with nodata, min and max as float value
type DatasetMeta ¶ added in v0.4.0
type DatasetMeta struct {
Internals []*InternalMeta
}
type DownloaderClient ¶ added in v0.4.0
type DownloaderClient struct {
// contains filtered or unexported fields
}
func (DownloaderClient) DownloadCube ¶ added in v0.4.0
func (d DownloaderClient) DownloadCube(ctx context.Context, iter *CubeIterator, format Format) (*CubeIterator, error)
type DownloaderConnector ¶ added in v0.4.0
type DownloaderConnector Connector
func (*DownloaderConnector) Dial ¶ added in v0.4.0
func (dl *DownloaderConnector) Dial() (DownloaderClient, error)
Dial creates a new downloader client connected to a downloader service
type DownloaderStream ¶ added in v0.4.0
type DownloaderStream struct {
pb.GeocubeDownloader_DownloadCubeClient
}
func (DownloaderStream) Recv ¶ added in v0.4.0
func (s DownloaderStream) Recv() (CubeResponse, error)
type Format ¶
type Format pb.FileFormat
type GroupByKeyFunc ¶ added in v1.0.0
convert types take an int and return a string value.
type InternalMeta ¶ added in v0.4.0
type InternalMeta struct { ContainerURI string ContainerSubDir string Bands []int64 InternalDataFormat *DataFormat ExternalMinValue float64 ExternalMaxValue float64 Exponent float64 }
func NewInternalMetaFromPb ¶ added in v0.4.0
func NewInternalMetaFromPb(prtb *pb.InternalMeta) *InternalMeta
type Layout ¶
func NewRegularLayout ¶ added in v0.4.0
type Record ¶
type Tile ¶
type Tile struct { Transform [6]float64 CRS string Width, Height int32 // contains filtered or unexported fields }
func NewTileFromPb ¶
type TokenAuth ¶
type TokenAuth struct {
Token string
}
TokenAuth to use with grpc.WithPerRPCCredentials
func (TokenAuth) GetRequestMetadata ¶
func (t TokenAuth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
GetRequestMetadata implements grpc.PerRPCCredentials
func (TokenAuth) RequireTransportSecurity ¶
RequireTransportSecurity implements grpc.PerRPCCredentials
type Variable ¶
func (*Variable) Instance ¶
func (v *Variable) Instance(name string) *VariableInstance
Instance returns a VariableInstance or nil if the instance does not exist
func (*Variable) SetDescription ¶
SetDescription sets the description of the variable
func (*Variable) SetPalette ¶
SetPalette sets the name of the palette. Empty string removes the palette
func (*Variable) SetResamplingAlg ¶
SetResamplingAlg sets the algorithm used for resampling