Skip to main content

index

Objects

BaseInput

@dataclass
class BaseInput()

Data class for base input

Attributes:

  • date str, optional - subset the polygons based on a date. Can be generated from job_id, polygons or prefix.
  • prefix str, optional - object prefix or path to a geometry object. Will only search for .shp. Mutually exclusive with job_id and layername.
  • job_id str, optional - the Job ID. Mutually exclusive with prefix.
  • layername str, optional - name of the layer. Mutually exclusive with prefix.
  • s3_payload bool - switch to write the polygon payloads to s3 to use in a distributed Map State in AWS Step Functions. Defaults to True.
  • workspace str, optional - workspace name. Can increase search geometry object search capabilities. Included only when job_id and layername are set.

Functions

lambda_handler

@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> List[dict] | str

Function to split a geometry object over data events used for AWS Step Functions to iterate over. Will generate an S3 payload. Unless specifically told not to with setting s3_payload to false.

Arguments:

  • event dict - should fit the BaseInput
  • context dict - lambda context object

Raises:

  • FileNotFoundError - When no files are found in prefix or though job_id and layername.

Returns:

  • List[dict] | str - objects describing crs, an ID and WKT, or a s3 payload.

Examples:

{
"date": "2024-01-01",
"prefix": "object/path/to/the/polygons.shp",
"job_id": "2983hd872gd873-1337-9f824hf82g823h94jf",
"layername": "some-layer",
"s3_payload": true,
"workspace": "some-workspace",
}