Documentation ¶
Index ¶
- Constants
- Variables
- func CastDataset(ctx context.Context, ds *godal.Dataset, ...) (*godal.Dataset, error)
- func DatasetToPngAsBytes(ctx context.Context, ds *godal.Dataset, fromDFormat geocube.DataMapping, ...) ([]byte, error)
- func DatasetToTiffAsBytes(ds *godal.Dataset, fromDFormat geocube.DataMapping, tags map[string]string, ...) ([]byte, error)
- func MergeDatasets(ctx context.Context, datasets []*Dataset, outDesc *GdalDatasetDescriptor) (*godal.Dataset, error)
- func WarpedExtent(ctx context.Context, datasets []*Dataset, wktCRS string, resx, resy float64) ([4]float64, error)
- type CogGenerator
- type Dataset
- type ErrorConst
- type FileToDownload
- type GdalDatasetDescriptor
- type Handler
- type MucogGenerator
Constants ¶
View Source
const ( TaskCancelledConsolidationError = ErrorConst("consolidation event is cancelled") NotImplementedError = ErrorConst("consolidation without interleave records is not supported") )
Variables ¶
View Source
var ( ErrNoCastToPerform = errors.New("no cast to perform") ErrUnableToCast = errors.New("unableToCast") )
View Source
var ErrLoger = godal.ErrLogger(func(ec godal.ErrorCategory, code int, msg string) error { if ec <= godal.CE_Warning { return nil } return fmt.Errorf("GDAL %d: %s", code, msg) })
Functions ¶
func CastDataset ¶
func CastDataset(ctx context.Context, ds *godal.Dataset, fromDFormat, toDFormat geocube.DataMapping, dstDS string) (*godal.Dataset, error)
CastDataset creates a new dataset and cast fromDFormat toDFormat The caller is responsible to close the dataset fromDFormat: NoData is ignored dstDS [optional] If empty, the dataset is stored in memory
func DatasetToPngAsBytes ¶
func DatasetToPngAsBytes(ctx context.Context, ds *godal.Dataset, fromDFormat geocube.DataMapping, palette *geocube.Palette, interpolateColor bool) ([]byte, error)
DatasetToPngAsBytes translates the dataset to a png and returns the byte representation interpolateColor is true if dataset pixel value can be interpolated
func DatasetToTiffAsBytes ¶
func DatasetToTiffAsBytes(ds *godal.Dataset, fromDFormat geocube.DataMapping, tags map[string]string, palette *geocube.Palette) ([]byte, error)
DatasetToTiffAsBytes translates the dataset to a tiff and returns the byte representation
func MergeDatasets ¶
func MergeDatasets(ctx context.Context, datasets []*Dataset, outDesc *GdalDatasetDescriptor) (*godal.Dataset, error)
MergeDatasets merge the given datasets into one in the format defined by outDesc The caller is responsible to close the output dataset
Types ¶
type CogGenerator ¶
type CogGenerator interface { Create(dataset *godal.Dataset, oContainer geocube.ConsolidationContainer, recordId, workDir string) (string, error) Open(ctx context.Context, filePath string) (*godal.Dataset, error) }
func NewCogGenerator ¶
func NewCogGenerator() CogGenerator
type Dataset ¶ added in v0.3.0
type Dataset struct { URI string SubDir string Bands []int64 DataMapping geocube.DataMapping }
type ErrorConst ¶ added in v0.3.0
type ErrorConst string
func (ErrorConst) Error ¶ added in v0.3.0
func (e ErrorConst) Error() string
type FileToDownload ¶
type FileToDownload struct { URI uri.DefaultUri LocalURI string }
type GdalDatasetDescriptor ¶
type Handler ¶
type Handler interface {
Consolidate(ctx context.Context, cEvent *geocube.ConsolidationEvent, workspace string) error
}
func NewHandleConsolidation ¶
func NewHandleConsolidation(c CogGenerator, m MucogGenerator, cancelledJobsStorage string, workers int, localDownload bool) Handler
type MucogGenerator ¶
type MucogGenerator interface {
Create(workDir string, cogListFile []string, interlacingPattern string) (string, error)
}
func NewMucogGenerator ¶
func NewMucogGenerator() MucogGenerator
Click to show internal directories.
Click to hide internal directories.