Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lambda-tiler): update imagery layer attributions to show licensor details BM-897 #3357

Merged
merged 6 commits into from
Oct 24, 2024

Conversation

tawera-manaena
Copy link
Contributor

@tawera-manaena tawera-manaena commented Oct 16, 2024

Motivation

As an Imagery Data Maintainer, I want to ensure that imagery is attributed to the correct licensor(s) for all published surveys so that councils and government departments receive appropriate recognition.


Attribution Types

Compact Extended
Template © stac_license licensor_names © stac_license licensor_names - tileset_info
Example © CC BY 4.0 Otago Regional Council © CC BY 4.0 Otago Regional Council - Otago 0.3 Rural Aerial Photos (2017-2019)

Modifications

packages/config-loader

  • Updated the package so that it copies through providers metadata when generating config files.

packages/lambda-tiler

  • Updated the attribution endpoint to include providers metadata as part of collections when returning AttributionStac responses.

  • Updated the style endpoint to include a compact attribution on sources when returning StyleJson responses.

packages/attribution

  • Updated the attribution class to return an extended attribution for the bottom-right of the landing page.

Verification

packages/lambda-tiler

  1. Implemented a test suite for the style endpoint to ensure it generates the correct compact attribution for a given tileset.

packages/attribution

  1. Implemented a test suite to verify that the new utility function createLicensorAttribution() generates the correct compact attribution for a given list of providers.

Example

Layer: Top of the South 0.15m Flood Aerial Photos (2022)

To recreate this example, you will need to locally download the collection.json file and at least one of the .TIFF files. You will then need to run them through the cogify process and serve them using the server package.

Landing Page

Screenshot showing the extended attribution for the bottom-right of the landing page.

top-of-the-south-flood-2022-0 15m

Styles Endpoint

/v1/styles/:styleName.json

Excerpt from the JSON response showing the provider metadata:

{
    ...
    "collections": [
        {
            ...
            "providers": [
                {
                    "name": "Nelson City Council",
                    "roles": [
                        "licensor"
                    ]
                },
                {
                    "name": "Tasman District Council",
                    "roles": [
                        "licensor"
                    ]
                },
                {
                    "name": "Waka Kotahi",
                    "roles": [
                        "licensor"
                    ]
                },
                ...
            ],
            ...
        }
    ],
    ...
}

Attribution Endpoint

/v1/tiles/:tileSet/:tileMatrix/attribution.json

Excerpt from the JSON response showing the compact attribution for the layer source:

{
    ...
    "sources": {
        "basemaps-top-of-the-south-flood-2022-0.15m": {
            ...
            "attribution": "© CC BY 4.0 Nelson City Council, Tasman District Council, Waka Kotahi",
            ...
        }
    },
    ...
}

@tawera-manaena tawera-manaena changed the title Update imagery layer attributions to show licensor details BM-897 feat(lambda-tiler): update imagery layer attributions to show licensor details BM-897 Oct 20, 2024
@tawera-manaena tawera-manaena marked this pull request as ready for review October 22, 2024 20:08
@tawera-manaena tawera-manaena requested a review from a team as a code owner October 22, 2024 20:08
@tawera-manaena tawera-manaena marked this pull request as draft October 23, 2024 02:29
@tawera-manaena tawera-manaena marked this pull request as ready for review October 23, 2024 03:57
packages/attribution/src/attribution.ts Outdated Show resolved Hide resolved
packages/lambda-tiler/src/routes/attribution.ts Outdated Show resolved Hide resolved
packages/lambda-tiler/src/routes/attribution.ts Outdated Show resolved Hide resolved
packages/landing/src/attribution.ts Outdated Show resolved Hide resolved
@blacha blacha added this pull request to the merge queue Oct 24, 2024
Merged via the queue into master with commit e702c7e Oct 24, 2024
10 of 11 checks passed
@blacha blacha deleted the feat/show-layer-attribution branch October 24, 2024 20:52
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.

2 participants