Postprocessing Build Plantable Area layer AWS Step Function
This step function is used to orchestrate the building of a plantable area layer and uploading the results to the desired hosting infrastructure. The function requires a successfull Slope, run postprocessing-build-slope-step-function if that is not the case. Processing the plantable area layer is basically a user defined reclassification of the slope layer. The step function uses the slope layer tiles and feeds those into a lambda which runs some Numpy calculations and returns a reclassified tile based on the same index as the slope layer.
Step functions
The step functions that are used within this step function:
- A PostprocessingRasterOptimization step function that generates the COG dataset.
Lambdas
- A UtilityGetPrefixFunction to generate the prefix used to find the input files and where data will be stored in S3.
- A UtilityTaskControllerForTiler function to create the payload jsons for parallel processing inside EC2s.
- A PostprocessingBuildPropertiesFunction function to build properties files necessary for Geoserver coverage configuration.
./datastore.properties # contains database schema information
./indexer.properties # contains coverage information (EPSG)
./timeregex.properties # contains regex string to determine date
./footprint.properties # contains trigger for COG hosting
- A PostprocessingPlantableAreaLayer function to actually run the Numpy reclassification.
- A PostprocessingPublishRaster function to generate the publication information for Serverless infrastructure.
- A PostprocessingGetInstanceRequirements function to estimate EC2 resource requirements.
- A PostprocessingRunSsmCommandFunction function to run particular commands against the EC2 running the Geoserver. In this case the lambda runs the upload command moving data from S3 to EC2.
- A PostprocessingCheckSsmCommandFunction function polls the Geoserver data directory for the presence of all data. Basically the checksum.
- A PostprocessingBuildRaster function call the Geoserver REST API to fullfill the ImageMosaic plugin generation. After this step the imagery should be visible online through Geoserver UI and front end App.
- A PostprocessingBuildCache function calls the GeoWebCache API to start creating TileLayers and pre-seeding.
- A UtilityNotificationClickupFunction function to handle ClickUp notifications.
Invocation description
The following keys are required:
job_id: str, job id reference
client_tag: str, client tag to determine costing
The following keys are specific and optional for this step function. It is not possible to use only one of the keys, if it's opted to go for the optional input all keys need to be used. Otherwise the options will fallback to their defaults. These keys are written within an options key.
breaks: list, an array of numeric class labels, default: [1, 2, 3, 4]
classes: list, an array of classes describing the values between which is classified, default: [0, 5, 10, 15, 20]
colours: list, an array of HTML colour codes used for the classes, default: ['#549d2c', '#becd16', #cd9616', '#250015']
si_unit: list, an array of string labels, default: ['0 - 5%', '5 - 10%', '10 - 15%', '> 20%']
nodata: uint, value to overwrite the source dataset nodata value
The following keys can be used whenever:
legacy: bool, a switch used to determine whether the Geoserver or Serverless Infrastructure is used, default: false
Example
A minimal example:
{
"job_id": "20220520151302-1327-0ad42aeec1014698b5efc953b83b5825",
"client_tag": "Some Client"
}
An optional example:
{
"job_id": "20230801082343-1336-59db45f24ed944a7bf50083090fc6ed0",
"client_tag": "Some Client",
"legacy": true,
"options": {
"classes": [
0,
50,
100
],
"breaks": [
1,
2
],
"nodata": 0,
"colours": [
"#549d2c",
"#250015"
],
"si_unit": [
"0 - 50%",
"50 - 100%"
]
}
}