Skip to content

Commit

Permalink
feat(basemaps): Update the cogify workflow to support elevation impor…
Browse files Browse the repository at this point in the history
…ts. BM-998 (#509)

#### Motivation

The latest basemaps cogify supports elevation import with lerc presets.
We can now update the workflow to support that as well.

#### Modification

- Add the elevation related parameter to workflow.
- Add a skip for create-overview as it is not supported for elevation.

#### Checklist

_If not applicable, provide explanation of why._

- [ ] Tests updated
- [ ] Docs updated
- [ ] Issue linked in Title

---------

Co-authored-by: Wentao Kuang <[email protected]>
  • Loading branch information
blacha and Wentao-Kuang authored May 30, 2024
1 parent 29ac29f commit 52e8c79
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions workflows/basemaps/imagery-import-cogify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ spec:
description: Ticket ID e.g. 'AIP-55'
value: ''

- name: preset
description: Import preset configuration, WebP for 4 band RGBA LERC for 1 band DEM/DSM
value: 'webp'
enum:
- 'webp'
- 'lerc_10mm'
- 'lerc_1mm'

- name: region
description: Region of the dataset
value: 'new-zealand'
Expand Down Expand Up @@ -84,13 +92,15 @@ spec:
- 'Scanned Aerial Imagery'
- 'Satellite Imagery'
- 'Event'
- 'Elevation'

- name: target
description: Target location for output COGs
value: 's3://linz-basemaps/'
enum:
- 's3://linz-basemaps/'
- 's3://linz-basemaps-staging/'
- 's3://linz-workflowsnp-scratch/'

- name: tile_matrix
description: Output tile matrix, ";" separated list
Expand All @@ -112,13 +122,21 @@ spec:
description: How many items to pass to each create-cog job
value: '20'

- name: create_overview
description: 'Create overview after importing imagery.'
value: 'true'
enum:
- 'true'
- 'false'

templates:
# Main entrypoint into the workflow
- name: main
inputs:
parameters:
- name: source
- name: target
- name: preset
- name: tile_matrix
- name: cutline
- name: cutline_blend
Expand All @@ -135,6 +153,8 @@ spec:
value: '{{ inputs.parameters.source }}'
- name: target
value: '{{ inputs.parameters.target }}'
- name: preset
value: '{{ inputs.parameters.preset }}'
- name: tile_matrix
value: '{{ item }}'
- name: cutline
Expand Down Expand Up @@ -162,6 +182,7 @@ spec:
- name: cutline
- name: cutline_blend
- name: group_size
- name: preset
dag:
tasks:
# generate a tile covering from the source imagery
Expand All @@ -173,6 +194,8 @@ spec:
value: '{{ inputs.parameters.source }}'
- name: target
value: '{{ inputs.parameters.target }}'
- name: preset
value: '{{ inputs.parameters.preset }}'
- name: tile_matrix
value: '{{ inputs.parameters.tile_matrix }}'
- name: cutline
Expand Down Expand Up @@ -209,9 +232,11 @@ spec:
- name: covering_grouped
from: '{{ tasks.group.outputs.artifacts.output }}'

# TODO: overviews are only supported in RGBA pipelines
# once all COGs are created generate a more overviews to increase tile rendering performance
- name: create-overview
template: create-overview
when: '{{workflow.parameters.create_overview}} == true'
depends: create-cog
arguments:
parameters:
Expand Down Expand Up @@ -247,6 +272,7 @@ spec:
- name: tile_matrix
- name: cutline
- name: cutline_blend
- name: preset
container:
image: ghcr.io/linz/basemaps/cli:{{ workflow.parameters.version_basemaps_cli }}
resources:
Expand All @@ -258,6 +284,7 @@ spec:
value: s3://linz-bucket-config/config.basemaps.json
args:
- 'cover'
- '--preset={{ inputs.parameters.preset }}'
- '--tile-matrix={{ inputs.parameters.tile_matrix }}'
- "{{= sprig.empty(inputs.parameters.cutline) ? '' : '--cutline=' + inputs.parameters.cutline }}"
- '--cutline-blend={{ inputs.parameters.cutline_blend }}'
Expand Down

0 comments on commit 52e8c79

Please sign in to comment.