Skip to content

Conversation

@Wentao-Kuang
Copy link
Contributor

@Wentao-Kuang Wentao-Kuang commented Jan 12, 2025

Motivation

As a Basemaps user, I want to consume the NZTopo 50 & 250 Maps as a tile service.

Modification

This work defines a new Argo topo-maps-standardising workflow and an update to the existing imagery-import-cogify workflow. We have used this work to generate and publish the NZ Topo Gridless Maps layer to basemaps.

  1. topo-maps-standardising (new)

    This work defines a new Argo topo-maps-standardising workflow for coordinating the standardisation of an NZTopo Map Series imagery collection. We have designed the workflow to handle the following collections stored in the AWS S3 TopoReleaseArchive directory:

    s3://topographic-upload/TopoReleaseArchive/NZTopo50_GeoTif_Gridless/
    s3://topographic-upload/TopoReleaseArchive/NZTopo250_GeoTif_Gridless/
    

    To support this workflow, we have introduced new Topo Raster processes to the basemaps\cogify package. This workflow executes these new processes as part of its process flow.

    This workflow has two key steps:

    For an NZTopo Map Series imagery collection:

    • Generate a directory structure of STAC Item and Collection files
    • Standardise the contained GeoTIFF imagery files and save them within the generated directory structure

    From this, we can pass the resulting directories into the imagery-import-cogify workflow to process the standardised imagery into basemaps, either for previewing, or publishing.

  2. imagery-import-cogify (update)

    This work also updates the imagery-import-cogify workflow to support the new background parameter for the CLI create command of the basemaps/cogify package. This allows the command to override any transparent pixels with a fixed colour. In this work's context, this allows us to eliminate imagery artifacts that used to appear around the COGs, particularly for NZTopo Map Series imagery.

@tawera-manaena
Copy link
Contributor

tawera-manaena commented Feb 24, 2025

@Wentao-Kuang - I've made a minor adjustment to the workflow in Argo. We need to bring those changes here.

Before

        artifacts:
          - name: tiles
            path: /tmp/topo-stac-creation/tiles.json
          - name: brokenTiffs
            path: /tmp/topo-stac-creation/brokenTiffs.json

After

        artifacts:
          - name: tiles
            path: /tmp/topo-stac-creation/tiles.json
          - name: brokenTiffs
            path: /tmp/topo-stac-creation/broken-tiffs.json

@tawera-manaena tawera-manaena changed the title feat(basemaps): Topo raster maps standerised workflow. BM-1128 feat(basemaps): Topo raster maps standardisation workflow. BM-1128 Feb 26, 2025
@Wentao-Kuang Wentao-Kuang marked this pull request as ready for review February 27, 2025 00:39
@Wentao-Kuang Wentao-Kuang requested review from a team as code owners February 27, 2025 00:39
github-merge-queue bot pushed a commit to linz/basemaps that referenced this pull request Feb 27, 2025
…1116 (#3388)

### Motivation

As a Basemaps user, I want to consume the NZTopo 50 & 250 Maps [as a
tile service].

### Modifications

This work comprises a series of additions and modifications to the
`basemaps/cogify` package.

These changes allow us to generate [STAC] files for an NZTopo Map Series
imagery collection. They also allow us to generate standardised and
cloud-optimised GeoTIFFs from the map sheet files of such collections.
We have adjusted the `basemaps/cogify` package to handle the following
collections stored in the AWS S3 [TopoReleaseArchive] directory:

```
s3://topographic-upload/TopoReleaseArchive/NZTopo50_GeoTif_Gridless/
s3://topographic-upload/TopoReleaseArchive/NZTopo250_GeoTif_Gridless/
``` 

There is also a [new Argo workflow in development][pr-argo-workflow]
that depends on this work as part of its process flow. The workflow's
purpose is to automate the standardisation of an NZTopo Map Series
imagery collection.

### Generating STAC files

This works defines a new process for generating a nested directory
structure of STAC files for an NZTopo Map Series imagery collection. The
process operates as follows:

1. Loads the collection of GeoTiff images into memory
6. Extracts the map code, version, and metadata (e.g. EPSG) from each
image
7. Identifies the latest version of each map sheet by code
8. Groups the images by EPSG
9. Generates a StacItem file for each image, and a StacCollection file
for each EPSG grouping
10. Structures the groups of StacItem and StacCollection files into a
directory tree
11. Saves the files as they are structured to a target location

#### Outputs

The command groups the images by EPSG and then structures the generated
StacItem and StacCollection files, as illustrated:

| Schema | Example |
| - | - |
| ![][schema] | ![][example] |

The command then saves the generated tree of folders and files into the
target location directory.

### Processing Map Sheet files

This work extends the `create` CLI command of the `basemaps/cogify`
package. This extension allows the command to recognise and process the
map sheet files of an NZTopo Map Series imagery collection by way of
particular properties added to the accompanying STAC files.

[as a tile service]:
#3365 (comment)
[STAC]: https://stacspec.org/en
[TopoReleaseArchive]:
https://linz-topographic-upload.s3.ap-southeast-2.amazonaws.com/topographic/TopoReleaseArchive/

[pr-argo-workflow]: linz/topo-workflows#932

[schema]:
https://github.com/user-attachments/assets/2f4eddd7-eb2c-4796-8ab7-b3d9eca9140f
[example]:
https://github.com/user-attachments/assets/8f111ba6-befd-44b5-9566-db07a07089ed

---------

Co-authored-by: Blayne Chard <[email protected]>
Co-authored-by: Tawera Manaena <[email protected]>
@Wentao-Kuang Wentao-Kuang force-pushed the feat/topo-standarise-workflow branch from d14cbb0 to 586b53a Compare February 28, 2025 02:03
@tawera-manaena tawera-manaena self-requested a review February 28, 2025 02:04
tawera-manaena
tawera-manaena previously approved these changes Feb 28, 2025
@tawera-manaena tawera-manaena added this pull request to the merge queue Feb 28, 2025
Merged via the queue into master with commit cfb9951 Feb 28, 2025
3 checks passed
@tawera-manaena tawera-manaena deleted the feat/topo-standarise-workflow branch February 28, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants