Commit 5b207de
authored
### 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.
[img_1]:
https://github.com/user-attachments/assets/1ae960b6-e4d6-4f78-8512-1e45edd4dc41
[img_2]:
https://github.com/user-attachments/assets/e51c74e0-4ab2-4255-930b-75bc53d5adcf
[img_3]:
https://github.com/user-attachments/assets/9e4835bc-296e-4f9a-aad0-3629adf7cc74
1 parent c156391 commit 5b207de
File tree
3 files changed
+173
-0
lines changed- packages/lambda-tiler/src
- routes
- __tests__
3 files changed
+173
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments