index
Objects
BaseInput
@dataclass
class BaseInput()
Base input event.
Attributes:
layernamestr - name of the layer.prefixstr - object path to the file.api_idint, optional - a geoserver ID. Can be neglected whenlegacyisTrue.bucketstr, optional - the data bucket. Defaults toSOURCE_BUCKET.datestr, datetime.date, optional - date in YYYYmmDD or YYYY-mm-DD format. Can be generated from settingorder_id.force_uploadbool - switch to force an upload. This negates the DynamoDB status and layer requirements. Defaults toFalse.geoserver_urldict | str, optional - a Geoserver url. Can be neglected whenlegacyisTrue.job_idstr - the job ID. Defaults to"".legacybool - switch to set the layer build to a Legacy solution. Defaults toFalse.order_idint, optional - the order ID.preserve_databool, optional - preserve the attribute/properties of a geometry file. Defaults toFalse.statusbool - update the status in the Job record. Defaults toTrue.validatebool - run a geometry validation. These results are written to the logs. Defaults toFalse.workspacestr, optional - name of the workspace.
Raises:
HTTPError- raised when a Geoserver cannot be found.
Functions
lambda_handler
@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> dict
Lambda handler to build vectors in target database
Arguments:
eventdict - Input event, should fit BaseInput.contextdict - Request context used for authentication.
Raises:
ReferenceError- Server location cannot be found from internal system.HTTPError- Server url cannot be found.IndexError- Caught but followed by aFileNotFoundError.FileNotFoundError- Input geometry files were not found in file storage or databases.ShapelyError- Geometry specific errorse- Generic output exception.
Returns:
dict- source event with any appended information.
Examples:
{
"layername": "some-layer",
"prefix": "path/to/the/object.shp",
"api_id": 1337,
"bucket": "some-bucket",
"date": "20120110",
"force_upload": false,
"geoserver_url": "https://some-geoserver-url/geoserver",
"job_id": "2389u93h3-1337-f3948hf394bf3874gf",
"legacy": false,
"order_id": 1337,
"preserve_date": true,
"status": true,
"validate": false,
"workspace": "some-workspace"
}