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(server): add redirect route to pre-zoomed tileset BM-1076 #3354

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

tawera-manaena
Copy link
Contributor

@tawera-manaena tawera-manaena commented Sep 30, 2024

Motivation

As an Imagery Data Maintainer, I want a link for each tileset that auto-zooms to its bounding box. This is so I can keep Basemaps URL links short, clean looking, and zoomed to the right spot.

Modifications

  1. Added a /v1/link/:tileSet route to the basemaps/lambda-tiler package.
  2. Implemented a function to capture and process requests to v1/link/:tileSet.
    • On success, returns a 302 response that redirects the client to a Basemaps URL that is already zoomed to the extent of the tileset's imagery.
    • On failure, returns a 4xx response explaining why the function terminated.

Usage

Enters from... Status Redirects to...
/v1/link/ashburton-2023-0.1m 302 Found /@-43.9157018,171.7712402,z12?i=ashburton-2023-0.1m

Verification

Depending on the size of the user's viewport, there are situations where the pre-zooming estimation may or may not suffice. See each of the following examples for details:

Ashburton 0.1m (2023)

From To
/link/ashburton-2023-0.1m /@-43.9157018,171.7712402,z12?i=ashburton-2023-0.1m
img_1

The tileset is over-zoomed by a slight amount. But, it's not noticeable.

Christchurch 0.05m (2021)

From To
/link/christchurch-urban-2021-0.05m @-43.5286378,172.6309204,z12?i=christchurch-urban-2021-0.05m
img_2

The tileset is under-zoomed quite substantially. It seems as though the bounding box itself is much larger than the imagery. The user will have to zoom in themselves.

Otago 0.1m (2018)

From To
/link/otago-urban-2018-0 1m /@-45.2516883,169.6289062,z10?i=otago-urban-2018-0.1m
img_3

Regions of the tileset are cut off from the viewport. The user will have to zoom out themselves.

@tawera-manaena tawera-manaena requested a review from a team as a code owner September 30, 2024 01:59
@tawera-manaena tawera-manaena changed the title feat(server): add redirect route to pre-zoomed tileset feat(server): add redirect route to pre-zoomed tileset BM-1076 Sep 30, 2024
@tawera-manaena tawera-manaena marked this pull request as draft October 1, 2024 00:08
@tawera-manaena tawera-manaena marked this pull request as ready for review October 2, 2024 02:25
@tawera-manaena
Copy link
Contributor Author

tawera-manaena commented Oct 2, 2024

Revisions

Modifications

  1. Added a /v1/link/:tileSet route to the basemaps/lambda-tiler package.
  2. Implemented a test suite to ensure the endpoint works as expected.

Limitations

  1. The endpoint does not allow the user to specify a projection. However, this can easily be added in the future. At the moment, the endpoint only supports tilesets that have EPSG:3857 imagery layers.

@blacha blacha added this pull request to the merge queue Oct 7, 2024
Merged via the queue into master with commit 5b207de Oct 7, 2024
12 checks passed
@blacha blacha deleted the feat/pre-zoomed-tileset-link branch October 7, 2024 02:00
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