index
Objects
BaseInput
class BaseInput(BaseModel)
Base input event.
Arguments:
BaseModelBaseModel - inherited from pydantic.
Attributes:
workspacestr - name of the workspace.layernamestr - name of the layer.datestr, optional - date in %YYYYmmDD format.datatypestr - type of layer, defaults to "layer:s3_url"descriptionstr, optional - description of the layer.styledict, optional - input styling definitions.zonestr | int, optional - force publication to happen on another target zone ID.prefixstr, optional - input prefix to find source files. databases block you.
Returns:
_type_- description
is_none_with_prefix
@model_validator(mode="before")
@classmethod
def is_none_with_prefix(cls, data: dict)
Attempt to fix incoming data when date and prefix aren't present
Arguments:
datadict - input data
Raises:
ValueError- raised when required input is invalid.
Returns:
dict- fixed data
StatisticsResponse
class StatisticsResponse(BaseModel)
Response data class of Raster Tiler Statistics
Arguments:
BaseModelBaseModel - inherited from pydantic.
Attributes:
minDecimal - minimum value in rastermaxDecimal - maximum value in rastermeanDecimal - mean value of rastercountint - number of pixelssumint, Decimal - sum of values in rasterstdDecimal - standard deviation of raster valuesmedianDecimal - median of raster valuesmajorityDecimal - most frequent value in rasterminorityDecimal - least frequent value in rasteruniqueint - number of unique values in rasterhistogramlist of list of Decimal - the histogramvalid_percentDecimal - percentage of valid pixelsmasked_pixelsint - number of hidden pixelsvalid_pixelsint - number of valid pixelspercentile_2Decimal - 2% percentile of raster valuespercentile_98Decimal - 98% percentile of raster values
get_published_key
def get_published_key(workspace: str, layername: str, date: str) -> str
Function to get the publication object path in AWS S3
Arguments:
workspacestr - name of the workspace.layernamestr - name of the layer.datestr - date in %YYYYmmDD format.
Raises:
FileExistsError- raised if object path already existsFileNotFoundError- raised if COG file cannot be found
Returns:
str- object path
Examples:
get_published_key = {
workspace="some-workspace",
layername="some-layer",
date="20210201"
}
Functions
lambda_handler
@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> dict
Lambda handler that deals with publication of raster data
Arguments:
eventdict - input event, must be convertable to BaseInputcontextdict - contains authentication information
Returns:
dict- output event
Examples:
{
"workspace": "some-workspace",
"layername": "some-layer",
"date": "20210201",
"datatype": "layer:s3_url",
"description": "some description",
"style": {
"default": "terrain",
"styles": [
"terrain",
"rdylgn"
]
},
"zone": 1336
}