processor

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 38 Imported by: 2

Documentation

Index

Constants

View Source
const DecileNamespace = "_d%d"
View Source
const DefaultMASConcQuery = 32
View Source
const DefaultMASMaxConnsPerHost = 256
View Source
const DefaultMaxLogLength = 3000
View Source
const DrillTargetSRS = "EPSG:4326"
View Source
const ISOFormat = "2006-01-02T15:04:05.000Z"

ISOFormat is the string used to format Go ISO times

View Source
const SizeofFloat32 = 4
View Source
const SizeofInt16 = 2
View Source
const SizeofUint16 = 2

Variables

This section is empty.

Functions

func BBox2Geot

func BBox2Geot(width, height int, bbox []float64) []float64

BBox2Geot return the geotransform from the parameters received in a WMS GetMap request

func BBox2WKT

func BBox2WKT(bbox []float64) string

func ComputeMask

func ComputeMask(mask *utils.Mask, data []byte, rType string) (out []bool, err error)

func ComputeReprojectionExtent

func ComputeReprojectionExtent(ctx context.Context, geoReq *GeoTileRequest, masAddress string, workerNodes []string, epsg int, bbox []float64, verbose bool) (int, int, error)

func GetFeatureInfo

func GetFeatureInfo(ctx context.Context, params utils.WMSParams, conf *utils.Config, configMap map[string]*utils.Config, verbose bool, metricsCollector *metrics.MetricsCollector) (string, error)

func GradientRGBAPalette

func GradientRGBAPalette(palette *utils.Palette) ([]color.RGBA, error)

GradientRGBAPalette returns a palette of 256 colors creating an interpolation that goes though a list of provided colours.

func InterpolateColor

func InterpolateColor(a, b color.RGBA, i, sectionLength int) color.RGBA

InterpolateColor returns an RGBA color where the R, G, B, and A components have been interpolated from the 'a' and 'b' colors

func InterpolateUint8

func InterpolateUint8(a, b uint8, i, sectionLength int) uint8

InterpolateUint8 interpolates the value of a byte between two numbers 'a' and 'b' by especifying a length and a position 'i' along that length.

func MergeMaskedRaster

func MergeMaskedRaster(r *FlexRaster, canvasMap map[string]*FlexRaster, mask []bool) (err error)

func ProcessRasterStack

func ProcessRasterStack(rasterStack map[float64][]*FlexRaster, maskMap map[float64][]bool, canvasMap map[string]*FlexRaster) (map[string]*FlexRaster, error)

Types

type ByteRaster

type ByteRaster struct {
	ConfigPayLoad
	Data          []uint8
	Height, Width int
	OffX, OffY    int
	NoData        float64
	NameSpace     string
}

func (*ByteRaster) GetNoData

func (br *ByteRaster) GetNoData() float64

type ConcLimiter

type ConcLimiter struct {
	*sync.WaitGroup
	Pool chan struct{}
}

func NewConcLimiter

func NewConcLimiter(cLevel int) *ConcLimiter

func (*ConcLimiter) Decrease

func (c *ConcLimiter) Decrease()

func (*ConcLimiter) Increase

func (c *ConcLimiter) Increase()

type ConfigPayLoad

type ConfigPayLoad struct {
	NameSpaces            []string
	BandExpr              *utils.BandExpressions
	ScaleParams           ScaleParams
	Palette               *utils.Palette
	Mask                  *utils.Mask
	ZoomLimit             float64
	PolygonSegments       int
	GrpcConcLimit         int
	PolygonSharcConcLimit int
	QueryLimit            int
	UserSrcGeoTransform   int
	UserSrcSRS            int
	NoReprojection        bool
	AxisMapping           int
	GrpcTileXSize         float64
	GrpcTileYSize         float64
	IndexTileXSize        float64
	IndexTileYSize        float64
	SpatialExtent         []float64
	IndexResLimit         float64
	MasQueryHint          string
	ReqRes                float64
	SRSCf                 int
	FusionUnscale         int
	MetricsCollector      *metrics.MetricsCollector
}

type DatasetAxis

type DatasetAxis struct {
	Name               string    `json:"name"`
	Params             []float64 `json:"params"`
	Strides            []int     `json:"strides"`
	Shape              []int     `json:"shape"`
	Grid               string    `json:"grid"`
	IntersectionIdx    []int
	IntersectionValues []float64
	Order              int
	Aggregate          int
}

type DrillFileDescriptor

type DrillFileDescriptor struct {
	OffX, OffY     int
	CountX, CountY int
	NoData         float64
	Mask           *image.Gray
}

type DrillIndexer

type DrillIndexer struct {
	Context     context.Context
	In          chan *GeoDrillRequest
	Out         chan *GeoDrillGranule
	Error       chan error
	APIAddress  string
	IdentityTol float64
	DpTol       float64
	Approx      bool
}

func NewDrillIndexer

func NewDrillIndexer(ctx context.Context, apiAddr string, identityTol float64, dpTol float64, approx bool, errChan chan error) *DrillIndexer

func (*DrillIndexer) Run

func (p *DrillIndexer) Run(verbose bool)

type DrillMerger

type DrillMerger struct {
	Context context.Context
	In      chan *DrillResult
	Out     chan string
	Error   chan error
}

func NewDrillMerger

func NewDrillMerger(ctx context.Context, errChan chan error) *DrillMerger

func (*DrillMerger) Run

func (dm *DrillMerger) Run(suffix string, namespaces []string, templateFileName string, bandExpr *utils.BandExpressions, decileCount int, verbose bool)

type DrillPipeline

type DrillPipeline struct {
	Context     context.Context
	Error       chan error
	RPCAddrs    []string
	APIAddr     string
	IdentityTol float64
	DpTol       float64
}

func InitDrillPipeline

func InitDrillPipeline(ctx context.Context, apiAddr string, rpcAddrs []string, identityTol float64, dpTol float64, errChan chan error) *DrillPipeline

func (*DrillPipeline) Process

func (dp *DrillPipeline) Process(geoReq GeoDrillRequest, suffix string, templateFileName string, bandStrides int, approx bool, drillAlgorithm string, verbose bool) chan string

type DrillResult

type DrillResult struct {
	NameSpace string
	Dates     []time.Time
	Data      []*pb.TimeSeries
	NoData    float64
}

type FileCrawler

type FileCrawler struct {
	In    chan string
	Out   chan string
	Error chan error
	// contains filtered or unexported fields
}

func NewFileCrawler

func NewFileCrawler(rootPath string, contains *regexp.Regexp, errChan chan error) *FileCrawler

func (*FileCrawler) Run

func (fc *FileCrawler) Run()

type FileList

type FileList struct {
	Files []string `json:"files"`
}

type FlexRaster

type FlexRaster struct {
	ConfigPayLoad
	Data                  []byte
	DataHeight, DataWidth int
	Height, Width         int
	OffX, OffY            int
	Type                  string
	NoData                float64
	NameSpace             string
	TimeStamp             float64
	Polygon               string
}

type Float32Raster

type Float32Raster struct {
	ConfigPayLoad
	Data          []float32
	Height, Width int
	OffX, OffY    int
	NoData        float64
	NameSpace     string
}

func (*Float32Raster) GetNoData

func (f32 *Float32Raster) GetNoData() float64

type GDALDataset

type GDALDataset struct {
	RawPath      string         `json:"file_path"`
	DSName       string         `json:"ds_name"`
	NameSpace    string         `json:"namespace"`
	ArrayType    string         `json:"array_type"`
	SRS          string         `json:"srs"`
	GeoTransform []float64      `json:"geo_transform"`
	TimeStamps   []time.Time    `json:"timestamps"`
	Polygon      string         `json:"polygon"`
	Means        []float64      `json:"means"`
	SampleCounts []int          `json:"sample_counts"`
	NoData       float64        `json:"nodata"`
	Axes         []*DatasetAxis `json:"axes"`
	GeoLocation  *GeoLocInfo    `json:"geo_loc"`
	IsOutRange   bool
}

type GeoDrillGRPC

type GeoDrillGRPC struct {
	Context context.Context
	In      chan *GeoDrillGranule
	Out     chan *DrillResult
	Error   chan error
	Clients []string
}

func NewDrillGRPC

func NewDrillGRPC(ctx context.Context, serverAddress []string, errChan chan error) *GeoDrillGRPC

func (*GeoDrillGRPC) Run

func (gi *GeoDrillGRPC) Run(bandStrides int, decileCount int, pixelCount int, verbose bool)

type GeoDrillGranule

type GeoDrillGranule struct {
	Path             string
	NameSpace        string
	RasterType       string
	TimeStamps       []time.Time
	Geometry         string
	CRS              string
	VRT              string
	Means            []float64
	SampleCounts     []int
	NoData           float64
	Approx           bool
	ClipUpper        float32
	ClipLower        float32
	RasterXSize      float64
	RasterYSize      float64
	GrpcConcLimit    int
	MetricsCollector *metrics.MetricsCollector
}

type GeoDrillRequest

type GeoDrillRequest struct {
	Geometry         string
	CRS              string
	Collection       string
	NameSpaces       []string
	BandExpr         *utils.BandExpressions
	Mask             *utils.Mask
	VRTURL           string
	StartTime        time.Time
	EndTime          time.Time
	ClipUpper        float32
	ClipLower        float32
	RasterXSize      float64
	RasterYSize      float64
	GrpcConcLimit    int
	IndexTileXSize   float64
	IndexTileYSize   float64
	MetricsCollector *metrics.MetricsCollector
}

type GeoFile

type GeoFile struct {
	FileName string        `json:"filename,omitempty"`
	Driver   string        `json:"file_type"`
	DataSets []GeoMetaData `json:"geo_metadata"`
}

type GeoInfoGRPC

type GeoInfoGRPC struct {
	Context context.Context
	In      chan string
	Out     chan *GeoFile
	Error   chan error
	Clients []string
}

func NewInfoGRPC

func NewInfoGRPC(ctx context.Context, serverAddress []string, errChan chan error) *GeoInfoGRPC

func (*GeoInfoGRPC) Run

func (gi *GeoInfoGRPC) Run()

type GeoLocInfo

type GeoLocInfo struct {
	XDSName     string `json:"x_ds_name"`
	XBand       int    `json:"x_band"`
	YDSName     string `json:"y_ds_name"`
	YBand       int    `json:"y_band"`
	LineOffset  int    `json:"line_offset"`
	PixelOffset int    `json:"pixel_offset"`
	LineStep    int    `json:"line_step"`
	PixelStep   int    `json:"pixel_step"`
}

type GeoMetaData

type GeoMetaData struct {
	DataSetName  string         `json:"ds_name"`
	NameSpace    string         `json:"namespace,omitempty"`
	Type         string         `json:"array_type"`
	RasterCount  int32          `json:"raster_count"`
	TimeStamps   []time.Time    `json:"timestamps"`
	Heights      []float64      `json:"heights,omitempty"`
	Overviews    []*pb.Overview `json:"overviews,omitempty"`
	XSize        int32          `json:"x_size"`
	YSize        int32          `json:"y_size"`
	GeoTransform []float64      `json:"geotransform"`
	Polygon      string         `json:"polygon"`
	ProjWKT      string         `json:"proj_wkt"`
	Proj4        string         `json:"proj4"`
}

type GeoRasterGRPC

type GeoRasterGRPC struct {
	Context               context.Context
	In                    chan *GeoTileGranule
	Out                   chan []*FlexRaster
	Error                 chan error
	Clients               []string
	MaxGrpcRecvMsgSize    int
	PolygonShardConcLimit int
	MaxGrpcBufferSize     int
}

func NewRasterGRPC

func NewRasterGRPC(ctx context.Context, serverAddress []string, maxGrpcRecvMsgSize int, polygonShardConcLimit int, maxGrpcBufferSize int, errChan chan error) *GeoRasterGRPC

func (*GeoRasterGRPC) Run

func (gi *GeoRasterGRPC) Run(varList []string, verbose bool)

type GeoReqContext

type GeoReqContext struct {
	Service    *utils.ServiceConfig
	Layer      *utils.Layer
	StyleLayer *utils.Layer
	GeoReq     *GeoTileRequest
	MASAddress string
}

type GeoTileAxis

type GeoTileAxis struct {
	Start        *float64
	End          *float64
	InValues     []float64
	Order        int
	Aggregate    int
	IdxSelectors []*GeoTileIdxSelector
}

type GeoTileGranule

type GeoTileGranule struct {
	ConfigPayLoad
	RawPath             string
	Path                string
	CRS                 string
	SrcSRS              string
	SrcGeoTransform     []float64
	BBox                []float64
	DstGeoTransform     []float64
	Height, Width       int
	RawHeight, RawWidth int
	OffX, OffY          int
	NameSpace           string
	VarNameSpace        string
	TimeStamp           float64
	BandIdx             int
	Polygon             string
	RasterType          string
	GeoLocation         *GeoLocInfo
}

type GeoTileIdxSelector

type GeoTileIdxSelector struct {
	Start   *int
	End     *int
	Step    *int
	IsRange bool
	IsAll   bool
}

type GeoTileRequest

type GeoTileRequest struct {
	ConfigPayLoad
	Collection    string
	CRS           string
	BBox          []float64
	OrigBBox      []float64
	Height, Width int
	OffX, OffY    int
	StartTime     *time.Time
	EndTime       *time.Time
	Axes          map[string]*GeoTileAxis
	Overview      *utils.Layer
}

type InfoPipeline

type InfoPipeline struct {
	Context context.Context
	Error   chan error
	RPCAdds []string
}

func InitInfoPipeline

func InitInfoPipeline(ctx context.Context, rpcAddrs []string, errChan chan error) *InfoPipeline

func (*InfoPipeline) Process

func (dp *InfoPipeline) Process(rootPath string, contains *regexp.Regexp, file io.Writer) chan struct{}

type Int16Raster

type Int16Raster struct {
	ConfigPayLoad
	Data          []int16
	Height, Width int
	OffX, OffY    int
	NoData        float64
	NameSpace     string
}

func (*Int16Raster) GetNoData

func (s16 *Int16Raster) GetNoData() float64

type JPGEncoder

type JPGEncoder struct {
	In    chan *ByteRaster
	Out   chan []byte
	Error chan error
}

func NewJPGEncoder

func NewJPGEncoder(errChan chan error) *JPGEncoder

func (*JPGEncoder) Run

func (enc *JPGEncoder) Run()

type JSONEncoder

type JSONEncoder struct {
	In    chan *GeoFile
	Out   chan []byte
	Error chan error
}

func NewJSONEncoder

func NewJSONEncoder(errChan chan error) *JSONEncoder

func (*JSONEncoder) Run

func (jp *JSONEncoder) Run()

type JSONPrinter

type JSONPrinter struct {
	In    chan []byte
	Out   chan struct{}
	File  io.Writer
	Error chan error
}

func NewJSONPrinter

func NewJSONPrinter(file io.Writer, errChan chan error) *JSONPrinter

func (*JSONPrinter) Run

func (jp *JSONPrinter) Run()

type MetadataResponse

type MetadataResponse struct {
	Error        string         `json:"error"`
	GDALDatasets []*GDALDataset `json:"gdal"`
}

type Overview

type Overview struct {
	XSize int32 `json:"x_size"`
	YSize int32 `json:"y_size"`
}

type PNGEncoder

type PNGEncoder struct {
	In    chan *ByteRaster
	Out   chan []byte
	Error chan error
}

func NewPNGEncoder

func NewPNGEncoder(errChan chan error) *PNGEncoder

func (*PNGEncoder) Run

func (enc *PNGEncoder) Run()

type POSIXDescriptor

type POSIXDescriptor struct {
	GID   uint32 `json:"gid"`
	Group string `json:"group"`
	UID   uint32 `json:"uid"`
	User  string `json:"user"`
	Size  int64  `json:"size"`
	Mode  string `json:"mode"`
	Type  string `json:"type"`
	INode uint64 `json:"inode"`
	MTime int64  `json:"mtime"`
	ATime int64  `json:"atime"`
	CTime int64  `json:"ctime"`
}

type PosixInfo

type PosixInfo struct {
	In    chan string
	Out   chan string
	Error chan error
}

type Raster

type Raster interface {
	GetNoData() float64
}

type RasterMerger

type RasterMerger struct {
	Context context.Context
	In      chan []*FlexRaster
	Out     chan []utils.Raster
	Error   chan error
}

func NewRasterMerger

func NewRasterMerger(ctx context.Context, errChan chan error) *RasterMerger

func (*RasterMerger) Run

func (enc *RasterMerger) Run(bandExpr *utils.BandExpressions, verbose bool)

type RasterScaler

type RasterScaler struct {
	In    chan Raster
	Out   chan *ByteRaster
	Error chan error
}

func NewRasterScaler

func NewRasterScaler(errChan chan error) *RasterScaler

func (*RasterScaler) Run

func (scl *RasterScaler) Run()

type ScaleParams

type ScaleParams struct {
	Offset      float64
	Scale       float64
	Clip        float64
	ColourScale int
}

type TileIndexer

type TileIndexer struct {
	Context    context.Context
	In         chan *GeoTileRequest
	Out        chan *GeoTileGranule
	Error      chan error
	APIAddress string
	QueryLimit int
}

func NewTileIndexer

func NewTileIndexer(ctx context.Context, apiAddr string, errChan chan error) *TileIndexer

func (*TileIndexer) Run

func (p *TileIndexer) Run(verbose bool)

func (*TileIndexer) URLIndexGet

func (p *TileIndexer) URLIndexGet(ctx context.Context, url string, geoReq *GeoTileRequest, errChan chan error, out chan *GeoTileGranule, wg *sync.WaitGroup, isEmptyTile bool, cLimiter *ConcLimiter, verbose bool)

type TilePipeline

type TilePipeline struct {
	Context               context.Context
	Error                 chan error
	RPCAddress            []string
	MaxGrpcRecvMsgSize    int
	PolygonShardConcLimit int
	MASAddress            string
	MaxGrpcBufferSize     int
	CurrentLayer          *utils.Layer
	DataSources           map[string]*utils.Config
}

func InitTilePipeline

func InitTilePipeline(ctx context.Context, masAddr string, rpcAddr []string, maxGrpcRecvMsgSize int, polygonShardConcLimit int, maxGrpcBufferSize int, errChan chan error) *TilePipeline

func (*TilePipeline) GetFileList

func (dp *TilePipeline) GetFileList(geoReq *GeoTileRequest, verbose bool) ([]*GeoTileGranule, error)

func (*TilePipeline) HasFiles added in v1.9.0

func (dp *TilePipeline) HasFiles(geoReq *GeoTileRequest, verbose bool) bool

func (*TilePipeline) Process

func (dp *TilePipeline) Process(geoReq *GeoTileRequest, verbose bool) chan []utils.Raster

type TiledResponse

type TiledResponse struct {
	IndexerID   int
	NumIndexers int
	IndexerTime time.Duration
	Metadata    *MetadataResponse
}

type TimeSplitter

type TimeSplitter struct {
	In       chan *GeoDrillRequest
	Out      chan *GeoDrillRequest
	Error    chan error
	YearStep int
}

func NewTimeSplitter

func NewTimeSplitter(yearStep int, errChan chan error) *TimeSplitter

func (*TimeSplitter) Run

func (ts *TimeSplitter) Run()

type UInt16Raster

type UInt16Raster struct {
	ConfigPayLoad
	Data          []uint16
	Height, Width int
	OffX, OffY    int
	NoData        float64
	NameSpace     string
}

func (*UInt16Raster) GetNoData

func (u16 *UInt16Raster) GetNoData() float64

Jump to

Keyboard shortcuts

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