@basemaps/lambda-tiler 6.39.0 → 6.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/build/__tests__/config.data.d.ts.map +1 -1
- package/build/__tests__/config.data.js +142 -1
- package/build/__tests__/config.data.js.map +1 -1
- package/build/__tests__/wmts.capability.test.js +105 -79
- package/build/__tests__/wmts.capability.test.js.map +1 -1
- package/build/__tests__/xyz.util.d.ts.map +1 -1
- package/build/__tests__/xyz.util.js +6 -2
- package/build/__tests__/xyz.util.js.map +1 -1
- package/build/cli/render.tile.d.ts +2 -0
- package/build/cli/render.tile.d.ts.map +1 -0
- package/build/cli/render.tile.js +36 -0
- package/build/cli/render.tile.js.map +1 -0
- package/build/routes/__tests__/attribution.test.js +62 -2
- package/build/routes/__tests__/attribution.test.js.map +1 -1
- package/build/routes/__tests__/wmts.test.js +50 -8
- package/build/routes/__tests__/wmts.test.js.map +1 -1
- package/build/routes/attribution.d.ts +11 -0
- package/build/routes/attribution.d.ts.map +1 -1
- package/build/routes/attribution.js +32 -28
- package/build/routes/attribution.js.map +1 -1
- package/build/routes/tile.json.d.ts.map +1 -1
- package/build/routes/tile.json.js +2 -1
- package/build/routes/tile.json.js.map +1 -1
- package/build/routes/tile.style.json.d.ts.map +1 -1
- package/build/routes/tile.style.json.js +2 -1
- package/build/routes/tile.style.json.js.map +1 -1
- package/build/routes/tile.wmts.d.ts.map +1 -1
- package/build/routes/tile.wmts.js +12 -7
- package/build/routes/tile.wmts.js.map +1 -1
- package/build/routes/tile.xyz.raster.d.ts.map +1 -1
- package/build/routes/tile.xyz.raster.js +5 -1
- package/build/routes/tile.xyz.raster.js.map +1 -1
- package/build/util/__test__/filter.test.d.ts +2 -0
- package/build/util/__test__/filter.test.d.ts.map +1 -0
- package/build/util/__test__/filter.test.js +64 -0
- package/build/util/__test__/filter.test.js.map +1 -0
- package/build/util/config.loader.d.ts.map +1 -1
- package/build/util/config.loader.js +2 -3
- package/build/util/config.loader.js.map +1 -1
- package/build/util/filter.d.ts +15 -0
- package/build/util/filter.d.ts.map +1 -0
- package/build/util/filter.js +59 -0
- package/build/util/filter.js.map +1 -0
- package/build/util/validate.d.ts.map +1 -1
- package/build/util/validate.js +4 -3
- package/build/util/validate.js.map +1 -1
- package/build/wmts.capability.d.ts +61 -28
- package/build/wmts.capability.d.ts.map +1 -1
- package/build/wmts.capability.js +175 -99
- package/build/wmts.capability.js.map +1 -1
- package/dist/index.js +110 -82
- package/dist/node_modules/.package-lock.json +17 -17
- package/dist/node_modules/detect-libc/README.md +4 -1
- package/dist/node_modules/detect-libc/index.d.ts +3 -0
- package/dist/node_modules/detect-libc/lib/detect-libc.js +105 -4
- package/dist/node_modules/detect-libc/lib/filesystem.js +41 -0
- package/dist/node_modules/detect-libc/lib/process.js +3 -0
- package/dist/node_modules/detect-libc/package.json +7 -3
- package/dist/node_modules/minimist/.eslintrc +25 -50
- package/dist/node_modules/minimist/CHANGELOG.md +87 -1
- package/dist/node_modules/minimist/README.md +14 -10
- package/dist/node_modules/minimist/example/parse.js +2 -0
- package/dist/node_modules/minimist/index.js +256 -242
- package/dist/node_modules/minimist/package.json +73 -73
- package/dist/node_modules/minimist/test/all_bool.js +26 -24
- package/dist/node_modules/minimist/test/bool.js +146 -147
- package/dist/node_modules/minimist/test/dash.js +33 -21
- package/dist/node_modules/minimist/test/default_bool.js +26 -24
- package/dist/node_modules/minimist/test/dotted.js +13 -11
- package/dist/node_modules/minimist/test/kv_short.js +26 -10
- package/dist/node_modules/minimist/test/long.js +28 -26
- package/dist/node_modules/minimist/test/num.js +30 -28
- package/dist/node_modules/minimist/test/parse.js +169 -157
- package/dist/node_modules/minimist/test/parse_modified.js +7 -5
- package/dist/node_modules/minimist/test/proto.js +41 -37
- package/dist/node_modules/minimist/test/short.js +57 -55
- package/dist/node_modules/minimist/test/stop_early.js +10 -8
- package/dist/node_modules/minimist/test/unknown.js +83 -81
- package/dist/node_modules/minimist/test/whitespace.js +6 -4
- package/dist/node_modules/node-abi/.circleci/config.yml +2 -2
- package/dist/node_modules/node-abi/.github/CODEOWNERS +1 -0
- package/dist/node_modules/node-abi/.github/workflows/semantic.yml +26 -0
- package/dist/node_modules/node-abi/.github/workflows/update-abi.yml +5 -4
- package/dist/node_modules/node-abi/README.md +5 -3
- package/dist/node_modules/node-abi/abi_registry.json +32 -1
- package/dist/node_modules/node-abi/package.json +4 -4
- package/dist/node_modules/node-abi/scripts/update-abi-registry.js +2 -2
- package/dist/node_modules/readable-stream/README.md +1 -1
- package/dist/node_modules/readable-stream/lib/_stream_duplex.js +12 -25
- package/dist/node_modules/readable-stream/lib/_stream_passthrough.js +2 -4
- package/dist/node_modules/readable-stream/lib/_stream_readable.js +176 -273
- package/dist/node_modules/readable-stream/lib/_stream_transform.js +26 -37
- package/dist/node_modules/readable-stream/lib/_stream_writable.js +118 -174
- package/dist/node_modules/readable-stream/lib/internal/streams/async_iterator.js +10 -37
- package/dist/node_modules/readable-stream/lib/internal/streams/buffer_list.js +20 -47
- package/dist/node_modules/readable-stream/lib/internal/streams/destroy.js +8 -17
- package/dist/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -19
- package/dist/node_modules/readable-stream/lib/internal/streams/from.js +12 -24
- package/dist/node_modules/readable-stream/lib/internal/streams/pipeline.js +5 -16
- package/dist/node_modules/readable-stream/lib/internal/streams/state.js +2 -7
- package/dist/node_modules/readable-stream/package.json +1 -1
- package/dist/node_modules/semver/README.md +70 -1
- package/dist/node_modules/semver/bin/semver.js +16 -2
- package/dist/node_modules/semver/classes/comparator.js +39 -34
- package/dist/node_modules/semver/classes/range.js +45 -28
- package/dist/node_modules/semver/classes/semver.js +32 -17
- package/dist/node_modules/semver/functions/coerce.js +1 -1
- package/dist/node_modules/semver/functions/diff.js +58 -16
- package/dist/node_modules/semver/functions/inc.js +3 -2
- package/dist/node_modules/semver/functions/parse.js +5 -22
- package/dist/node_modules/semver/index.js +1 -0
- package/dist/node_modules/semver/internal/constants.js +20 -2
- package/dist/node_modules/semver/internal/parse-options.js +14 -10
- package/dist/node_modules/semver/internal/re.js +34 -4
- package/dist/node_modules/semver/package.json +8 -7
- package/dist/node_modules/semver/ranges/intersects.js +1 -1
- package/dist/node_modules/semver/ranges/subset.js +6 -3
- package/dist/package-lock.json +18 -349
- package/dist/package.json +1 -2
- package/package.json +9 -10
- package/src/__tests__/config.data.ts +142 -1
- package/src/__tests__/wmts.capability.test.ts +117 -79
- package/src/__tests__/xyz.util.ts +6 -2
- package/src/cli/render.tile.ts +41 -0
- package/src/routes/__tests__/attribution.test.ts +64 -2
- package/src/routes/__tests__/wmts.test.ts +70 -9
- package/src/routes/attribution.ts +28 -28
- package/src/routes/tile.json.ts +2 -1
- package/src/routes/tile.style.json.ts +2 -1
- package/src/routes/tile.wmts.ts +13 -6
- package/src/routes/tile.xyz.raster.ts +4 -1
- package/src/util/__test__/filter.test.ts +80 -0
- package/src/util/config.loader.ts +1 -2
- package/src/util/filter.ts +60 -0
- package/src/util/validate.ts +4 -3
- package/src/wmts.capability.ts +216 -123
- package/tsconfig.tsbuildinfo +1 -1
- package/test-dump.js +0 -6
- package/test-imagery.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,57 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.41.0](https://github.com/linz/basemaps/compare/v6.40.0...v6.41.0) (2023-07-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **config:** allow initializing config from URLs ([#2830](https://github.com/linz/basemaps/issues/2830)) ([0ea552e](https://github.com/linz/basemaps/commit/0ea552ec32ad723f98c96d533f18a8afc51d9657))
|
|
12
|
+
* truncate the api key when logging ([#2828](https://github.com/linz/basemaps/issues/2828)) ([3396593](https://github.com/linz/basemaps/commit/33965937fdc6cce4bc50b5ed41616a65c830ec6f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **lambda-tiler:** return 204 no content instead of a empty images ([#2829](https://github.com/linz/basemaps/issues/2829)) ([db3ff1b](https://github.com/linz/basemaps/commit/db3ff1b09f849a26d7287925c7b57d71e1fa6d76))
|
|
18
|
+
* upgrade lambdas to nodejs 18 ([#2639](https://github.com/linz/basemaps/issues/2639)) ([17471e1](https://github.com/linz/basemaps/commit/17471e1d56fbe17b695e4a49b1fbe55ece215596))
|
|
19
|
+
* **cogify:** retile imagery into COGS aligned to a tile matrix ([#2759](https://github.com/linz/basemaps/issues/2759)) ([ddd99d3](https://github.com/linz/basemaps/commit/ddd99d3548c65ec4ce5b7c608d6bf9360f053635))
|
|
20
|
+
* **lambda-tiler:** Include the disabled layers in the attribution with minZoom of 32. ([#2746](https://github.com/linz/basemaps/issues/2746)) ([d87e8dd](https://github.com/linz/basemaps/commit/d87e8dd1a0c24d511fc786078111fadc752bc4ab))
|
|
21
|
+
* **lambda-tiler:** Refactoring the wmts Capablity to builder interface. ([#2686](https://github.com/linz/basemaps/issues/2686)) ([4d223b6](https://github.com/linz/basemaps/commit/4d223b6b02675a271d1393ff4c6d0e7f8348084b))
|
|
22
|
+
* **landing:** Update the daterange slider to years button. ([#2764](https://github.com/linz/basemaps/issues/2764)) ([ef93543](https://github.com/linz/basemaps/commit/ef935433df6065f4baeb458b3c8a9efec06621fa))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Reverts
|
|
26
|
+
|
|
27
|
+
* Revert "feat(lambda-tiler): return 204 no content instead of a empty images (#2829)" (#2836) ([f1ed481](https://github.com/linz/basemaps/commit/f1ed481db08702189f169e745bf0ff7dad697175)), closes [#2829](https://github.com/linz/basemaps/issues/2829) [#2836](https://github.com/linz/basemaps/issues/2836)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [6.40.0](https://github.com/linz/basemaps/compare/v6.39.0...v6.40.0) (2023-03-16)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **lambda-tiler:** do not crash server when assets are not found ([#2674](https://github.com/linz/basemaps/issues/2674)) ([77b75da](https://github.com/linz/basemaps/commit/77b75da7541a5ae3e521551d3b8530e2c06518d3))
|
|
39
|
+
* **server:** gsd does not actually need to match ([#2694](https://github.com/linz/basemaps/issues/2694)) ([3737628](https://github.com/linz/basemaps/commit/373762875c2615515ce0853ba9dadcd04a2d988f))
|
|
40
|
+
* **server:** make --no-config actually load the configuration from tiffs ([#2682](https://github.com/linz/basemaps/issues/2682)) ([019ee50](https://github.com/linz/basemaps/commit/019ee50ee22cda2ce143f9a012d4aaa9ffc0edc9))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Features
|
|
44
|
+
|
|
45
|
+
* **config:** Make the config title as not null. ([#2667](https://github.com/linz/basemaps/issues/2667)) ([5e54854](https://github.com/linz/basemaps/commit/5e54854c10327385037122f7b7aada6adf312fae))
|
|
46
|
+
* **lambda-tiler:** Move the union out of the calculation loop to improve the atrribution api performance ([#2732](https://github.com/linz/basemaps/issues/2732)) ([dbedf1b](https://github.com/linz/basemaps/commit/dbedf1b1794cc7b7b46f4c114a40f4a73289918a))
|
|
47
|
+
* **lambda-tiler:** simple cli to trace the rendering of a tile ([#2678](https://github.com/linz/basemaps/issues/2678)) ([4a28aff](https://github.com/linz/basemaps/commit/4a28affa3737cd492143e485374fa4db6035da64))
|
|
48
|
+
* **lambda-tiler:** trace if a filter has been applied to the layers ([#2664](https://github.com/linz/basemaps/issues/2664)) ([b4455e9](https://github.com/linz/basemaps/commit/b4455e9682a4dedcaaefde8e90cb72b6de29b8f6))
|
|
49
|
+
* **lambda-tiler:** Update the wmts resource url to include the daterange. ([#2669](https://github.com/linz/basemaps/issues/2669)) ([2068610](https://github.com/linz/basemaps/commit/2068610631f7245e4fa063c3d2a8c12c7f011c0d))
|
|
50
|
+
* **server:** change CLI interface to support multiple tiff folders ([#2688](https://github.com/linz/basemaps/issues/2688)) ([7fcd310](https://github.com/linz/basemaps/commit/7fcd310425aaf02bbadab2bb3b89cce5b7462c8f))
|
|
51
|
+
* filter layers by date ([#2662](https://github.com/linz/basemaps/issues/2662)) ([745b6b6](https://github.com/linz/basemaps/commit/745b6b6e0ae40c5094647cf602ddf2bdd29a7d5f))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
6
57
|
# [6.39.0](https://github.com/linz/basemaps/compare/v6.38.0...v6.39.0) (2023-01-25)
|
|
7
58
|
|
|
8
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.data.d.ts","sourceRoot":"","sources":["../../src/__tests__/config.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AAK1B,eAAO,MAAM,aAAa,EAAE,mBAiB3B,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,mBAgB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAezB,CAAC;AACF,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"config.data.d.ts","sourceRoot":"","sources":["../../src/__tests__/config.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,aAAa,EACb,cAAc,EAEd,mBAAmB,EACnB,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AAK1B,eAAO,MAAM,aAAa,EAAE,mBAiB3B,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,mBAgB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAezB,CAAC;AACF,eAAO,MAAM,WAAW,EAAE,aA4JzB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,cA2BtB,CAAC;AAEF,qBAAa,QAAQ;IACnB,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB;IASvD,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB;IASvD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM;CAY7C"}
|
|
@@ -67,7 +67,148 @@ export const Imagery3857 = {
|
|
|
67
67
|
width: 51977.179234057665,
|
|
68
68
|
height: 30574.81131407339,
|
|
69
69
|
},
|
|
70
|
-
files: [
|
|
70
|
+
files: [
|
|
71
|
+
{
|
|
72
|
+
x: 19461478.89763212,
|
|
73
|
+
y: -4591419.415033963,
|
|
74
|
+
width: 305.7481131407044,
|
|
75
|
+
height: 305.7481131407044,
|
|
76
|
+
name: '17-129188-80552',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
x: 19502754.89290612,
|
|
80
|
+
y: -4603343.591446448,
|
|
81
|
+
width: 305.7481131407044,
|
|
82
|
+
height: 305.7481131407044,
|
|
83
|
+
name: '17-129323-80591',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
x: 19504283.633471873,
|
|
87
|
+
y: -4608847.057483015,
|
|
88
|
+
width: 611.4962262814096,
|
|
89
|
+
height: 611.4962262814096,
|
|
90
|
+
name: '16-64664-40304',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
x: 19509175.60328212,
|
|
94
|
+
y: -4605178.080125325,
|
|
95
|
+
width: 611.4962262814096,
|
|
96
|
+
height: 611.4962262814096,
|
|
97
|
+
name: '16-64672-40298',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
x: 19509175.60328212,
|
|
101
|
+
y: -4604566.583899044,
|
|
102
|
+
width: 611.4962262814096,
|
|
103
|
+
height: 611.4962262814096,
|
|
104
|
+
name: '16-64672-40297',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
x: 19459032.912726905,
|
|
108
|
+
y: -4582552.719752827,
|
|
109
|
+
width: 1222.9924525628148,
|
|
110
|
+
height: 1222.9924525628148,
|
|
111
|
+
name: '15-32295-20130',
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
x: 19460255.905179467,
|
|
115
|
+
y: -4592336.659373329,
|
|
116
|
+
width: 1222.9924525628148,
|
|
117
|
+
height: 1222.9924525628148,
|
|
118
|
+
name: '15-32296-20138',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
x: 19501837.648566607,
|
|
122
|
+
y: -4609458.55370921,
|
|
123
|
+
width: 1222.9924525628148,
|
|
124
|
+
height: 1222.9924525628148,
|
|
125
|
+
name: '15-32330-20152',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
x: 19503060.64101917,
|
|
129
|
+
y: -4609458.55370921,
|
|
130
|
+
width: 1222.9924525628148,
|
|
131
|
+
height: 1222.9924525628148,
|
|
132
|
+
name: '15-32331-20152',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
x: 19503060.64101917,
|
|
136
|
+
y: -4603343.591446393,
|
|
137
|
+
width: 1222.9924525628148,
|
|
138
|
+
height: 1222.9924525628148,
|
|
139
|
+
name: '15-32331-20147',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
x: 19457809.920274343,
|
|
143
|
+
y: -4593559.651825892,
|
|
144
|
+
width: 2445.9849051256297,
|
|
145
|
+
height: 2445.9849051256297,
|
|
146
|
+
name: '14-16147-10069',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
x: 19457809.920274343,
|
|
150
|
+
y: -4591113.666920764,
|
|
151
|
+
width: 2445.9849051256297,
|
|
152
|
+
height: 2445.9849051256297,
|
|
153
|
+
name: '14-16147-10068',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
x: 19457809.920274343,
|
|
157
|
+
y: -4588667.682015641,
|
|
158
|
+
width: 2445.9849051256297,
|
|
159
|
+
height: 2445.9849051256297,
|
|
160
|
+
name: '14-16147-10067',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
x: 19457809.920274343,
|
|
164
|
+
y: -4581329.727300262,
|
|
165
|
+
width: 2445.9849051256297,
|
|
166
|
+
height: 2445.9849051256297,
|
|
167
|
+
name: '14-16147-10064',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
x: 19460255.905179467,
|
|
171
|
+
y: -4591113.666920764,
|
|
172
|
+
width: 2445.9849051256297,
|
|
173
|
+
height: 2445.9849051256297,
|
|
174
|
+
name: '14-16148-10068',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
x: 19460255.905179586,
|
|
178
|
+
y: -4588667.682015713,
|
|
179
|
+
width: 4891.969810251274,
|
|
180
|
+
height: 4891.969810251274,
|
|
181
|
+
name: '13-8074-5033',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
x: 19460255.905179586,
|
|
185
|
+
y: -4583775.712205462,
|
|
186
|
+
width: 4891.969810251274,
|
|
187
|
+
height: 4891.969810251274,
|
|
188
|
+
name: '13-8074-5032',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
x: 19499391.663661595,
|
|
192
|
+
y: -4608235.561256718,
|
|
193
|
+
width: 4891.969810251274,
|
|
194
|
+
height: 4891.969810251274,
|
|
195
|
+
name: '13-8082-5037',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
x: 19504283.63347185,
|
|
199
|
+
y: -4608235.561256718,
|
|
200
|
+
width: 4891.969810251274,
|
|
201
|
+
height: 4891.969810251274,
|
|
202
|
+
name: '13-8083-5037',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
x: 19504283.63347185,
|
|
206
|
+
y: -4603343.591446467,
|
|
207
|
+
width: 4891.969810251274,
|
|
208
|
+
height: 4891.969810251274,
|
|
209
|
+
name: '13-8083-5036',
|
|
210
|
+
},
|
|
211
|
+
],
|
|
71
212
|
};
|
|
72
213
|
export const Provider = {
|
|
73
214
|
name: 'main',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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|
|
21
21
|
const wmts = new WmtsCapabilities({
|
|
22
22
|
httpBase: 'https://basemaps.test',
|
|
23
|
-
provider: Provider,
|
|
24
|
-
tileMatrix: [GoogleTms],
|
|
25
|
-
tileSet: TileSetAerial,
|
|
26
|
-
imagery: allImagery,
|
|
27
23
|
apiKey,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
});
|
|
25
|
+
wmts.addTileMatrix(GoogleTms);
|
|
26
|
+
for (const im of allImagery.values())
|
|
27
|
+
wmts.addImagery(im);
|
|
28
|
+
wmts.addFormats(ImageFormat.Avif);
|
|
29
|
+
wmts.addProvider(Provider);
|
|
30
|
+
wmts.addTileSet(TileSetAerial);
|
|
31
|
+
const wmtsCapability = wmts.toVNode();
|
|
32
|
+
const urls = tags(wmtsCapability, 'ResourceURL');
|
|
32
33
|
o(urls.length).equals(1);
|
|
33
34
|
o(urls[0].attrs.format).equals('image/avif');
|
|
34
35
|
o(urls[0].attrs.template).equals('https://basemaps.test/v1/tiles/aerial/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.avif?api=secret1234');
|
|
@@ -36,31 +37,34 @@ o.spec('WmtsCapabilities', () => {
|
|
|
36
37
|
o('should include config location', () => {
|
|
37
38
|
const wmts = new WmtsCapabilities({
|
|
38
39
|
httpBase: 'https://basemaps.test',
|
|
39
|
-
provider: Provider,
|
|
40
|
-
tileMatrix: [GoogleTms],
|
|
41
|
-
tileSet: TileSetAerial,
|
|
42
|
-
imagery: allImagery,
|
|
43
40
|
apiKey,
|
|
44
41
|
config: 's3://linz-basemaps/config.json',
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
});
|
|
43
|
+
wmts.addTileMatrix(GoogleTms);
|
|
44
|
+
for (const im of allImagery.values())
|
|
45
|
+
wmts.addImagery(im);
|
|
46
|
+
wmts.addFormats(ImageFormat.Avif);
|
|
47
|
+
wmts.addProvider(Provider);
|
|
48
|
+
wmts.addTileSet(TileSetAerial);
|
|
49
|
+
const wmtsCapability = wmts.toVNode();
|
|
50
|
+
const urls = tags(wmtsCapability, 'ResourceURL');
|
|
49
51
|
o(urls.length).equals(1);
|
|
50
52
|
o(urls[0].attrs.format).equals('image/avif');
|
|
51
53
|
o(urls[0].attrs.template).equals('https://basemaps.test/v1/tiles/aerial/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.avif?api=secret1234&config=s3%3A%2F%2Flinz-basemaps%2Fconfig.json');
|
|
52
54
|
});
|
|
53
|
-
o('should be
|
|
54
|
-
const
|
|
55
|
+
o('should be adding encoding to utf-8', () => {
|
|
56
|
+
const wmts = new WmtsCapabilities({
|
|
55
57
|
httpBase: 'https://basemaps.test',
|
|
58
|
+
apiKey,
|
|
59
|
+
});
|
|
60
|
+
wmts.fromParams({
|
|
56
61
|
provider: Provider,
|
|
57
62
|
tileMatrix: [GoogleTms],
|
|
58
63
|
tileSet: TileSetAerial,
|
|
59
64
|
imagery: allImagery,
|
|
60
|
-
apiKey,
|
|
61
65
|
formats: [ImageFormat.Avif],
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
});
|
|
67
|
+
const xml = wmts.toXml();
|
|
64
68
|
o(xml.split('\n')[0]).deepEquals('<?xml version="1.0" encoding="utf-8"?>');
|
|
65
69
|
});
|
|
66
70
|
o('should support unicorns and rainbows', () => {
|
|
@@ -71,18 +75,19 @@ o.spec('WmtsCapabilities', () => {
|
|
|
71
75
|
tileSet.description = '🦄 🌈 Description';
|
|
72
76
|
const wmts = new WmtsCapabilities({
|
|
73
77
|
httpBase: 'https://basemaps.test',
|
|
74
|
-
provider: Provider,
|
|
75
|
-
tileMatrix: [GoogleTms],
|
|
76
|
-
tileSet,
|
|
77
|
-
imagery: allImagery,
|
|
78
78
|
apiKey,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
});
|
|
80
|
+
wmts.addTileMatrix(GoogleTms);
|
|
81
|
+
for (const im of allImagery.values())
|
|
82
|
+
wmts.addImagery(im);
|
|
83
|
+
wmts.addFormats(ImageFormat.Avif);
|
|
84
|
+
wmts.addProvider(Provider);
|
|
85
|
+
wmts.addTileSet(tileSet);
|
|
86
|
+
const wmtsCapability = wmts.toVNode();
|
|
87
|
+
const urls = tags(wmtsCapability, 'ResourceURL');
|
|
83
88
|
o(urls.length).equals(1);
|
|
84
89
|
o(urls[0].attrs.template).equals('https://basemaps.test/v1/tiles/🦄-🌈-2022-0.5m/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.avif?api=secret1234');
|
|
85
|
-
const layer = tags(
|
|
90
|
+
const layer = tags(wmtsCapability, 'Layer')[0];
|
|
86
91
|
const title = (_a = layer.find('ows:Title')) === null || _a === void 0 ? void 0 : _a.toString();
|
|
87
92
|
o(title).equals('<ows:Title>🦄 🌈 Imagery (2022)</ows:Title>');
|
|
88
93
|
const abstract = (_b = layer.find('ows:Abstract')) === null || _b === void 0 ? void 0 : _b.toString();
|
|
@@ -113,30 +118,33 @@ o.spec('WmtsCapabilities', () => {
|
|
|
113
118
|
};
|
|
114
119
|
const wmts = new WmtsCapabilities({
|
|
115
120
|
httpBase: 'https://basemaps.test',
|
|
116
|
-
provider: Provider,
|
|
117
|
-
tileMatrix: [GoogleTms],
|
|
118
|
-
tileSet,
|
|
119
|
-
imagery,
|
|
120
121
|
apiKey,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
});
|
|
123
|
+
wmts.addTileMatrix(GoogleTms);
|
|
124
|
+
for (const im of imagery.values())
|
|
125
|
+
wmts.addImagery(im);
|
|
126
|
+
wmts.addProvider(Provider);
|
|
127
|
+
wmts.addTileSet(tileSet);
|
|
128
|
+
wmts.addLayers(tileSet.layers);
|
|
129
|
+
const wmtsCapability = wmts.toVNode();
|
|
130
|
+
const layers = tags(wmtsCapability, 'Layer').map((c) => { var _a; return (_a = c.find('ows:Title')) === null || _a === void 0 ? void 0 : _a.textContent; });
|
|
124
131
|
// The base layer "Aerial Imagery" should always be first then all sub layers after
|
|
125
132
|
o(layers).deepEquals(['Aerial Imagery', 'aaaa', 'bbbb', 'Ōtorohanga 0.1m Urban Aerial Photos (2021)']);
|
|
126
133
|
});
|
|
127
|
-
o('should build capability xml for
|
|
134
|
+
o('should build capability xml for tileSet and projection', () => {
|
|
128
135
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
129
136
|
const imagery = new Map();
|
|
130
137
|
imagery.set(Imagery3857.id, Imagery3857);
|
|
131
138
|
const wmts = new WmtsCapabilities({
|
|
132
139
|
httpBase: 'https://basemaps.test',
|
|
133
|
-
provider: Provider,
|
|
134
|
-
tileMatrix: [GoogleTms],
|
|
135
|
-
tileSet: TileSetAerial,
|
|
136
|
-
imagery,
|
|
137
140
|
apiKey,
|
|
138
|
-
isIndividualLayers: false,
|
|
139
141
|
});
|
|
142
|
+
wmts.addTileMatrix(GoogleTms);
|
|
143
|
+
for (const im of imagery.values())
|
|
144
|
+
wmts.addImagery(im);
|
|
145
|
+
wmts.addProvider(Provider);
|
|
146
|
+
wmts.addTileSet(TileSetAerial);
|
|
147
|
+
wmts.addLayers(TileSetAerial.layers);
|
|
140
148
|
const raw = wmts.toVNode();
|
|
141
149
|
const serviceId = raw.find('ows:ServiceIdentification');
|
|
142
150
|
o((_a = serviceId === null || serviceId === void 0 ? void 0 : serviceId.find('ows:Abstract')) === null || _a === void 0 ? void 0 : _a.textContent).equals('the description');
|
|
@@ -167,15 +175,16 @@ o.spec('WmtsCapabilities', () => {
|
|
|
167
175
|
});
|
|
168
176
|
o('should include output the correct TileMatrix', () => {
|
|
169
177
|
var _a, _b, _c, _d;
|
|
170
|
-
const
|
|
178
|
+
const wmts = new WmtsCapabilities({
|
|
171
179
|
httpBase: 'https://basemaps.test',
|
|
172
|
-
provider: Provider,
|
|
173
|
-
tileMatrix: [GoogleTms],
|
|
174
|
-
tileSet: TileSetAerial,
|
|
175
|
-
imagery: allImagery,
|
|
176
180
|
apiKey,
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
});
|
|
182
|
+
wmts.addTileMatrix(GoogleTms);
|
|
183
|
+
for (const im of allImagery.values())
|
|
184
|
+
wmts.addImagery(im);
|
|
185
|
+
wmts.addProvider(Provider);
|
|
186
|
+
wmts.addTileSet(TileSetAerial);
|
|
187
|
+
const raw = wmts.toVNode();
|
|
179
188
|
const layer = raw.find('Contents', 'Layer');
|
|
180
189
|
o((_a = layer === null || layer === void 0 ? void 0 : layer.find('TileMatrixSetLink', 'TileMatrixSet')) === null || _a === void 0 ? void 0 : _a.textContent).equals('WebMercatorQuad');
|
|
181
190
|
const matrix = tags(raw, 'TileMatrixSet')[1];
|
|
@@ -199,20 +208,23 @@ o.spec('WmtsCapabilities', () => {
|
|
|
199
208
|
compareMatrix(tileMatrices[0], '0', 1, 559082264.028717);
|
|
200
209
|
compareMatrix(tileMatrices[10], '10', 1024, 545978.773465544);
|
|
201
210
|
});
|
|
202
|
-
o('should output individual imagery
|
|
211
|
+
o('should output individual imagery adds', () => {
|
|
203
212
|
var _a, _b, _c, _d;
|
|
204
213
|
const imagery = new Map();
|
|
205
214
|
imagery.set(Imagery3857.id, Imagery3857);
|
|
206
215
|
imagery.set(Imagery2193.id, Imagery2193);
|
|
207
|
-
const
|
|
216
|
+
const wmts = new WmtsCapabilities({
|
|
208
217
|
httpBase: 'https://basemaps.test',
|
|
218
|
+
});
|
|
219
|
+
wmts.fromParams({
|
|
209
220
|
provider: Provider,
|
|
210
221
|
tileMatrix: [GoogleTms],
|
|
211
222
|
tileSet: TileSetAerial,
|
|
212
|
-
imagery
|
|
223
|
+
imagery,
|
|
224
|
+
layers: TileSetAerial.layers,
|
|
213
225
|
formats: [ImageFormat.Png],
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
});
|
|
227
|
+
const raw = wmts.toVNode();
|
|
216
228
|
const tms = raw === null || raw === void 0 ? void 0 : raw.find('TileMatrixSet', 'ows:Identifier');
|
|
217
229
|
o(tms === null || tms === void 0 ? void 0 : tms.textContent).equals('WebMercatorQuad');
|
|
218
230
|
const urls = Array.from(raw ? raw.tags('ResourceURL') : []);
|
|
@@ -233,15 +245,17 @@ o.spec('WmtsCapabilities', () => {
|
|
|
233
245
|
const imagery = new Map();
|
|
234
246
|
imagery.set(Imagery3857.id, Imagery3857);
|
|
235
247
|
imagery.set(Imagery2193.id, Imagery2193);
|
|
236
|
-
const
|
|
248
|
+
const wmts = new WmtsCapabilities({
|
|
237
249
|
httpBase: 'https://basemaps.test',
|
|
250
|
+
});
|
|
251
|
+
wmts.fromParams({
|
|
238
252
|
provider: Provider,
|
|
239
253
|
tileMatrix: [GoogleTms, Nztm2000QuadTms],
|
|
240
254
|
tileSet: TileSetAerial,
|
|
241
255
|
imagery: imagery,
|
|
242
256
|
formats: [ImageFormat.Png],
|
|
243
|
-
|
|
244
|
-
|
|
257
|
+
});
|
|
258
|
+
const raw = wmts.toVNode();
|
|
245
259
|
const layers = tags(raw, 'Layer');
|
|
246
260
|
o(layers.length).equals(1);
|
|
247
261
|
const layer = layers[0];
|
|
@@ -263,10 +277,10 @@ o.spec('WmtsCapabilities', () => {
|
|
|
263
277
|
o((_a = layer.find('ows:Title')) === null || _a === void 0 ? void 0 : _a.textContent).equals('Aerial Imagery');
|
|
264
278
|
o((_b = layer.find('ows:Keywords')) === null || _b === void 0 ? void 0 : _b.toString()).equals('<ows:Keywords>\n <ows:Keyword>Basemap</ows:Keyword>\n</ows:Keywords>');
|
|
265
279
|
o((_c = layer.find('ows:Identifier')) === null || _c === void 0 ? void 0 : _c.textContent).equals('aerial');
|
|
266
|
-
const
|
|
267
|
-
o(
|
|
268
|
-
o(
|
|
269
|
-
o(
|
|
280
|
+
const adds = tags(layer, 'TileMatrixSet');
|
|
281
|
+
o(adds.length).equals(2);
|
|
282
|
+
o(adds[0].toString()).equals('<TileMatrixSet>WebMercatorQuad</TileMatrixSet>');
|
|
283
|
+
o(adds[1].toString()).equals('<TileMatrixSet>NZTM2000Quad</TileMatrixSet>');
|
|
270
284
|
const boundingBoxes = tags(layer, 'ows:BoundingBox');
|
|
271
285
|
o(boundingBoxes.length).equals(2);
|
|
272
286
|
o(boundingBoxes[0].attrs.crs).equals('urn:ogc:def:crs:EPSG::3857');
|
|
@@ -285,33 +299,39 @@ o.spec('WmtsCapabilities', () => {
|
|
|
285
299
|
});
|
|
286
300
|
o('should only output imagery if exists', () => {
|
|
287
301
|
const imagery = new Map();
|
|
288
|
-
const
|
|
302
|
+
const wmtsA = new WmtsCapabilities({
|
|
289
303
|
httpBase: 'https://basemaps.test',
|
|
304
|
+
});
|
|
305
|
+
wmtsA.fromParams({
|
|
290
306
|
provider: Provider,
|
|
291
307
|
tileMatrix: [Nztm2000QuadTms],
|
|
292
308
|
tileSet: TileSetAerial,
|
|
293
309
|
imagery: imagery,
|
|
294
310
|
formats: [ImageFormat.Png],
|
|
295
|
-
|
|
296
|
-
})
|
|
297
|
-
const
|
|
311
|
+
layers: TileSetAerial.layers,
|
|
312
|
+
});
|
|
313
|
+
const rawA = wmtsA.toVNode();
|
|
314
|
+
const layers = tags(rawA, 'Layer');
|
|
298
315
|
o(layers.length).equals(1);
|
|
299
316
|
imagery.set(Imagery3857.id, Imagery3857);
|
|
300
|
-
const
|
|
317
|
+
const wmtsB = new WmtsCapabilities({
|
|
301
318
|
httpBase: 'https://basemaps.test',
|
|
319
|
+
});
|
|
320
|
+
wmtsB.fromParams({
|
|
302
321
|
provider: Provider,
|
|
303
322
|
tileMatrix: [Nztm2000QuadTms],
|
|
304
323
|
tileSet: TileSetAerial,
|
|
305
324
|
imagery: imagery,
|
|
306
325
|
formats: [ImageFormat.Png],
|
|
307
|
-
|
|
308
|
-
})
|
|
326
|
+
layers: TileSetAerial.layers,
|
|
327
|
+
});
|
|
328
|
+
const rawB = wmtsB.toVNode();
|
|
309
329
|
const layersB = tags(rawB, 'Layer');
|
|
310
330
|
o(layersB.length).equals(1);
|
|
311
331
|
});
|
|
312
332
|
o('should cover the entire WebMercatorBounds', () => {
|
|
313
333
|
const halfSize = GoogleTms.extent.width / 2;
|
|
314
|
-
// Create two fake imagery
|
|
334
|
+
// Create two fake imagery adds one covers tile z1 x0 y0 another covers tile z1 x1 y1
|
|
315
335
|
// so the entire bounding box should be tile z0 x0 y0 or the full extent
|
|
316
336
|
const imagery = new Map();
|
|
317
337
|
const imageTopLeft = { ...Imagery3857, id: 'im_top_left', name: 'top_left' };
|
|
@@ -322,18 +342,21 @@ o.spec('WmtsCapabilities', () => {
|
|
|
322
342
|
imagery.set(imageBottomRight.id, imageBottomRight);
|
|
323
343
|
const tileSet = { ...TileSetAerial };
|
|
324
344
|
tileSet.layers = [
|
|
325
|
-
{ 3857: imageTopLeft.id, name: 'a_top_left' },
|
|
326
|
-
{ 3857: imageBottomRight.id, name: 'b_bottom_right' },
|
|
345
|
+
{ 3857: imageTopLeft.id, name: 'a_top_left', title: 'A Top Left' },
|
|
346
|
+
{ 3857: imageBottomRight.id, name: 'b_bottom_right', title: 'B Bottom Right' },
|
|
327
347
|
];
|
|
328
|
-
const
|
|
348
|
+
const wmts = new WmtsCapabilities({
|
|
329
349
|
httpBase: 'https://basemaps.test',
|
|
350
|
+
});
|
|
351
|
+
wmts.fromParams({
|
|
330
352
|
provider: Provider,
|
|
331
353
|
tileMatrix: [GoogleTms],
|
|
332
354
|
tileSet,
|
|
333
355
|
imagery,
|
|
334
356
|
formats: [ImageFormat.Png],
|
|
335
|
-
|
|
336
|
-
})
|
|
357
|
+
layers: tileSet.layers,
|
|
358
|
+
});
|
|
359
|
+
const raw = wmts.toVNode();
|
|
337
360
|
const boundingBox = tags(raw, 'ows:WGS84BoundingBox').map((c) => c
|
|
338
361
|
.toString()
|
|
339
362
|
.split('\n')
|
|
@@ -354,16 +377,19 @@ o.spec('WmtsCapabilities', () => {
|
|
|
354
377
|
imageBottomRight.bounds = { x: halfSize / 2, y: -halfSize, width: halfSize, height: halfSize };
|
|
355
378
|
imagery.set(imageBottomRight.id, imageBottomRight);
|
|
356
379
|
const tileSet = { ...TileSetAerial };
|
|
357
|
-
tileSet.layers = [{ 3857: imageBottomRight.id, name: 'b_bottom_right' }];
|
|
358
|
-
const
|
|
380
|
+
tileSet.layers = [{ 3857: imageBottomRight.id, name: 'b_bottom_right', title: 'B Bottom Right' }];
|
|
381
|
+
const wmts = new WmtsCapabilities({
|
|
359
382
|
httpBase: 'https://basemaps.test',
|
|
383
|
+
});
|
|
384
|
+
wmts.fromParams({
|
|
360
385
|
provider: Provider,
|
|
361
386
|
tileMatrix: [GoogleTms],
|
|
362
387
|
tileSet,
|
|
363
388
|
imagery,
|
|
364
389
|
formats: [ImageFormat.Png],
|
|
365
|
-
|
|
366
|
-
})
|
|
390
|
+
layers: tileSet.layers,
|
|
391
|
+
});
|
|
392
|
+
const raw = wmts.toVNode();
|
|
367
393
|
const boundingBox = tags(raw, 'ows:WGS84BoundingBox').map((c) => roundNumbersInString(c.toString(), 4)
|
|
368
394
|
.split('\n')
|
|
369
395
|
.map((c) => c.trim()));
|