utils

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 CatalogueDirName = "catalogues"
View Source
const ColourLinearScale = 0
View Source
const ColourLogScale = 1
View Source
const DefaultConcGrpcWorkerQuery = 64
View Source
const DefaultGrpcWcsConcPerNode = 16
View Source
const DefaultGrpcWmsConcPerNode = 16
View Source
const DefaultGrpcWpsConcPerNode = 16
View Source
const DefaultLegendHeight = 320
View Source
const DefaultLegendWidth = 160
View Source
const DefaultRecvMsgSize = 10 * 1024 * 1024
View Source
const DefaultWcsMaxBandExpressions = 10
View Source
const DefaultWcsMaxBandTokens = 300
View Source
const DefaultWcsMaxBandVariables = 10
View Source
const DefaultWcsMaxHeight = 30000
View Source
const DefaultWcsMaxTileHeight = 1024
View Source
const DefaultWcsMaxTileWidth = 1024
View Source
const DefaultWcsMaxWidth = 50000
View Source
const DefaultWcsPolygonSegments = 10
View Source
const DefaultWcsPolygonShardConcLimit = 2
View Source
const DefaultWcsTimeout = 30
View Source
const DefaultWmsMaxBandExpressions = 3
View Source
const DefaultWmsMaxBandTokens = 75
View Source
const DefaultWmsMaxBandVariables = 6
View Source
const DefaultWmsMaxHeight = 512
View Source
const DefaultWmsMaxWidth = 512
View Source
const DefaultWmsPolygonSegments = 2
View Source
const DefaultWmsPolygonShardConcLimit = 2
View Source
const DefaultWmsTimeout = 20
View Source
const DefaultWpsTimeout = 300
View Source
const EmptyTileNS = "EmptyTile"
View Source
const ISOFormat = "2006-01-02T15:04:05.000Z"

ISOFormat is the string used to format Go ISO times

View Source
const ISOZeroTime = "0001-01-01T00:00:00.000Z"
View Source
const ReservedMemorySize = 1.5 * 1024 * 1024 * 1024
View Source
const WeightedTimeAxis = "weighted_time"

Variables

View Source
var DataDir = "."
View Source
var EtcDir = "."
View Source
var GDALTypes = map[string]C.GDALDataType{"Unkown": 0, "Byte": 1, "SignedByte": 1, "UInt16": 2, "Int16": 3,
	"UInt32": 4, "Int32": 5, "Float32": 6, "Float64": 7,
	"CInt16": 8, "CInt32": 9, "CFloat32": 10, "CFloat64": 11,
	"TypeCount": 12}
View Source
var GSKYVersion = "."
View Source
var WCSRegexpMap = map[string]string{"service": `^WCS$`,
	"request":  `^GetCapabilities$|^DescribeCoverage$|^GetCoverage$`,
	"coverage": `^[A-Za-z.:0-9\s_-]+$`,
	"crs":      `^(?i)(?:[A-Z]+):(?:[0-9]+)$`,
	"bbox":     `^[-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?(,[-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?){3}$`,
	"time":     `^\d{4}-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T[0-2]\d:[0-5]\d:[0-5]\d(\.\d+)?Z$`,
	"width":    `^[-+]?[0-9]+$`,
	"height":   `^[-+]?[0-9]+$`,
	"axis":     `^[A-Za-z_][A-Za-z0-9_]*$`,
	"format":   `^(?i)(GeoTIFF|NetCDF|DAP4)$`}

WCSRegexpMap maps WCS request parameters to regular expressions for doing validation when parsing. --- These regexp do not avoid every case of --- invalid code but filter most of the malformed --- cases. Error free JSON deserialisation into types --- also validates correct values.

View Source
var WMSRegexpMap = map[string]string{"service": `^WMS$`,
	"request": `^GetCapabilities$|^GetFeatureInfo$|^DescribeLayer$|^GetMap$|^GetLegendGraphic$`,
	"crs":     `^(?i)(?:[A-Z]+):(?:[0-9]+)$`,
	"bbox":    `^[-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?(,[-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?){3}$`,
	"x":       `^[0-9]+$`,
	"y":       `^[0-9]+$`,
	"width":   `^[0-9]+$`,
	"height":  `^[0-9]+$`,
	"axis":    `^[A-Za-z_][A-Za-z0-9_]*$`,
	"time":    `^\d{4}-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T[0-2]\d:[0-5]\d:[0-5]\d\.\d+Z$`}

WMSRegexpMap maps WMS request parameters to regular expressions for doing validation when parsing. --- These regexp do not avoid every case of --- invalid code but filter most of the malformed --- cases. Error free JSON deserialisation into types --- also validates correct values.

View Source
var WPSRegexpMap = map[string]string{"service": `^WPS$`,
	"request": `^GetCapabilities$|^DescribeProcess$|^Execute$`,
	"time":    `^\d{4}-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T[0-2]\d:[0-5]\d$`}

WPSRegexpMap maps WPS request parameters to regular expressions for doing validation when parsing. --- These regexp do not avoid every case of --- invalid code but filter most of the malformed --- cases. Error free JSON deserialisation into types --- also validates correct values.

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 CheckBandExpressionsComplexity added in v1.8.0

func CheckBandExpressionsComplexity(bandExpr *BandExpressions, criteria *BandExpressionComplexityCriteria) error

func CheckDisableServices

func CheckDisableServices(layer *Layer, service string) bool

func CheckEmptyTile

func CheckEmptyTile(rs []Raster) (bool, error)

func CheckIndexFile added in v1.9.0

func CheckIndexFile(staticRoot string, path string, verbose bool) string

func CheckWCSVersion

func CheckWCSVersion(version string) bool

CheckWCSVersion checks if the requested version of WCS is supported by the server

func CheckWMSVersion

func CheckWMSVersion(version string) bool

func CompileWCSRegexMap

func CompileWCSRegexMap() map[string]*regexp.Regexp

func CompileWMSRegexMap

func CompileWMSRegexMap() map[string]*regexp.Regexp

func CompileWPSRegexMap

func CompileWPSRegexMap() map[string]*regexp.Regexp

func DumpConfig

func DumpConfig(configs map[string]*Config) (string, error)

func DumpDap4CE

func DumpDap4CE(ce *DapConstraints)

func EncodeDap4

func EncodeDap4(w http.ResponseWriter, dataFile string, bandNames []string, verbose bool) error

func EncodeGdal

func EncodeGdal(hDstDS C.GDALDatasetH, rs []Raster, xOff int, yOff int) ([]string, error)

func EncodeGdalClose

func EncodeGdalClose(hDstDS *C.GDALDatasetH)

func EncodeGdalFlush

func EncodeGdalFlush(hDstDS C.GDALDatasetH)

func EncodeGdalMerge

func EncodeGdalMerge(ctx context.Context, hDstDS C.GDALDatasetH, format string, workerTempFileName string, widthList []int, heightList []int, xOffList []int, yOffList []int) error

func EncodeGdalOpen

func EncodeGdalOpen(tempDir string, blockXSize int, blockYSize int, format string, geot []float64, epsg int, rs []Raster, width int, height int, bands int) (C.GDALDatasetH, string, error)

func EncodePNG

func EncodePNG(br []*ByteRaster, palette *Palette) ([]byte, error)

func ExecuteWriteTemplateFile

func ExecuteWriteTemplateFile(w io.Writer, data interface{}, filePath string) error

func ExtractEPSGCode

func ExtractEPSGCode(srs string) (int, error)

ExtractEPSGCode parses an SRS string and gets the EPSG code

func FindConfigGPath added in v1.9.0

func FindConfigGPath(config *Config) string

func FindLayerBestOverview

func FindLayerBestOverview(layer *Layer, reqRes float64, allowExtrapolation bool) int

func GenerateDates

func GenerateDates(name string, start, end time.Time, stepMins time.Duration) []string

func GenerateDatesAux

func GenerateDatesAux(start, end time.Time, stepMins time.Duration) []string

func GenerateDatesChirps20

func GenerateDatesChirps20(start, end time.Time, stepMins time.Duration) []string

func GenerateDatesGeoglam

func GenerateDatesGeoglam(start, end time.Time, stepMins time.Duration) []string

func GenerateDatesMCD43A4

func GenerateDatesMCD43A4(start, end time.Time, stepMins time.Duration) []string

GenerateDatesMCD43A4 function is used to generate the list of ISO dates from its especification in the Config.Layer struct.

func GenerateDatesMas

func GenerateDatesMas(start, end string, masAddress string, collection string, namespaces []string, stepMins time.Duration, token string, verbose bool) ([]string, string)

func GenerateDatesRegular

func GenerateDatesRegular(start, end time.Time, stepMins time.Duration) []string

func GenerateMonthlyDates

func GenerateMonthlyDates(start, end time.Time, stepMins time.Duration) []string

func GenerateYearlyDates

func GenerateYearlyDates(start, end time.Time, stepMins time.Duration) []string

func GetArea

func GetArea(wgs84Poly geo.Geometry) float64

func GetCanonicalBbox

func GetCanonicalBbox(srs string, bbox []float64) ([]float64, error)

func GetCoordinates

func GetCoordinates(params WMSParams) (float64, float64, error)

GetCoordinates returns the x and y coordinates in the original projection from the tile relative WMS parameters.

func GetCoverageIndex

func GetCoverageIndex(params WCSParams, config *Config) (int, error)

GetCoverageIndex returns the index of the specified layer inside the Config.Layers field.

func GetCoverageStyleIndex

func GetCoverageStyleIndex(params WCSParams, config *Config, covIdx int) (int, error)

GetCoverageStyleIndex returns the index of the specified style inside a coverage

func GetCurrentTimeStamp

func GetCurrentTimeStamp(timestamps []string) (*time.Time, error)

GetCurrentTimeStamp gets the current timestamp if time is not specified in the HTTP request

func GetDriverNameFromFormat

func GetDriverNameFromFormat(format string) (string, error)

func GetDummyGDALDatasetH

func GetDummyGDALDatasetH() C.GDALDatasetH

func GetEmptyTile

func GetEmptyTile(imageFilename string, height, width int) ([]byte, error)

func GetHostURL added in v1.9.0

func GetHostURL(r *http.Request) string

func GetLayerIndex

func GetLayerIndex(params WMSParams, config *Config) (int, error)

GetLayerIndex returns the index of the specified layer inside the Config.Layers field.

func GetLayerStyleIndex

func GetLayerStyleIndex(params WMSParams, config *Config, layerIdx int) (int, error)

GetLayerStyleIndex returns the index of the specified style inside a layer

func GetPixelResolution

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

func GetProcessIndex

func GetProcessIndex(params WPSParams, config *Config) (int, error)

func GradientRGBAPalette

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

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

func InitGdal

func InitGdal()

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 LoadAllConfigFiles

func LoadAllConfigFiles(searchPath string, verbose bool) (map[string]*Config, error)

func LoadConfigFileTemplate

func LoadConfigFileTemplate(configFile string) ([]byte, error)

LoadConfigFileTemplate parses the config as a Jet template and escapes any GSKY here docs (i.e. $gdoc$) into valid one-line JSON strings.

func LoadConfigFromMAS added in v1.9.0

func LoadConfigFromMAS(masAddress, namespace string, rootConfig *Config, verbose bool) (map[string]*Config, error)

func LoadConfigOnDemand added in v1.8.0

func LoadConfigOnDemand(searchPath string, namespace string, verbose bool) (map[string]*Config, error)

func LoadConfigTimestamps added in v1.9.0

func LoadConfigTimestamps(config *Config, verbose bool) error

func ParsePost

func ParsePost(rc io.ReadCloser) (map[string][]string, error)

func ParseQuery

func ParseQuery(query string) (m url.Values, err error)

func ParseRemoteAddr

func ParseRemoteAddr(r *http.Request) string

func ParseRequestProtocol added in v1.8.0

func ParseRequestProtocol(r *http.Request) string

func PostprocessServiceConfig added in v1.9.0

func PostprocessServiceConfig(config *Config, confMap map[string]*Config, verbose bool)

func RemoveGdalTempFile

func RemoveGdalTempFile(tempFile string)

func Unmarshal

func Unmarshal(data []byte, i interface{}) error

Unmarshal is wrapper around json.Unmarshal that returns user-friendly errors when there are syntax errors. https://github.com/hashicorp/packer/blob/master/common/json/unmarshal.go

func ValidateRasterSlice

func ValidateRasterSlice(rs []Raster) (int, int, string, error)

func WatchConfig

func WatchConfig(infoLog, errLog *log.Logger, configMap *sync.Map, verbose bool)

Types

type AxisIdxSelector

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

type AxisParam

type AxisParam struct {
	Name         string    `json:"name"`
	Start        *float64  `json:"start,omitempty"`
	End          *float64  `json:"end,omitempty"`
	InValues     []float64 `json:"in_values,omitempty"`
	Order        int       `json:"order,omitempty"`
	Aggregate    int       `json:"aggregate,omitempty"`
	IdxSelectors []*AxisIdxSelector
}

type BandExpressionComplexityCriteria added in v1.8.0

type BandExpressionComplexityCriteria struct {
	MaxVariables   int                    `json:"max_variables"`
	MaxTokens      int                    `json:"max_tokens"`
	MaxExpressions int                    `json:"max_expressions"`
	TokenACL       map[string]interface{} `json:"token_acl"`
	VariableLookup map[string]struct{}
}

type BandExpressions

type BandExpressions struct {
	ExprText    []string
	Expressions []*goeval.EvaluableExpression
	VarList     []string
	ExprNames   []string
	ExprVarRef  [][]string
}

func ParseBandExpressions

func ParseBandExpressions(bands []string) (*BandExpressions, error)

type BuiltinPalettes added in v1.8.0

type BuiltinPalettes struct {
	Palettes []*Palette `json:"palettes"`
}

func NewBuiltinPalettes added in v1.8.0

func NewBuiltinPalettes() *BuiltinPalettes

type ByteRaster

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

func Scale

func Scale(rs []Raster, params ScaleParams) ([]*ByteRaster, error)

func (*ByteRaster) GetNoData

func (r *ByteRaster) GetNoData() float64

type CapabilityExtension added in v1.8.0

type CapabilityExtension struct {
	Name        string                        `json:"name"`
	Version     string                        `json:"version"`
	Layer       Layer                         `json:"layer"`
	ResourceURL string                        `json:"resource_url"`
	Properties  []CapabilityExtensionProperty `json:"properties"`
}

type CapabilityExtensionProperty added in v1.8.0

type CapabilityExtensionProperty struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type CatalogueHandler added in v1.9.0

type CatalogueHandler struct {
	Path              string
	URLHost           string
	URLPathRoot       string
	StaticRoot        string
	MasAddress        string
	IndexTemplateRoot string
	Verbose           bool
	Output            http.ResponseWriter
}

func NewCatalogueHandler added in v1.9.0

func NewCatalogueHandler(path, urlHost, urlPathRoot, staticRoot, masAddress, indexTemplateRoot string, verbose bool, output http.ResponseWriter) *CatalogueHandler

func (*CatalogueHandler) Process added in v1.9.0

func (h *CatalogueHandler) Process() int

type CompData

type CompData struct {
	Identifier string `json:"identifier"`
	Title      string `json:"title"`
	Abstract   string `json:"abstract"`
	MimeType   string `json:"mime_type"`
	Encoding   string `json:"encoding"`
	Schema     string `json:"schema"`
	MinOccurs  int    `json:"min_occurs"`
}

CompData contains the description of a variable used to compute a WPS operation

type Config

type Config struct {
	ServiceConfig ServiceConfig         `json:"service_config"`
	Layers        []Layer               `json:"layers"`
	Processes     []Process             `json:"processes"`
	Extensions    []CapabilityExtension `json:"extensions"`
}

Config is the struct representing the configuration of a WMS server. It contains information about the file index API as well as the list of WMS layers that can be served.

func GetRootConfig added in v1.9.0

func GetRootConfig(searchPath string, verbose bool) (*Config, error)

func (*Config) Copy

func (config *Config) Copy(r *http.Request) *Config

CopyConfig makes a deep copy of the certain fields of the config object. For the time being, we only copy the fields required for GetCapabilities.

func (*Config) GetLayerDates

func (config *Config) GetLayerDates(iLayer int, verbose bool)

GetLayerDates loads dates for the ith layer

func (*Config) LoadConfigFile

func (config *Config) LoadConfigFile(configFile string, verbose bool) error

LoadConfigFile marshalls the config.json document returning an instance of a Config variable containing all the values

func (*Config) LoadConfigString added in v1.9.0

func (config *Config) LoadConfigString(cfg []byte, verbose bool) error

type DapConstraints

type DapConstraints struct {
	Dataset   string
	VarParams []*DapVarParam
}

func ParseDap4ConstraintExpr

func ParseDap4ConstraintExpr(ceStr string) (*DapConstraints, error)

type DapIdxSelector

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

type DapVarParam

type DapVarParam struct {
	Name         string
	ValStart     *float64
	ValEnd       *float64
	IdxSelectors []*DapIdxSelector
	IsAxis       bool
}

type Data

type Data struct {
	ComplexData string
	LiteralData string
}

type DataInputs

type DataInputs struct {
	Input []Input
}

type Execute

type Execute struct {
	Version    string `xml:"version,attr"`
	Service    string `xml:"service,attr"`
	Identifier string
	DataInputs DataInputs
}

type FileList

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

FileList is the struct used to unmarshal the reponse from the index API

type Float32Raster

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

func (*Float32Raster) GetNoData

func (r *Float32Raster) GetNoData() float64

type Input

type Input struct {
	Identifier string
	Data       Data
}

type Int16Raster

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

func (*Int16Raster) GetNoData

func (r *Int16Raster) GetNoData() float64

type Layer

type Layer struct {
	OWSHostname                  string   `json:"ows_hostname"`
	OWSProtocol                  string   `json:"ows_protocol"`
	MASAddress                   string   `json:"mas_address"`
	NameSpace                    string   `json:"namespace"`
	Name                         string   `json:"name"`
	Title                        string   `json:"title"`
	Abstract                     string   `json:"abstract"`
	MetadataURL                  string   `json:"metadata_url"`
	VRTURL                       string   `json:"vrt_url"`
	DataURL                      string   `json:"data_url"`
	Overviews                    []Layer  `json:"overviews"`
	InputLayers                  []Layer  `json:"input_layers"`
	DisableServices              []string `json:"disable_services"`
	DisableServicesMap           map[string]struct{}
	DataSource                   string `json:"data_source"`
	StartISODate                 string `json:"start_isodate"`
	EndISODate                   string `json:"end_isodate"`
	EffectiveStartDate           string
	EffectiveEndDate             string
	TimestampToken               string
	StepDays                     int      `json:"step_days"`
	StepHours                    int      `json:"step_hours"`
	StepMinutes                  int      `json:"step_minutes"`
	Accum                        bool     `json:"accum"`
	TimeGen                      string   `json:"time_generator"`
	Dates                        []string `json:"dates"`
	RGBProducts                  []string `json:"rgb_products"`
	RGBExpressions               *BandExpressions
	Mask                         *Mask      `json:"mask"`
	OffsetValue                  float64    `json:"offset_value"`
	ClipValue                    float64    `json:"clip_value"`
	ScaleValue                   float64    `json:"scale_value"`
	Palette                      *Palette   `json:"palette"`
	Palettes                     []*Palette `json:"palettes"`
	LegendPath                   string     `json:"legend_path"`
	LegendHeight                 int        `json:"legend_height"`
	LegendWidth                  int        `json:"legend_width"`
	Styles                       []Layer    `json:"styles"`
	ZoomLimit                    float64    `json:"zoom_limit"`
	MaxGrpcRecvMsgSize           int        `json:"max_grpc_recv_msg_size"`
	WmsPolygonSegments           int        `json:"wms_polygon_segments"`
	WcsPolygonSegments           int        `json:"wcs_polygon_segments"`
	WmsTimeout                   int        `json:"wms_timeout"`
	WcsTimeout                   int        `json:"wcs_timeout"`
	GrpcWmsConcPerNode           int        `json:"grpc_wms_conc_per_node"`
	GrpcWcsConcPerNode           int        `json:"grpc_wcs_conc_per_node"`
	GrpcWpsConcPerNode           int        `json:"grpc_wps_conc_per_node"`
	WmsPolygonShardConcLimit     int        `json:"wms_polygon_shard_conc_limit"`
	WcsPolygonShardConcLimit     int        `json:"wcs_polygon_shard_conc_limit"`
	BandStrides                  int        `json:"band_strides"`
	WmsMaxWidth                  int        `json:"wms_max_width"`
	WmsMaxHeight                 int        `json:"wms_max_height"`
	WcsMaxWidth                  int        `json:"wcs_max_width"`
	WcsMaxHeight                 int        `json:"wcs_max_height"`
	WcsMaxTileWidth              int        `json:"wcs_max_tile_width"`
	WcsMaxTileHeight             int        `json:"wcs_max_tile_height"`
	FeatureInfoMaxAvailableDates int        `json:"feature_info_max_dates"`
	FeatureInfoMaxDataLinks      int        `json:"feature_info_max_data_links"`
	FeatureInfoDataLinkUrl       string     `json:"feature_info_data_link_url"`
	FeatureInfoBands             []string   `json:"feature_info_bands"`
	FeatureInfoExpressions       *BandExpressions
	NoDataLegendPath             string                            `json:"nodata_legend_path"`
	AxesInfo                     []*LayerAxis                      `json:"axes"`
	UserSrcSRS                   int                               `json:"src_srs"`
	UserSrcGeoTransform          int                               `json:"src_geo_transform"`
	DefaultGeoBbox               []float64                         `json:"default_geo_bbox"`
	DefaultGeoSize               []int                             `json:"default_geo_size"`
	WmsAxisMapping               int                               `json:"wms_axis_mapping"`
	GrpcTileXSize                float64                           `json:"grpc_tile_x_size"`
	GrpcTileYSize                float64                           `json:"grpc_tile_y_size"`
	IndexTileXSize               float64                           `json:"index_tile_x_size"`
	IndexTileYSize               float64                           `json:"index_tile_y_size"`
	SpatialExtent                []float64                         `json:"spatial_extent"`
	IndexResLimit                float64                           `json:"index_res_limit"`
	ColourScale                  int                               `json:"colour_scale"`
	TimestampsLoadStrategy       string                            `json:"timestamps_load_strategy"`
	MasQueryHint                 string                            `json:"mas_query_hint"`
	SRSCf                        int                               `json:"srs_cf"`
	Visibility                   string                            `json:"visibility"`
	RasterXSize                  float64                           `json:"raster_x_size"`
	RasterYSize                  float64                           `json:"raster_y_size"`
	WmsBandExpressionCriteria    *BandExpressionComplexityCriteria `json:"wms_band_expr_criteria"`
	WcsBandExpressionCriteria    *BandExpressionComplexityCriteria `json:"wcs_band_expr_criteria"`
}

Layer contains all the details that a layer needs to be published and rendered

type LayerAxis

type LayerAxis struct {
	Name    string   `json:"name"`
	Default string   `json:"default"`
	Values  []string `json:"values"`
}

type LitData

type LitData struct {
	Identifier    string   `json:"identifier"`
	Title         string   `json:"title"`
	Abstract      string   `json:"abstract"`
	DataType      string   `json:"data_type"`
	DataTypeRef   string   `json:"data_type_ref"`
	AllowedValues []string `json:"allowed_values"`
	MinOccurs     int      `json:"min_occurs"`
}

LitData contains the description of a variable used to compute a WPS operation

type MASLayers added in v1.9.0

type MASLayers struct {
	Error  string  `json:"error"`
	Layers []Layer `json:"layers"`
}

func LoadLayersFromMAS added in v1.9.0

func LoadLayersFromMAS(masAddress, namespace string, verbose bool) (*MASLayers, error)

type Mask

type Mask struct {
	ID            string   `json:"id"`
	Value         string   `json:"value"`
	DataSource    string   `json:"data_source"`
	Inclusive     bool     `json:"inclusive"`
	BitTests      []string `json:"bit_tests"`
	IDExpressions *BandExpressions
}

type OWSCache added in v1.9.0

type OWSCache struct {
	MASAddress string
	GPath      string
	// contains filtered or unexported fields
}

func NewOWSCache added in v1.9.0

func NewOWSCache(masAddress, gpath string, verbose bool) *OWSCache

func (*OWSCache) Get added in v1.9.0

func (o *OWSCache) Get(query string) ([]byte, error)

func (*OWSCache) GetConfig added in v1.9.0

func (o *OWSCache) GetConfig(query string) (*Config, error)

func (*OWSCache) Put added in v1.9.0

func (o *OWSCache) Put(query string, value string) error

type Palette

type Palette struct {
	Name        string       `json:"name"`
	Interpolate bool         `json:"interpolate"`
	Colours     []color.RGBA `json:"colours"`
}

type Process

type Process struct {
	DataSources    []Layer    `json:"data_sources"`
	Identifier     string     `json:"identifier"`
	Title          string     `json:"title"`
	Abstract       string     `json:"abstract"`
	MaxArea        float64    `json:"max_area"`
	LiteralData    []LitData  `json:"literal_data"`
	ComplexData    []CompData `json:"complex_data"`
	IdentityTol    float64    `json:"identity_tol"`
	DpTol          float64    `json:"dp_tol"`
	Approx         *bool      `json:"approx,omitempty"`
	DrillAlgorithm string     `json:"drill_algo,omitempty"`
	WpsTimeout     int        `json:"wps_timeout"`
}

Process contains all the details that a WPS needs to be published and processed

type Raster

type Raster interface {
	GetNoData() float64
}

type RuntimeFileResolver added in v1.9.0

type RuntimeFileResolver struct {
	DataDirs []string
	// contains filtered or unexported fields
}

func NewRuntimeFileResolver added in v1.9.0

func NewRuntimeFileResolver(searchPath string) *RuntimeFileResolver

func (*RuntimeFileResolver) Lookup added in v1.9.0

func (r *RuntimeFileResolver) Lookup(filePath string) (string, error)

func (*RuntimeFileResolver) Resolve added in v1.9.0

func (r *RuntimeFileResolver) Resolve(filePath string) (string, error)

type ScaleParams

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

type ServiceConfig

type ServiceConfig struct {
	OWSHostname       string `json:"ows_hostname"`
	OWSProtocol       string `json:"ows_protocol"`
	NameSpace         string
	MASAddress        string   `json:"mas_address"`
	WorkerNodes       []string `json:"worker_nodes"`
	OWSClusterNodes   []string `json:"ows_cluster_nodes"`
	TempDir           string   `json:"temp_dir"`
	MaxGrpcBufferSize int      `json:"max_grpc_buffer_size"`
	EnableAutoLayers  bool     `json:"enable_auto_layers"`
	OWSCacheGPath     string   `json:"ows_cache_gpath"`
}

type SignedByteRaster

type SignedByteRaster struct {
	NameSpace     string
	Data          []int8
	Height, Width int
	NoData        float64
}

func (*SignedByteRaster) GetNoData

func (r *SignedByteRaster) GetNoData() float64

type UInt16Raster

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

func (*UInt16Raster) GetNoData

func (r *UInt16Raster) GetNoData() float64

type WCSParams

type WCSParams struct {
	Service        *string      `json:"service,omitempty"`
	Version        *string      `json:"version,omitempty"`
	Request        *string      `json:"request,omitempty"`
	Coverages      []string     `json:"coverage,omitempty"`
	CRS            *string      `json:"crs,omitempty"`
	ReqCRS         *string      `json:"req_crs,omitempty"`
	BBox           []float64    `json:"bbox,omitempty"`
	Time           *time.Time   `json:"time,omitempty"`
	Height         *int         `json:"height,omitempty"`
	Width          *int         `json:"width,omitempty"`
	Format         *string      `json:"format,omitempty"`
	Styles         []string     `json:"styles,omitempty"`
	Axes           []*AxisParam `json:"axes,omitempty"`
	BandExpr       *BandExpressions
	NoReprojection bool
	AxisMapping    int
}

WCSParams contains the serialised version of the parameters contained in a WCS request.

func WCSParamsChecker

func WCSParamsChecker(params map[string][]string, compREMap map[string]*regexp.Regexp) (WCSParams, error)

WCSParamsChecker checks and marshals the content of the parameters of a WCS request into a WCSParams struct.

type WMSParams

type WMSParams struct {
	Service     *string      `json:"service,omitempty"`
	Request     *string      `json:"request,omitempty"`
	CRS         *string      `json:"crs,omitempty"`
	BBox        []float64    `json:"bbox,omitempty"`
	Format      *string      `json:"format,omitempty"`
	X           *int         `json:"x,omitempty"`
	Y           *int         `json:"y,omitempty"`
	Height      *int         `json:"height,omitempty"`
	Width       *int         `json:"width,omitempty"`
	Time        *time.Time   `json:"time,omitempty"`
	Layers      []string     `json:"layers,omitempty"`
	Styles      []string     `json:"styles,omitempty"`
	Version     *string      `json:"version,omitempty"`
	Axes        []*AxisParam `json:"axes,omitempty"`
	Offset      *float64     `json:"offset,omitempty"`
	Clip        *float64     `json:"clip,omitempty"`
	Palette     *string      `json:"palette,omitempty"`
	ColourScale *int         `json:"colour_scale,omitempty"`
	BandExpr    *BandExpressions
}

WMSParams contains the serialised version of the parameters contained in a WMS request.

func WMSParamsChecker

func WMSParamsChecker(params map[string][]string, compREMap map[string]*regexp.Regexp) (WMSParams, error)

WMSParamsChecker checks and marshals the content of the parameters of a WMS request into a WMSParams struct.

type WPSParams

type WPSParams struct {
	Service       *string               `json:"service"`
	Request       *string               `json:"request"`
	Identifier    *string               `json:"identifier"`
	StartDateTime *string               `json:"start_datetime"`
	EndDateTime   *string               `json:"end_datetime"`
	Product       *string               `json:"product"`
	FeatCol       geo.FeatureCollection `json:"feature_collection"`
	GeometryId    *string               `json:"geometry_id"`
	ClipUppers    map[string]float32    `json:"clip_uppers"`
	ClipLowers    map[string]float32    `json:"clip_lowers"`
}

WPSParams contains the serialised version of the parameters contained in a WPS request.

func WPSParamsChecker

func WPSParamsChecker(params map[string][]string, compREMap map[string]*regexp.Regexp) (WPSParams, error)

WPSParamsChecker checks and marshals the content of the parameters of a WPS request into a WPSParams struct.

Jump to

Keyboard shortcuts

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