@basemaps/lambda-tiler 6.28.1 → 6.31.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.
Files changed (570) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/build/__tests__/config.data.d.ts +6 -0
  3. package/build/__tests__/config.data.d.ts.map +1 -0
  4. package/build/__tests__/config.data.js +81 -0
  5. package/build/__tests__/config.data.js.map +1 -0
  6. package/build/__tests__/index.test.js +4 -3
  7. package/build/__tests__/index.test.js.map +1 -0
  8. package/build/__tests__/route.test.js +1 -0
  9. package/build/__tests__/route.test.js.map +1 -0
  10. package/build/__tests__/tiff.cache.test.js +1 -0
  11. package/build/__tests__/tiff.cache.test.js.map +1 -0
  12. package/build/__tests__/tile.cache.key.test.js +1 -0
  13. package/build/__tests__/tile.cache.key.test.js.map +1 -0
  14. package/build/__tests__/tile.set.cache.test.js +2 -53
  15. package/build/__tests__/tile.set.cache.test.js.map +1 -0
  16. package/build/__tests__/tile.set.test.js +1 -0
  17. package/build/__tests__/tile.set.test.js.map +1 -0
  18. package/build/__tests__/tile.style.json.test.js +1 -0
  19. package/build/__tests__/tile.style.json.test.js.map +1 -0
  20. package/build/__tests__/wmts.capability.test.d.ts +1 -1
  21. package/build/__tests__/wmts.capability.test.d.ts.map +1 -1
  22. package/build/__tests__/wmts.capability.test.js +286 -125
  23. package/build/__tests__/wmts.capability.test.js.map +1 -0
  24. package/build/__tests__/xyz.test.js +6 -37
  25. package/build/__tests__/xyz.test.js.map +1 -0
  26. package/build/__tests__/xyz.util.d.ts +0 -2
  27. package/build/__tests__/xyz.util.d.ts.map +1 -1
  28. package/build/__tests__/xyz.util.js +7 -30
  29. package/build/__tests__/xyz.util.js.map +1 -0
  30. package/build/api.key.js +1 -0
  31. package/build/api.key.js.map +1 -0
  32. package/build/cli/dump.js +1 -0
  33. package/build/cli/dump.js.map +1 -0
  34. package/build/cli/tile.set.local.js +1 -0
  35. package/build/cli/tile.set.local.js.map +1 -0
  36. package/build/cotar.cache.d.ts +25 -0
  37. package/build/cotar.cache.d.ts.map +1 -0
  38. package/build/cotar.cache.js +50 -0
  39. package/build/cotar.cache.js.map +1 -0
  40. package/build/index.d.ts.map +1 -1
  41. package/build/index.js +34 -33
  42. package/build/index.js.map +1 -0
  43. package/build/router.js +1 -0
  44. package/build/router.js.map +1 -0
  45. package/build/routes/__tests__/attribution.test.js +9 -8
  46. package/build/routes/__tests__/attribution.test.js.map +1 -0
  47. package/build/routes/__tests__/fonts.test.d.ts +2 -0
  48. package/build/routes/__tests__/fonts.test.d.ts.map +1 -0
  49. package/build/routes/__tests__/fonts.test.js +68 -0
  50. package/build/routes/__tests__/fonts.test.js.map +1 -0
  51. package/build/routes/__tests__/health.test.js +1 -0
  52. package/build/routes/__tests__/health.test.js.map +1 -0
  53. package/build/routes/__tests__/imagery.test.js +1 -0
  54. package/build/routes/__tests__/imagery.test.js.map +1 -0
  55. package/build/routes/__tests__/memory.fs.d.ts +18 -0
  56. package/build/routes/__tests__/memory.fs.d.ts.map +1 -0
  57. package/build/routes/__tests__/memory.fs.js +74 -0
  58. package/build/routes/__tests__/memory.fs.js.map +1 -0
  59. package/build/routes/__tests__/sprites.test.d.ts +2 -0
  60. package/build/routes/__tests__/sprites.test.d.ts.map +1 -0
  61. package/build/routes/__tests__/sprites.test.js +56 -0
  62. package/build/routes/__tests__/sprites.test.js.map +1 -0
  63. package/build/routes/__tests__/wmts.test.js +59 -10
  64. package/build/routes/__tests__/wmts.test.js.map +1 -0
  65. package/build/routes/api.d.ts +0 -1
  66. package/build/routes/api.d.ts.map +1 -1
  67. package/build/routes/api.js +1 -3
  68. package/build/routes/api.js.map +1 -0
  69. package/build/routes/attribution.d.ts +2 -2
  70. package/build/routes/attribution.d.ts.map +1 -1
  71. package/build/routes/attribution.js +16 -19
  72. package/build/routes/attribution.js.map +1 -0
  73. package/build/routes/esri/rest.js +1 -0
  74. package/build/routes/esri/rest.js.map +1 -0
  75. package/build/routes/fonts.d.ts +13 -0
  76. package/build/routes/fonts.d.ts.map +1 -0
  77. package/build/routes/fonts.js +58 -0
  78. package/build/routes/fonts.js.map +1 -0
  79. package/build/routes/health.js +1 -0
  80. package/build/routes/health.js.map +1 -0
  81. package/build/routes/imagery.d.ts +8 -1
  82. package/build/routes/imagery.d.ts.map +1 -1
  83. package/build/routes/imagery.js +6 -7
  84. package/build/routes/imagery.js.map +1 -0
  85. package/build/routes/response.js +1 -0
  86. package/build/routes/response.js.map +1 -0
  87. package/build/routes/sprites.d.ts +9 -0
  88. package/build/routes/sprites.d.ts.map +1 -0
  89. package/build/routes/sprites.js +36 -0
  90. package/build/routes/sprites.js.map +1 -0
  91. package/build/routes/tile.etag.js +1 -0
  92. package/build/routes/tile.etag.js.map +1 -0
  93. package/build/routes/tile.js +1 -0
  94. package/build/routes/tile.js.map +1 -0
  95. package/build/routes/tile.json.d.ts.map +1 -1
  96. package/build/routes/tile.json.js +2 -2
  97. package/build/routes/tile.json.js.map +1 -0
  98. package/build/routes/tile.style.json.js +1 -0
  99. package/build/routes/tile.style.json.js.map +1 -0
  100. package/build/routes/tile.wmts.d.ts.map +1 -1
  101. package/build/routes/tile.wmts.js +19 -23
  102. package/build/routes/tile.wmts.js.map +1 -0
  103. package/build/routes/tile.xyz.js +1 -0
  104. package/build/routes/tile.xyz.js.map +1 -0
  105. package/build/source.tracer.js +1 -0
  106. package/build/source.tracer.js.map +1 -0
  107. package/build/tiff.cache.js +1 -0
  108. package/build/tiff.cache.js.map +1 -0
  109. package/build/tile.set.cache.d.ts +0 -1
  110. package/build/tile.set.cache.d.ts.map +1 -1
  111. package/build/tile.set.cache.js +1 -29
  112. package/build/tile.set.cache.js.map +1 -0
  113. package/build/tile.set.js +1 -0
  114. package/build/tile.set.js.map +1 -0
  115. package/build/tile.set.raster.d.ts.map +1 -1
  116. package/build/tile.set.raster.js +6 -3
  117. package/build/tile.set.raster.js.map +1 -0
  118. package/build/tile.set.vector.d.ts +0 -7
  119. package/build/tile.set.vector.d.ts.map +1 -1
  120. package/build/tile.set.vector.js +3 -20
  121. package/build/tile.set.vector.js.map +1 -0
  122. package/build/validate.js +1 -0
  123. package/build/validate.js.map +1 -0
  124. package/build/wmts.capability.d.ts +26 -12
  125. package/build/wmts.capability.d.ts.map +1 -1
  126. package/build/wmts.capability.js +156 -55
  127. package/build/wmts.capability.js.map +1 -0
  128. package/dist/index.js +197 -0
  129. package/dist/node_modules/.package-lock.json +488 -0
  130. package/dist/node_modules/base64-js/LICENSE +21 -0
  131. package/dist/node_modules/base64-js/README.md +34 -0
  132. package/dist/node_modules/base64-js/base64js.min.js +1 -0
  133. package/dist/node_modules/base64-js/index.d.ts +3 -0
  134. package/dist/node_modules/base64-js/index.js +150 -0
  135. package/dist/node_modules/base64-js/package.json +47 -0
  136. package/dist/node_modules/bl/.travis.yml +17 -0
  137. package/dist/node_modules/bl/BufferList.js +396 -0
  138. package/dist/node_modules/bl/LICENSE.md +13 -0
  139. package/dist/node_modules/bl/README.md +247 -0
  140. package/dist/node_modules/bl/bl.js +84 -0
  141. package/dist/node_modules/bl/package.json +37 -0
  142. package/dist/node_modules/bl/test/convert.js +21 -0
  143. package/dist/node_modules/bl/test/indexOf.js +492 -0
  144. package/dist/node_modules/bl/test/isBufferList.js +32 -0
  145. package/dist/node_modules/bl/test/test.js +869 -0
  146. package/dist/node_modules/buffer/AUTHORS.md +70 -0
  147. package/dist/node_modules/buffer/LICENSE +21 -0
  148. package/dist/node_modules/buffer/README.md +410 -0
  149. package/dist/node_modules/buffer/index.d.ts +186 -0
  150. package/dist/node_modules/buffer/index.js +1817 -0
  151. package/dist/node_modules/buffer/package.json +96 -0
  152. package/dist/node_modules/chownr/LICENSE +15 -0
  153. package/dist/node_modules/chownr/README.md +3 -0
  154. package/dist/node_modules/chownr/chownr.js +167 -0
  155. package/dist/node_modules/chownr/package.json +29 -0
  156. package/dist/node_modules/color/LICENSE +21 -0
  157. package/dist/node_modules/color/README.md +123 -0
  158. package/dist/node_modules/color/index.js +496 -0
  159. package/dist/node_modules/color/package.json +47 -0
  160. package/dist/node_modules/color-convert/CHANGELOG.md +54 -0
  161. package/dist/node_modules/color-convert/LICENSE +21 -0
  162. package/dist/node_modules/color-convert/README.md +68 -0
  163. package/dist/node_modules/color-convert/conversions.js +839 -0
  164. package/dist/node_modules/color-convert/index.js +81 -0
  165. package/dist/node_modules/color-convert/package.json +48 -0
  166. package/dist/node_modules/color-convert/route.js +97 -0
  167. package/dist/node_modules/color-name/LICENSE +8 -0
  168. package/dist/node_modules/color-name/README.md +11 -0
  169. package/dist/node_modules/color-name/index.js +152 -0
  170. package/dist/node_modules/color-name/package.json +28 -0
  171. package/dist/node_modules/color-string/LICENSE +21 -0
  172. package/dist/node_modules/color-string/README.md +62 -0
  173. package/dist/node_modules/color-string/index.js +242 -0
  174. package/dist/node_modules/color-string/package.json +39 -0
  175. package/dist/node_modules/decompress-response/index.d.ts +22 -0
  176. package/dist/node_modules/decompress-response/index.js +58 -0
  177. package/dist/node_modules/decompress-response/license +9 -0
  178. package/dist/node_modules/decompress-response/package.json +56 -0
  179. package/dist/node_modules/decompress-response/readme.md +48 -0
  180. package/dist/node_modules/deep-extend/CHANGELOG.md +46 -0
  181. package/dist/node_modules/deep-extend/LICENSE +20 -0
  182. package/dist/node_modules/deep-extend/README.md +91 -0
  183. package/dist/node_modules/deep-extend/index.js +1 -0
  184. package/dist/node_modules/deep-extend/lib/deep-extend.js +150 -0
  185. package/dist/node_modules/deep-extend/package.json +62 -0
  186. package/dist/node_modules/detect-libc/LICENSE +201 -0
  187. package/dist/node_modules/detect-libc/README.md +160 -0
  188. package/dist/node_modules/detect-libc/index.d.ts +11 -0
  189. package/dist/node_modules/detect-libc/lib/detect-libc.js +178 -0
  190. package/dist/node_modules/detect-libc/lib/process.js +16 -0
  191. package/dist/node_modules/detect-libc/package.json +36 -0
  192. package/dist/node_modules/end-of-stream/LICENSE +21 -0
  193. package/dist/node_modules/end-of-stream/README.md +54 -0
  194. package/dist/node_modules/end-of-stream/index.js +94 -0
  195. package/dist/node_modules/end-of-stream/package.json +37 -0
  196. package/dist/node_modules/expand-template/.travis.yml +6 -0
  197. package/dist/node_modules/expand-template/LICENSE +21 -0
  198. package/dist/node_modules/expand-template/README.md +43 -0
  199. package/dist/node_modules/expand-template/index.js +26 -0
  200. package/dist/node_modules/expand-template/package.json +29 -0
  201. package/dist/node_modules/expand-template/test.js +67 -0
  202. package/dist/node_modules/fs-constants/LICENSE +21 -0
  203. package/dist/node_modules/fs-constants/README.md +26 -0
  204. package/dist/node_modules/fs-constants/browser.js +1 -0
  205. package/dist/node_modules/fs-constants/index.js +1 -0
  206. package/dist/node_modules/fs-constants/package.json +19 -0
  207. package/dist/node_modules/github-from-package/.travis.yml +4 -0
  208. package/dist/node_modules/github-from-package/LICENSE +18 -0
  209. package/dist/node_modules/github-from-package/example/package.json +8 -0
  210. package/dist/node_modules/github-from-package/example/url.js +3 -0
  211. package/dist/node_modules/github-from-package/index.js +17 -0
  212. package/dist/node_modules/github-from-package/package.json +30 -0
  213. package/dist/node_modules/github-from-package/readme.markdown +53 -0
  214. package/dist/node_modules/github-from-package/test/a.json +8 -0
  215. package/dist/node_modules/github-from-package/test/b.json +5 -0
  216. package/dist/node_modules/github-from-package/test/c.json +5 -0
  217. package/dist/node_modules/github-from-package/test/d.json +7 -0
  218. package/dist/node_modules/github-from-package/test/e.json +5 -0
  219. package/dist/node_modules/github-from-package/test/url.js +19 -0
  220. package/dist/node_modules/ieee754/LICENSE +11 -0
  221. package/dist/node_modules/ieee754/README.md +51 -0
  222. package/dist/node_modules/ieee754/index.d.ts +10 -0
  223. package/dist/node_modules/ieee754/index.js +85 -0
  224. package/dist/node_modules/ieee754/package.json +52 -0
  225. package/dist/node_modules/inherits/LICENSE +16 -0
  226. package/dist/node_modules/inherits/README.md +42 -0
  227. package/dist/node_modules/inherits/inherits.js +9 -0
  228. package/dist/node_modules/inherits/inherits_browser.js +27 -0
  229. package/dist/node_modules/inherits/package.json +29 -0
  230. package/dist/node_modules/ini/LICENSE +15 -0
  231. package/dist/node_modules/ini/README.md +102 -0
  232. package/dist/node_modules/ini/ini.js +206 -0
  233. package/dist/node_modules/ini/package.json +33 -0
  234. package/dist/node_modules/is-arrayish/LICENSE +21 -0
  235. package/dist/node_modules/is-arrayish/README.md +16 -0
  236. package/dist/node_modules/is-arrayish/index.js +9 -0
  237. package/dist/node_modules/is-arrayish/package.json +45 -0
  238. package/dist/node_modules/is-arrayish/yarn-error.log +1443 -0
  239. package/dist/node_modules/lru-cache/LICENSE +15 -0
  240. package/dist/node_modules/lru-cache/README.md +166 -0
  241. package/dist/node_modules/lru-cache/index.js +334 -0
  242. package/dist/node_modules/lru-cache/package.json +34 -0
  243. package/dist/node_modules/mimic-response/index.d.ts +17 -0
  244. package/dist/node_modules/mimic-response/index.js +77 -0
  245. package/dist/node_modules/mimic-response/license +9 -0
  246. package/dist/node_modules/mimic-response/package.json +42 -0
  247. package/dist/node_modules/mimic-response/readme.md +78 -0
  248. package/dist/node_modules/minimist/.travis.yml +8 -0
  249. package/dist/node_modules/minimist/LICENSE +18 -0
  250. package/dist/node_modules/minimist/example/parse.js +2 -0
  251. package/dist/node_modules/minimist/index.js +249 -0
  252. package/dist/node_modules/minimist/package.json +45 -0
  253. package/dist/node_modules/minimist/readme.markdown +98 -0
  254. package/dist/node_modules/minimist/test/all_bool.js +32 -0
  255. package/dist/node_modules/minimist/test/bool.js +178 -0
  256. package/dist/node_modules/minimist/test/dash.js +31 -0
  257. package/dist/node_modules/minimist/test/default_bool.js +35 -0
  258. package/dist/node_modules/minimist/test/dotted.js +22 -0
  259. package/dist/node_modules/minimist/test/kv_short.js +16 -0
  260. package/dist/node_modules/minimist/test/long.js +31 -0
  261. package/dist/node_modules/minimist/test/num.js +36 -0
  262. package/dist/node_modules/minimist/test/parse.js +197 -0
  263. package/dist/node_modules/minimist/test/parse_modified.js +9 -0
  264. package/dist/node_modules/minimist/test/proto.js +60 -0
  265. package/dist/node_modules/minimist/test/short.js +67 -0
  266. package/dist/node_modules/minimist/test/stop_early.js +15 -0
  267. package/dist/node_modules/minimist/test/unknown.js +102 -0
  268. package/dist/node_modules/minimist/test/whitespace.js +8 -0
  269. package/dist/node_modules/mkdirp-classic/LICENSE +21 -0
  270. package/dist/node_modules/mkdirp-classic/README.md +18 -0
  271. package/dist/node_modules/mkdirp-classic/index.js +98 -0
  272. package/dist/node_modules/mkdirp-classic/package.json +18 -0
  273. package/dist/node_modules/napi-build-utils/LICENSE +21 -0
  274. package/dist/node_modules/napi-build-utils/README.md +48 -0
  275. package/dist/node_modules/napi-build-utils/index.js +213 -0
  276. package/dist/node_modules/napi-build-utils/index.md +81 -0
  277. package/dist/node_modules/napi-build-utils/package.json +41 -0
  278. package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
  279. package/dist/node_modules/node-abi/.github/workflows/update-abi.yml +41 -0
  280. package/dist/node_modules/node-abi/.releaserc.json +9 -0
  281. package/dist/node_modules/node-abi/CODE_OF_CONDUCT.md +73 -0
  282. package/dist/node_modules/node-abi/CONTRIBUTING.md +62 -0
  283. package/dist/node_modules/node-abi/LICENSE +21 -0
  284. package/dist/node_modules/node-abi/README.md +50 -0
  285. package/dist/node_modules/node-abi/abi_registry.json +210 -0
  286. package/dist/node_modules/node-abi/index.js +179 -0
  287. package/dist/node_modules/node-abi/package.json +39 -0
  288. package/dist/node_modules/node-abi/scripts/update-abi-registry.js +119 -0
  289. package/dist/node_modules/node-abi/test/index.js +166 -0
  290. package/dist/node_modules/node-addon-api/LICENSE.md +13 -0
  291. package/dist/node_modules/node-addon-api/README.md +293 -0
  292. package/dist/node_modules/node-addon-api/common.gypi +21 -0
  293. package/dist/node_modules/node-addon-api/except.gypi +25 -0
  294. package/dist/node_modules/node-addon-api/index.js +11 -0
  295. package/dist/node_modules/node-addon-api/napi-inl.deprecated.h +192 -0
  296. package/dist/node_modules/node-addon-api/napi-inl.h +6259 -0
  297. package/dist/node_modules/node-addon-api/napi.h +3003 -0
  298. package/dist/node_modules/node-addon-api/node_api.gyp +9 -0
  299. package/dist/node_modules/node-addon-api/noexcept.gypi +26 -0
  300. package/dist/node_modules/node-addon-api/nothing.c +0 -0
  301. package/dist/node_modules/node-addon-api/package-support.json +21 -0
  302. package/dist/node_modules/node-addon-api/package.json +415 -0
  303. package/dist/node_modules/node-addon-api/tools/README.md +73 -0
  304. package/dist/node_modules/node-addon-api/tools/check-napi.js +100 -0
  305. package/dist/node_modules/node-addon-api/tools/clang-format.js +71 -0
  306. package/dist/node_modules/node-addon-api/tools/conversion.js +309 -0
  307. package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
  308. package/dist/node_modules/once/LICENSE +15 -0
  309. package/dist/node_modules/once/README.md +79 -0
  310. package/dist/node_modules/once/once.js +42 -0
  311. package/dist/node_modules/once/package.json +33 -0
  312. package/dist/node_modules/prebuild-install/CHANGELOG.md +116 -0
  313. package/dist/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
  314. package/dist/node_modules/prebuild-install/LICENSE +21 -0
  315. package/dist/node_modules/prebuild-install/README.md +163 -0
  316. package/dist/node_modules/prebuild-install/asset.js +44 -0
  317. package/dist/node_modules/prebuild-install/bin.js +78 -0
  318. package/dist/node_modules/prebuild-install/download.js +142 -0
  319. package/dist/node_modules/prebuild-install/error.js +14 -0
  320. package/dist/node_modules/prebuild-install/help.txt +16 -0
  321. package/dist/node_modules/prebuild-install/index.js +1 -0
  322. package/dist/node_modules/prebuild-install/log.js +33 -0
  323. package/dist/node_modules/prebuild-install/package.json +67 -0
  324. package/dist/node_modules/prebuild-install/proxy.js +35 -0
  325. package/dist/node_modules/prebuild-install/rc.js +64 -0
  326. package/dist/node_modules/prebuild-install/util.js +143 -0
  327. package/dist/node_modules/pump/.travis.yml +5 -0
  328. package/dist/node_modules/pump/LICENSE +21 -0
  329. package/dist/node_modules/pump/README.md +65 -0
  330. package/dist/node_modules/pump/index.js +82 -0
  331. package/dist/node_modules/pump/package.json +24 -0
  332. package/dist/node_modules/pump/test-browser.js +66 -0
  333. package/dist/node_modules/pump/test-node.js +53 -0
  334. package/dist/node_modules/rc/LICENSE.APACHE2 +15 -0
  335. package/dist/node_modules/rc/LICENSE.BSD +26 -0
  336. package/dist/node_modules/rc/LICENSE.MIT +24 -0
  337. package/dist/node_modules/rc/README.md +227 -0
  338. package/dist/node_modules/rc/browser.js +7 -0
  339. package/dist/node_modules/rc/cli.js +4 -0
  340. package/dist/node_modules/rc/index.js +53 -0
  341. package/dist/node_modules/rc/lib/utils.js +104 -0
  342. package/dist/node_modules/rc/package.json +29 -0
  343. package/dist/node_modules/rc/test/ini.js +16 -0
  344. package/dist/node_modules/rc/test/nested-env-vars.js +50 -0
  345. package/dist/node_modules/rc/test/test.js +59 -0
  346. package/dist/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  347. package/dist/node_modules/readable-stream/GOVERNANCE.md +136 -0
  348. package/dist/node_modules/readable-stream/LICENSE +47 -0
  349. package/dist/node_modules/readable-stream/README.md +106 -0
  350. package/dist/node_modules/readable-stream/errors-browser.js +127 -0
  351. package/dist/node_modules/readable-stream/errors.js +116 -0
  352. package/dist/node_modules/readable-stream/experimentalWarning.js +17 -0
  353. package/dist/node_modules/readable-stream/lib/_stream_duplex.js +139 -0
  354. package/dist/node_modules/readable-stream/lib/_stream_passthrough.js +39 -0
  355. package/dist/node_modules/readable-stream/lib/_stream_readable.js +1124 -0
  356. package/dist/node_modules/readable-stream/lib/_stream_transform.js +201 -0
  357. package/dist/node_modules/readable-stream/lib/_stream_writable.js +697 -0
  358. package/dist/node_modules/readable-stream/lib/internal/streams/async_iterator.js +207 -0
  359. package/dist/node_modules/readable-stream/lib/internal/streams/buffer_list.js +210 -0
  360. package/dist/node_modules/readable-stream/lib/internal/streams/destroy.js +105 -0
  361. package/dist/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +104 -0
  362. package/dist/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  363. package/dist/node_modules/readable-stream/lib/internal/streams/from.js +64 -0
  364. package/dist/node_modules/readable-stream/lib/internal/streams/pipeline.js +97 -0
  365. package/dist/node_modules/readable-stream/lib/internal/streams/state.js +27 -0
  366. package/dist/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  367. package/dist/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  368. package/dist/node_modules/readable-stream/package.json +68 -0
  369. package/dist/node_modules/readable-stream/readable-browser.js +9 -0
  370. package/dist/node_modules/readable-stream/readable.js +16 -0
  371. package/dist/node_modules/safe-buffer/LICENSE +21 -0
  372. package/dist/node_modules/safe-buffer/README.md +584 -0
  373. package/dist/node_modules/safe-buffer/index.d.ts +187 -0
  374. package/dist/node_modules/safe-buffer/index.js +65 -0
  375. package/dist/node_modules/safe-buffer/package.json +51 -0
  376. package/dist/node_modules/semver/LICENSE +15 -0
  377. package/dist/node_modules/semver/README.md +568 -0
  378. package/dist/node_modules/semver/bin/semver.js +183 -0
  379. package/dist/node_modules/semver/classes/comparator.js +136 -0
  380. package/dist/node_modules/semver/classes/index.js +5 -0
  381. package/dist/node_modules/semver/classes/range.js +519 -0
  382. package/dist/node_modules/semver/classes/semver.js +287 -0
  383. package/dist/node_modules/semver/functions/clean.js +6 -0
  384. package/dist/node_modules/semver/functions/cmp.js +52 -0
  385. package/dist/node_modules/semver/functions/coerce.js +52 -0
  386. package/dist/node_modules/semver/functions/compare-build.js +7 -0
  387. package/dist/node_modules/semver/functions/compare-loose.js +3 -0
  388. package/dist/node_modules/semver/functions/compare.js +5 -0
  389. package/dist/node_modules/semver/functions/diff.js +23 -0
  390. package/dist/node_modules/semver/functions/eq.js +3 -0
  391. package/dist/node_modules/semver/functions/gt.js +3 -0
  392. package/dist/node_modules/semver/functions/gte.js +3 -0
  393. package/dist/node_modules/semver/functions/inc.js +18 -0
  394. package/dist/node_modules/semver/functions/lt.js +3 -0
  395. package/dist/node_modules/semver/functions/lte.js +3 -0
  396. package/dist/node_modules/semver/functions/major.js +3 -0
  397. package/dist/node_modules/semver/functions/minor.js +3 -0
  398. package/dist/node_modules/semver/functions/neq.js +3 -0
  399. package/dist/node_modules/semver/functions/parse.js +33 -0
  400. package/dist/node_modules/semver/functions/patch.js +3 -0
  401. package/dist/node_modules/semver/functions/prerelease.js +6 -0
  402. package/dist/node_modules/semver/functions/rcompare.js +3 -0
  403. package/dist/node_modules/semver/functions/rsort.js +3 -0
  404. package/dist/node_modules/semver/functions/satisfies.js +10 -0
  405. package/dist/node_modules/semver/functions/sort.js +3 -0
  406. package/dist/node_modules/semver/functions/valid.js +6 -0
  407. package/dist/node_modules/semver/index.js +48 -0
  408. package/dist/node_modules/semver/internal/constants.js +17 -0
  409. package/dist/node_modules/semver/internal/debug.js +9 -0
  410. package/dist/node_modules/semver/internal/identifiers.js +23 -0
  411. package/dist/node_modules/semver/internal/parse-options.js +11 -0
  412. package/dist/node_modules/semver/internal/re.js +182 -0
  413. package/dist/node_modules/semver/package.json +75 -0
  414. package/dist/node_modules/semver/preload.js +2 -0
  415. package/dist/node_modules/semver/range.bnf +16 -0
  416. package/dist/node_modules/semver/ranges/gtr.js +4 -0
  417. package/dist/node_modules/semver/ranges/intersects.js +7 -0
  418. package/dist/node_modules/semver/ranges/ltr.js +4 -0
  419. package/dist/node_modules/semver/ranges/max-satisfying.js +25 -0
  420. package/dist/node_modules/semver/ranges/min-satisfying.js +24 -0
  421. package/dist/node_modules/semver/ranges/min-version.js +61 -0
  422. package/dist/node_modules/semver/ranges/outside.js +80 -0
  423. package/dist/node_modules/semver/ranges/simplify.js +47 -0
  424. package/dist/node_modules/semver/ranges/subset.js +244 -0
  425. package/dist/node_modules/semver/ranges/to-comparators.js +8 -0
  426. package/dist/node_modules/semver/ranges/valid.js +11 -0
  427. package/dist/node_modules/sharp/LICENSE +191 -0
  428. package/dist/node_modules/sharp/README.md +117 -0
  429. package/dist/node_modules/sharp/binding.gyp +233 -0
  430. package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  431. package/dist/node_modules/sharp/install/can-compile.js +11 -0
  432. package/dist/node_modules/sharp/install/dll-copy.js +37 -0
  433. package/dist/node_modules/sharp/install/libvips.js +215 -0
  434. package/dist/node_modules/sharp/lib/agent.js +40 -0
  435. package/dist/node_modules/sharp/lib/channel.js +171 -0
  436. package/dist/node_modules/sharp/lib/colour.js +180 -0
  437. package/dist/node_modules/sharp/lib/composite.js +193 -0
  438. package/dist/node_modules/sharp/lib/constructor.js +386 -0
  439. package/dist/node_modules/sharp/lib/index.js +13 -0
  440. package/dist/node_modules/sharp/lib/input.js +507 -0
  441. package/dist/node_modules/sharp/lib/is.js +143 -0
  442. package/dist/node_modules/sharp/lib/libvips.js +136 -0
  443. package/dist/node_modules/sharp/lib/operation.js +803 -0
  444. package/dist/node_modules/sharp/lib/output.js +1231 -0
  445. package/dist/node_modules/sharp/lib/platform.js +27 -0
  446. package/dist/node_modules/sharp/lib/resize.js +473 -0
  447. package/dist/node_modules/sharp/lib/sharp.js +35 -0
  448. package/dist/node_modules/sharp/lib/utility.js +211 -0
  449. package/dist/node_modules/sharp/package.json +196 -0
  450. package/dist/node_modules/sharp/src/common.cc +966 -0
  451. package/dist/node_modules/sharp/src/common.h +352 -0
  452. package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +152 -0
  453. package/dist/node_modules/sharp/src/libvips/cplusplus/VError.cpp +50 -0
  454. package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +1523 -0
  455. package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +63 -0
  456. package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +3738 -0
  457. package/dist/node_modules/sharp/src/metadata.cc +291 -0
  458. package/dist/node_modules/sharp/src/metadata.h +92 -0
  459. package/dist/node_modules/sharp/src/operations.cc +412 -0
  460. package/dist/node_modules/sharp/src/operations.h +126 -0
  461. package/dist/node_modules/sharp/src/pipeline.cc +1624 -0
  462. package/dist/node_modules/sharp/src/pipeline.h +349 -0
  463. package/dist/node_modules/sharp/src/sharp.cc +52 -0
  464. package/dist/node_modules/sharp/src/stats.cc +193 -0
  465. package/dist/node_modules/sharp/src/stats.h +70 -0
  466. package/dist/node_modules/sharp/src/utilities.cc +243 -0
  467. package/dist/node_modules/sharp/src/utilities.h +29 -0
  468. package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/THIRD-PARTY-NOTICES.md +43 -0
  469. package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/lib/libvips-cpp.so.42 +0 -0
  470. package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/platform.json +1 -0
  471. package/dist/node_modules/sharp/vendor/8.12.2/linux-x64/versions.json +31 -0
  472. package/dist/node_modules/simple-concat/.travis.yml +3 -0
  473. package/dist/node_modules/simple-concat/LICENSE +20 -0
  474. package/dist/node_modules/simple-concat/README.md +44 -0
  475. package/dist/node_modules/simple-concat/index.js +15 -0
  476. package/dist/node_modules/simple-concat/package.json +47 -0
  477. package/dist/node_modules/simple-concat/test/basic.js +41 -0
  478. package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
  479. package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  480. package/dist/node_modules/simple-get/LICENSE +20 -0
  481. package/dist/node_modules/simple-get/README.md +333 -0
  482. package/dist/node_modules/simple-get/index.js +108 -0
  483. package/dist/node_modules/simple-get/package.json +67 -0
  484. package/dist/node_modules/simple-swizzle/LICENSE +21 -0
  485. package/dist/node_modules/simple-swizzle/README.md +39 -0
  486. package/dist/node_modules/simple-swizzle/index.js +29 -0
  487. package/dist/node_modules/simple-swizzle/package.json +36 -0
  488. package/dist/node_modules/string_decoder/LICENSE +48 -0
  489. package/dist/node_modules/string_decoder/README.md +47 -0
  490. package/dist/node_modules/string_decoder/lib/string_decoder.js +296 -0
  491. package/dist/node_modules/string_decoder/package.json +34 -0
  492. package/dist/node_modules/strip-json-comments/index.js +70 -0
  493. package/dist/node_modules/strip-json-comments/license +21 -0
  494. package/dist/node_modules/strip-json-comments/package.json +42 -0
  495. package/dist/node_modules/strip-json-comments/readme.md +64 -0
  496. package/dist/node_modules/tar-fs/.travis.yml +6 -0
  497. package/dist/node_modules/tar-fs/LICENSE +21 -0
  498. package/dist/node_modules/tar-fs/README.md +165 -0
  499. package/dist/node_modules/tar-fs/index.js +351 -0
  500. package/dist/node_modules/tar-fs/package.json +41 -0
  501. package/dist/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
  502. package/dist/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
  503. package/dist/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
  504. package/dist/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
  505. package/dist/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
  506. package/dist/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
  507. package/dist/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
  508. package/dist/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
  509. package/dist/node_modules/tar-fs/test/fixtures/e/file +0 -0
  510. package/dist/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
  511. package/dist/node_modules/tar-fs/test/index.js +346 -0
  512. package/dist/node_modules/tar-stream/LICENSE +21 -0
  513. package/dist/node_modules/tar-stream/README.md +168 -0
  514. package/dist/node_modules/tar-stream/extract.js +257 -0
  515. package/dist/node_modules/tar-stream/headers.js +295 -0
  516. package/dist/node_modules/tar-stream/index.js +2 -0
  517. package/dist/node_modules/tar-stream/pack.js +255 -0
  518. package/dist/node_modules/tar-stream/package.json +58 -0
  519. package/dist/node_modules/tar-stream/sandbox.js +11 -0
  520. package/dist/node_modules/tunnel-agent/LICENSE +55 -0
  521. package/dist/node_modules/tunnel-agent/README.md +4 -0
  522. package/dist/node_modules/tunnel-agent/index.js +244 -0
  523. package/dist/node_modules/tunnel-agent/package.json +22 -0
  524. package/dist/node_modules/util-deprecate/History.md +16 -0
  525. package/dist/node_modules/util-deprecate/LICENSE +24 -0
  526. package/dist/node_modules/util-deprecate/README.md +53 -0
  527. package/dist/node_modules/util-deprecate/browser.js +67 -0
  528. package/dist/node_modules/util-deprecate/node.js +6 -0
  529. package/dist/node_modules/util-deprecate/package.json +27 -0
  530. package/dist/node_modules/wrappy/LICENSE +15 -0
  531. package/dist/node_modules/wrappy/README.md +36 -0
  532. package/dist/node_modules/wrappy/package.json +29 -0
  533. package/dist/node_modules/wrappy/wrappy.js +33 -0
  534. package/dist/node_modules/yallist/LICENSE +15 -0
  535. package/dist/node_modules/yallist/README.md +204 -0
  536. package/dist/node_modules/yallist/iterator.js +8 -0
  537. package/dist/node_modules/yallist/package.json +29 -0
  538. package/dist/node_modules/yallist/yallist.js +426 -0
  539. package/dist/package-lock.json +830 -0
  540. package/dist/package.json +39 -0
  541. package/dist/static/expected_tile_2193_153_255_z7.png +0 -0
  542. package/dist/static/expected_tile_NZTM2000Quad_30_33_z6.png +0 -0
  543. package/dist/static/expected_tile_WebMercatorQuad_252_156_z8.png +0 -0
  544. package/package.json +13 -13
  545. package/scripts/create.deployment.package.mjs +1 -1
  546. package/src/__tests__/config.data.ts +82 -0
  547. package/src/__tests__/index.test.ts +3 -3
  548. package/src/__tests__/tile.set.cache.test.ts +1 -67
  549. package/src/__tests__/wmts.capability.test.ts +312 -139
  550. package/src/__tests__/xyz.test.ts +5 -49
  551. package/src/__tests__/xyz.util.ts +6 -32
  552. package/src/cotar.cache.ts +54 -0
  553. package/src/index.ts +36 -32
  554. package/src/routes/__tests__/attribution.test.ts +8 -9
  555. package/src/routes/__tests__/fonts.test.ts +80 -0
  556. package/src/routes/__tests__/memory.fs.ts +77 -0
  557. package/src/routes/__tests__/sprites.test.ts +64 -0
  558. package/src/routes/__tests__/wmts.test.ts +75 -15
  559. package/src/routes/api.ts +0 -4
  560. package/src/routes/attribution.ts +12 -18
  561. package/src/routes/fonts.ts +62 -0
  562. package/src/routes/imagery.ts +9 -7
  563. package/src/routes/sprites.ts +41 -0
  564. package/src/routes/tile.json.ts +1 -2
  565. package/src/routes/tile.wmts.ts +20 -22
  566. package/src/tile.set.cache.ts +1 -28
  567. package/src/tile.set.raster.ts +4 -2
  568. package/src/tile.set.vector.ts +3 -21
  569. package/src/wmts.capability.ts +169 -67
  570. package/tsconfig.tsbuildinfo +1 -1
@@ -1,12 +1,10 @@
1
- import { Bounds, Epsg, GoogleTms, ImageFormat, Nztm2000QuadTms, Nztm2000Tms } from '@basemaps/geo';
2
- import { TileSetName, V, VNodeElement } from '@basemaps/shared';
1
+ import { ConfigImagery } from '@basemaps/config';
2
+ import { GoogleTms, ImageFormat, Nztm2000QuadTms } from '@basemaps/geo';
3
+ import { V, VNodeElement } from '@basemaps/shared';
3
4
  import { roundNumbersInString } from '@basemaps/test/build/rounding.js';
4
- import { createHash } from 'crypto';
5
5
  import o from 'ospec';
6
6
  import { WmtsCapabilities } from '../wmts.capability.js';
7
- import { FakeTileSet, Provider } from './xyz.util.js';
8
-
9
- import 'source-map-support/register.js';
7
+ import { Imagery2193, Imagery3857, Provider, TileSetAerial } from './config.data.js';
10
8
 
11
9
  function tags(node: VNodeElement | null | undefined, tag: string): VNodeElement[] {
12
10
  if (node == null) return [];
@@ -18,16 +16,21 @@ function listTag(node: VNodeElement | null | undefined, tag: string): string[] {
18
16
 
19
17
  o.spec('WmtsCapabilities', () => {
20
18
  const apiKey = 'secret1234';
21
- const tileSet = new FakeTileSet(TileSetName.aerial, GoogleTms);
22
- const tileSetImagery = new FakeTileSet('01E7PJFR9AMQFJ05X9G7FQ3XMW', GoogleTms);
19
+
20
+ const allImagery = new Map();
21
+ allImagery.set(Imagery2193.id, Imagery2193);
22
+ allImagery.set(Imagery3857.id, Imagery3857);
23
23
 
24
24
  o('should output the requested formats', () => {
25
25
  const wmts = new WmtsCapabilities({
26
26
  httpBase: 'https://basemaps.test',
27
27
  provider: Provider,
28
- layers: [tileSet],
28
+ tileMatrix: [GoogleTms],
29
+ tileSet: TileSetAerial,
30
+ imagery: allImagery,
29
31
  apiKey,
30
32
  formats: [ImageFormat.Avif],
33
+ isIndividualLayers: false,
31
34
  }).toVNode();
32
35
 
33
36
  const urls = tags(wmts, 'ResourceURL');
@@ -38,12 +41,106 @@ o.spec('WmtsCapabilities', () => {
38
41
  );
39
42
  });
40
43
 
44
+ o('should be seting encoding to utf-8', () => {
45
+ const xml = new WmtsCapabilities({
46
+ httpBase: 'https://basemaps.test',
47
+ provider: Provider,
48
+ tileMatrix: [GoogleTms],
49
+ tileSet: TileSetAerial,
50
+ imagery: allImagery,
51
+ apiKey,
52
+ formats: [ImageFormat.Avif],
53
+ isIndividualLayers: false,
54
+ }).toXml();
55
+
56
+ o(xml.split('\n')[0]).deepEquals('<?xml version="1.0" encoding="utf-8"?>');
57
+ });
58
+
59
+ o('should support unicorns and rainbows', () => {
60
+ const tileSet = { ...TileSetAerial };
61
+ tileSet.name = '🦄_🌈_2022_0-5m';
62
+ tileSet.title = '🦄 🌈 Imagery (2022)';
63
+ tileSet.description = '🦄 🌈 Description';
64
+ const wmts = new WmtsCapabilities({
65
+ httpBase: 'https://basemaps.test',
66
+ provider: Provider,
67
+ tileMatrix: [GoogleTms],
68
+ tileSet,
69
+ imagery: allImagery,
70
+ apiKey,
71
+ formats: [ImageFormat.Avif],
72
+ isIndividualLayers: false,
73
+ }).toVNode();
74
+
75
+ const urls = tags(wmts, 'ResourceURL');
76
+ o(urls.length).equals(1);
77
+ o(urls[0].attrs.template).equals(
78
+ 'https://basemaps.test/v1/tiles/🦄-🌈-2022-0.5m/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.avif?api=secret1234',
79
+ );
80
+
81
+ const layer = tags(wmts, 'Layer')[0];
82
+
83
+ const title = layer.find('ows:Title')?.toString();
84
+ o(title).equals('<ows:Title>🦄 🌈 Imagery (2022)</ows:Title>');
85
+
86
+ const abstract = layer.find('ows:Abstract')?.toString();
87
+ o(abstract).equals('<ows:Abstract>🦄 🌈 Description</ows:Abstract>');
88
+
89
+ const identifier = layer.find('ows:Identifier')?.toString();
90
+ o(identifier).equals('<ows:Identifier>🦄-🌈-2022-0.5m</ows:Identifier>');
91
+ });
92
+
93
+ o('should sort the sub imagery layers', () => {
94
+ const imageryA = { ...Imagery3857 };
95
+ imageryA.id = 'im_a';
96
+ imageryA.name = 'aaaa';
97
+ imageryA.title = 'aaaa';
98
+
99
+ const imageryB = { ...Imagery3857 };
100
+ imageryB.id = 'im_b';
101
+ imageryB.name = 'bbbb';
102
+ imageryB.title = 'bbbb';
103
+
104
+ const imagery = new Map();
105
+ imagery.set(Imagery3857.id, Imagery3857);
106
+ imagery.set(imageryB.id, imageryB);
107
+ imagery.set(imageryA.id, imageryA);
108
+ const tileSet = {
109
+ ...TileSetAerial,
110
+ layers: [
111
+ ...TileSetAerial.layers,
112
+ { [3857]: imageryB.id, title: imageryB.title, name: imageryB.name },
113
+ { [3857]: imageryA.id, title: imageryA.title, name: imageryA.name },
114
+ ],
115
+ };
116
+
117
+ const wmts = new WmtsCapabilities({
118
+ httpBase: 'https://basemaps.test',
119
+ provider: Provider,
120
+ tileMatrix: [GoogleTms],
121
+ tileSet,
122
+ imagery,
123
+ apiKey,
124
+ isIndividualLayers: true,
125
+ }).toVNode();
126
+
127
+ const layers = tags(wmts, 'Layer').map((c) => c.find('ows:Title')?.textContent);
128
+
129
+ // The base layer "Aerial Imagery" should always be first then all sub layers after
130
+ o(layers).deepEquals(['Aerial Imagery', 'aaaa', 'bbbb', 'Ōtorohanga 0.1m Urban Aerial Photos (2021)']);
131
+ });
132
+
41
133
  o('should build capability xml for tileset and projection', () => {
134
+ const imagery = new Map();
135
+ imagery.set(Imagery3857.id, Imagery3857);
42
136
  const wmts = new WmtsCapabilities({
43
137
  httpBase: 'https://basemaps.test',
44
138
  provider: Provider,
45
- layers: [tileSet],
139
+ tileMatrix: [GoogleTms],
140
+ tileSet: TileSetAerial,
141
+ imagery,
46
142
  apiKey,
143
+ isIndividualLayers: false,
47
144
  });
48
145
 
49
146
  const raw = wmts.toVNode();
@@ -53,10 +150,10 @@ o.spec('WmtsCapabilities', () => {
53
150
  o(serviceId?.find('ows:Title')?.textContent).equals('the title');
54
151
 
55
152
  o(raw.find('TileMatrixSetLink')?.toString()).deepEquals(
56
- V('TileMatrixSetLink', [V('TileMatrixSet', 'EPSG:3857')]).toString(),
153
+ V('TileMatrixSetLink', [V('TileMatrixSet', 'WebMercatorQuad')]).toString(),
57
154
  );
58
155
 
59
- const layer = raw?.find('Contents', 'Layer');
156
+ const layer = raw.find('Contents', 'Layer');
60
157
 
61
158
  o(listTag(layer, 'Format')).deepEquals([
62
159
  V('Format', 'image/jpeg').toString(),
@@ -64,41 +161,47 @@ o.spec('WmtsCapabilities', () => {
64
161
  V('Format', 'image/png').toString(),
65
162
  ]);
66
163
 
67
- o(listTag(layer, 'ows:BoundingBox')).deepEquals([
68
- V('ows:BoundingBox', { crs: Epsg.Google.toUrn() }, [
69
- V('ows:LowerCorner', '-20037508.3427892 -20037508.3427892'),
70
- V('ows:UpperCorner', '20037508.3427892 20037508.3427892'),
71
- ]).toString(),
164
+ o(listTag(layer, 'ows:BoundingBox').map((s) => roundNumbersInString(s, 4))).deepEquals([
165
+ '<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">\n' +
166
+ ' <ows:LowerCorner>19457809.9203 -4609458.5537</ows:LowerCorner>\n' +
167
+ ' <ows:UpperCorner>19509787.0995 -4578883.7424</ows:UpperCorner>\n' +
168
+ '</ows:BoundingBox>',
72
169
  ]);
73
170
 
74
171
  o(listTag(layer, 'ows:WGS84BoundingBox').map((s) => roundNumbersInString(s, 4))).deepEquals([
75
172
  '<ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">\n' +
76
- ' <ows:LowerCorner>-180 -85.0511</ows:LowerCorner>\n' +
77
- ' <ows:UpperCorner>180 85.0511</ows:UpperCorner>\n' +
173
+ ' <ows:LowerCorner>174.7925 -38.2123</ows:LowerCorner>\n' +
174
+ ' <ows:UpperCorner>175.2594 -37.9962</ows:UpperCorner>\n' +
78
175
  '</ows:WGS84BoundingBox>',
79
176
  ]);
80
177
 
81
- o(layer?.find('ows:Abstract')?.textContent).equals('aerial:description');
82
- o(layer?.find('ows:Title')?.textContent).equals('aerial:title');
83
178
  o(layer?.find('ows:Identifier')?.textContent).equals('aerial');
179
+ o(layer?.find('ows:Title')?.textContent).equals('Aerial Imagery');
180
+ o(layer?.find('ows:Abstract')?.textContent).equals('aerial__description');
84
181
 
85
182
  o(layer?.find('Style')?.toString()).equals(
86
183
  V('Style', { isDefault: 'true' }, [V('ows:Title', 'Default Style'), V('ows:Identifier', 'default')]).toString(),
87
184
  );
185
+ });
88
186
 
89
- const urls = tags(layer, 'ResourceURL');
90
- o(urls.length).equals(3);
91
- o(urls[2].toString()).deepEquals(
92
- '<ResourceURL format="image/png" resourceType="tile" ' +
93
- 'template="https://basemaps.test/v1/tiles/aerial/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png?api=secret1234" />',
94
- );
187
+ o('should include output the correct TileMatrix', () => {
188
+ const raw = new WmtsCapabilities({
189
+ httpBase: 'https://basemaps.test',
190
+ provider: Provider,
191
+ tileMatrix: [GoogleTms],
192
+ tileSet: TileSetAerial,
193
+ imagery: allImagery,
194
+ apiKey,
195
+ isIndividualLayers: false,
196
+ }).toVNode();
197
+ const layer = raw.find('Contents', 'Layer');
95
198
 
96
- o(layer?.find('TileMatrixSetLink', 'TileMatrixSet')?.textContent).equals('EPSG:3857');
199
+ o(layer?.find('TileMatrixSetLink', 'TileMatrixSet')?.textContent).equals('WebMercatorQuad');
97
200
 
98
201
  const matrix = tags(raw, 'TileMatrixSet')[1];
99
202
  const matrixId = raw?.find('Contents', 'TileMatrixSet', 'ows:Identifier') ?? null;
100
203
  o(matrix.find('ows:Identifier')).equals(matrixId);
101
- o(matrixId?.textContent).equals('EPSG:3857');
204
+ o(matrixId?.textContent).equals('WebMercatorQuad');
102
205
 
103
206
  o(matrix.find('ows:SupportedCRS')?.textContent).deepEquals('urn:ogc:def:crs:EPSG::3857');
104
207
  o(matrix.find('WellKnownScaleSet')?.textContent).deepEquals(
@@ -123,46 +226,62 @@ o.spec('WmtsCapabilities', () => {
123
226
 
124
227
  compareMatrix(tileMatrices[0], '0', 1, 559082264.028717);
125
228
  compareMatrix(tileMatrices[10], '10', 1024, 545978.773465544);
126
-
127
- const xml = new WmtsCapabilities({
128
- httpBase: 'https://basemaps.test',
129
- provider: Provider,
130
- layers: [tileSet],
131
- apiKey,
132
- }).toXml();
133
-
134
- o(xml).deepEquals('<?xml version="1.0"?>\n' + raw?.toString());
135
-
136
- o(createHash('sha256').update(Buffer.from(xml)).digest('base64')).equals(
137
- 'beknYyMt8v74vK4p84AS3c1OnBSJ+ZE0kan+mMVQS1A=',
138
- );
139
229
  });
140
230
 
141
- o('should allow individual imagery sets', () => {
231
+ o('should output individual imagery sets', () => {
232
+ const imagery = new Map<string, ConfigImagery>();
233
+ imagery.set(Imagery3857.id, Imagery3857);
234
+ imagery.set(Imagery2193.id, Imagery2193);
142
235
  const raw = new WmtsCapabilities({
143
236
  httpBase: 'https://basemaps.test',
144
237
  provider: Provider,
145
- layers: [tileSetImagery],
238
+ tileMatrix: [GoogleTms],
239
+ tileSet: TileSetAerial,
240
+ imagery: imagery,
241
+ formats: [ImageFormat.Png],
242
+ isIndividualLayers: true,
146
243
  }).toVNode();
147
244
 
148
245
  const tms = raw?.find('TileMatrixSet', 'ows:Identifier');
149
246
 
150
- o(tms?.textContent).equals('EPSG:3857');
247
+ o(tms?.textContent).equals('WebMercatorQuad');
151
248
 
152
249
  const urls = Array.from(raw ? raw.tags('ResourceURL') : []);
153
- o(urls.length).equals(3);
154
- o(urls[2].toString()).deepEquals(
250
+ o(urls.length).equals(2);
251
+ o(urls[0].toString()).deepEquals(
252
+ '<ResourceURL format="image/png" resourceType="tile" ' +
253
+ 'template="https://basemaps.test/v1/tiles/aerial/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png" />',
254
+ );
255
+ o(urls[1].toString()).deepEquals(
155
256
  '<ResourceURL format="image/png" resourceType="tile" ' +
156
- 'template="https://basemaps.test/v1/tiles/01E7PJFR9AMQFJ05X9G7FQ3XMW/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png" />',
257
+ 'template="https://basemaps.test/v1/tiles/ōtorohanga-urban-2021-0.1m/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}.png" />',
157
258
  );
259
+
260
+ const layers = [...raw.tags('Layer')];
261
+
262
+ o(layers.length).equals(2);
263
+ o(layers[0].find('ows:Title')?.textContent).equals('Aerial Imagery');
264
+
265
+ o(layers[1].find('ows:Title')?.textContent).equals('Ōtorohanga 0.1m Urban Aerial Photos (2021)');
266
+ o(layers[1].find('ows:Identifier')?.textContent).equals('ōtorohanga-urban-2021-0.1m');
267
+ o(layers[1].find('ows:Keywords', 'ows:Keyword')?.textContent).equals('Urban Aerial Photos');
158
268
  });
159
269
 
160
270
  o('should support multiple projections', () => {
161
- const ts = [new FakeTileSet(TileSetName.aerial, Nztm2000Tms), new FakeTileSet(TileSetName.aerial, GoogleTms)];
162
- const xml = new WmtsCapabilities({ httpBase: 'basemaps.test', provider: Provider, layers: ts });
163
- const nodes = xml.toVNode();
271
+ const imagery = new Map<string, ConfigImagery>();
272
+ imagery.set(Imagery3857.id, Imagery3857);
273
+ imagery.set(Imagery2193.id, Imagery2193);
274
+ const raw = new WmtsCapabilities({
275
+ httpBase: 'https://basemaps.test',
276
+ provider: Provider,
277
+ tileMatrix: [GoogleTms, Nztm2000QuadTms],
278
+ tileSet: TileSetAerial,
279
+ imagery: imagery,
280
+ formats: [ImageFormat.Png],
281
+ isIndividualLayers: false,
282
+ }).toVNode();
164
283
 
165
- const layers = tags(nodes, 'Layer');
284
+ const layers = tags(raw, 'Layer');
166
285
  o(layers.length).equals(1);
167
286
  const layer = layers[0];
168
287
 
@@ -171,126 +290,180 @@ o.spec('WmtsCapabilities', () => {
171
290
  'ows:Title',
172
291
  'ows:Abstract',
173
292
  'ows:Identifier',
293
+ 'ows:Keywords',
174
294
  'ows:BoundingBox',
175
295
  'ows:BoundingBox',
176
296
  'ows:WGS84BoundingBox',
177
297
  'Style',
178
298
  'Format',
179
- 'Format',
180
- 'Format',
181
299
  'TileMatrixSetLink',
182
300
  'TileMatrixSetLink',
183
301
  'ResourceURL',
184
- 'ResourceURL',
185
- 'ResourceURL',
186
302
  ]);
187
303
 
304
+ o(layer.find('ows:Title')?.textContent).equals('Aerial Imagery');
305
+ o(layer.find('ows:Keywords')?.toString()).equals(
306
+ '<ows:Keywords>\n <ows:Keyword>Basemap</ows:Keyword>\n</ows:Keywords>',
307
+ );
308
+ o(layer.find('ows:Identifier')?.textContent).equals('aerial');
309
+
188
310
  const sets = tags(layer, 'TileMatrixSet');
189
311
 
190
312
  o(sets.length).equals(2);
191
- o(sets[0].toString()).equals('<TileMatrixSet>EPSG:2193</TileMatrixSet>');
192
- o(sets[1].toString()).equals('<TileMatrixSet>EPSG:3857</TileMatrixSet>');
193
-
194
- const tms = tags(nodes, 'TileMatrixSet').filter((f) => f.find('ows:SupportedCRS') != null);
195
- o(tms.length).equals(2);
196
-
197
- o(tms[0].find('ows:Identifier')?.textContent).equals('EPSG:2193');
198
- o(tms[0].find('ows:SupportedCRS')?.textContent).equals('urn:ogc:def:crs:EPSG::2193');
313
+ o(sets[0].toString()).equals('<TileMatrixSet>WebMercatorQuad</TileMatrixSet>');
314
+ o(sets[1].toString()).equals('<TileMatrixSet>NZTM2000Quad</TileMatrixSet>');
315
+
316
+ const boundingBoxes = tags(layer, 'ows:BoundingBox');
317
+ o(boundingBoxes.length).equals(2);
318
+ o(boundingBoxes[0].attrs.crs).equals('urn:ogc:def:crs:EPSG::3857');
319
+ o(boundingBoxes[0].children.map((c) => c.textContent)).deepEquals([
320
+ '19457809.9203 -4609458.5537',
321
+ '19509787.0995 -4578883.7424',
322
+ ]);
323
+ o(boundingBoxes[1].attrs.crs).equals('urn:ogc:def:crs:EPSG::2193');
324
+ o(boundingBoxes[1].children.map((c) => c.textContent)).deepEquals([
325
+ '5766358.9964 1757351.3045',
326
+ '5793264.8304 1798321.5516',
327
+ ]);
199
328
 
200
- o(tms[1].find('ows:Identifier')?.textContent).equals('EPSG:3857');
201
- o(tms[1].find('ows:SupportedCRS')?.textContent).equals('urn:ogc:def:crs:EPSG::3857');
329
+ const wgs84 = layer.find('ows:WGS84BoundingBox');
330
+ o(wgs84?.attrs.crs).equals('urn:ogc:def:crs:OGC:2:84');
331
+ o(wgs84?.children.map((c) => c.textContent)).deepEquals(['174.79248 -38.212288', '175.259399 -37.996163']);
202
332
  });
203
333
 
204
- o('should support multiple tilesets', () => {
205
- const ts = [
206
- new FakeTileSet(TileSetName.aerial, Nztm2000Tms, 'aerial-title'),
207
- new FakeTileSet('01E7PJFR9AMQFJ05X9G7FQ3XMW', Nztm2000Tms, 'imagery-title'),
208
- ];
209
- const nodes = new WmtsCapabilities({ httpBase: 'basemaps.test', provider: Provider, layers: ts }).toVNode();
210
- const layers = tags(nodes, 'Layer');
211
- o(layers.length).equals(2);
334
+ o('should only output imagery if exists', () => {
335
+ const imagery = new Map<string, ConfigImagery>();
336
+ const raw = new WmtsCapabilities({
337
+ httpBase: 'https://basemaps.test',
338
+ provider: Provider,
339
+ tileMatrix: [Nztm2000QuadTms],
340
+ tileSet: TileSetAerial,
341
+ imagery: imagery,
342
+ formats: [ImageFormat.Png],
343
+ isIndividualLayers: true,
344
+ }).toVNode();
212
345
 
213
- o(layers[0].find('ows:Title')?.textContent).equals('aerial-title');
214
- o(layers[0].find('TileMatrixSet')?.textContent).equals('EPSG:2193');
346
+ const layers = tags(raw, 'Layer');
347
+ o(layers.length).equals(1);
215
348
 
216
- o(layers[1].find('ows:Title')?.textContent).equals('imagery-title');
217
- o(layers[1].find('TileMatrixSet')?.textContent).equals('EPSG:2193');
349
+ imagery.set(Imagery3857.id, Imagery3857);
350
+ const rawB = new WmtsCapabilities({
351
+ httpBase: 'https://basemaps.test',
352
+ provider: Provider,
353
+ tileMatrix: [Nztm2000QuadTms],
354
+ tileSet: TileSetAerial,
355
+ imagery: imagery,
356
+ formats: [ImageFormat.Png],
357
+ isIndividualLayers: true,
358
+ }).toVNode();
359
+
360
+ const layersB = tags(rawB, 'Layer');
361
+ o(layersB.length).equals(1);
218
362
  });
219
363
 
220
- o('should support child tile sets', () => {
221
- const ts = [
222
- new FakeTileSet(
223
- `${TileSetName.aerial}:wairoa_urban_2014-2015_0-10m_RGBA`,
224
- Nztm2000Tms,
225
- 'wairoa_urban_2014-2015_0-10m_RGBA',
226
- ),
227
- new FakeTileSet(
228
- `${TileSetName.aerial}:west-coast_rural_2016-17_0-3m`,
229
- Nztm2000Tms,
230
- 'west-coast_rural_2016-17_0-3m',
231
- ),
364
+ o('should cover the entire WebMercatorBounds', () => {
365
+ const halfSize = GoogleTms.extent.width / 2;
366
+ // Create two fake imagery sets one covers tile z1 x0 y0 another covers tile z1 x1 y1
367
+ // so the entire bounding box should be tile z0 x0 y0 or the full extent
368
+ const imagery = new Map();
369
+ const imageTopLeft = { ...Imagery3857, id: 'im_top_left', name: 'top_left' };
370
+ imageTopLeft.bounds = { x: -halfSize, y: 0, width: halfSize, height: halfSize };
371
+ imagery.set(imageTopLeft.id, imageTopLeft);
372
+
373
+ const imageBottomRight = { ...Imagery3857, id: 'im_bottom_right', name: 'bottom_right' };
374
+ imageBottomRight.bounds = { x: 0, y: -halfSize, width: halfSize, height: halfSize };
375
+ imagery.set(imageBottomRight.id, imageBottomRight);
376
+
377
+ const tileSet = { ...TileSetAerial };
378
+ tileSet.layers = [
379
+ { 3857: imageTopLeft.id, name: 'a_top_left' },
380
+ { 3857: imageBottomRight.id, name: 'b_bottom_right' },
232
381
  ];
233
- const nodes = new WmtsCapabilities({ httpBase: 'basemaps.test', provider: Provider, layers: ts }).toVNode();
234
- const layers = tags(nodes, 'Layer');
235
382
 
236
- o(layers.length).equals(2);
383
+ const raw = new WmtsCapabilities({
384
+ httpBase: 'https://basemaps.test',
385
+ provider: Provider,
386
+ tileMatrix: [GoogleTms],
387
+ tileSet,
388
+ imagery,
389
+ formats: [ImageFormat.Png],
390
+ isIndividualLayers: true,
391
+ }).toVNode();
237
392
 
238
- const boundingBoxes = tags(layers[0], 'ows:BoundingBox');
239
- o(boundingBoxes.length).equals(1);
393
+ const boundingBox = tags(raw, 'ows:WGS84BoundingBox').map((c) =>
394
+ c
395
+ .toString()
396
+ .split('\n')
397
+ .map((c) => c.trim()),
398
+ );
399
+ o(boundingBox[0][1]).deepEquals('<ows:LowerCorner>-180 -85.051129</ows:LowerCorner>');
400
+ o(boundingBox[0][2]).equals('<ows:UpperCorner>180 85.051129</ows:UpperCorner>');
401
+
402
+ o(boundingBox[1][1]).deepEquals('<ows:LowerCorner>-180 0</ows:LowerCorner>');
403
+ o(boundingBox[1][2]).equals('<ows:UpperCorner>0 85.051129</ows:UpperCorner>');
240
404
 
241
- const firstTitle = layers[0].children[0].textContent;
242
- o(firstTitle).equals('wairoa_urban_2014-2015_0-10m_RGBA');
243
- const secondTitle = layers[1].children[0].textContent;
244
- o(secondTitle).equals('west-coast_rural_2016-17_0-3m');
405
+ o(boundingBox[2][1]).deepEquals('<ows:LowerCorner>0 -85.051129</ows:LowerCorner>');
406
+ o(boundingBox[2][2]).equals('<ows:UpperCorner>180 0</ows:UpperCorner>');
245
407
  });
246
408
 
247
- o('should support multiple different projections on different tiles sets', () => {
248
- const ts = [
249
- new FakeTileSet(TileSetName.aerial, Nztm2000Tms, TileSetName.aerial),
250
- new FakeTileSet('01F75X9G7FQ3XMWPJFR9AMQFJ0', Nztm2000Tms, '01F75X9G7FQ3XMWPJFR9AMQFJ0'),
251
- new FakeTileSet('01E7PJFR9AMQFJ05X9G7FQ3XMW', GoogleTms, '01E7PJFR9AMQFJ05X9G7FQ3XMW'),
252
- new FakeTileSet('01E7PJFR9AMQFJ05X9G7FQ3XMW', Nztm2000QuadTms, '01E7PJFR9AMQFJ05X9G7FQ3XMW'),
253
- ];
254
- ts[1].extentOverride = new Bounds(1, 2, 2, 2);
409
+ o('should work when crossing anti meridian', () => {
410
+ const halfSize = GoogleTms.extent.width / 2;
255
411
 
256
- ts[2].tileSet.title = 'aerial_dunedin_urban';
257
- const nodes = new WmtsCapabilities({ httpBase: 'basemaps.test', provider: Provider, layers: ts }).toVNode();
412
+ const imagery = new Map();
413
+ // This image covers z1 x1.5 y1 to z1 x0.5 y1
414
+ // which cross the AM and covers half the width of two tiles
415
+ const imageBottomRight = { ...Imagery3857, id: 'im_bottom_right', name: 'bottom_right' };
416
+ imageBottomRight.bounds = { x: halfSize / 2, y: -halfSize, width: halfSize, height: halfSize };
417
+ imagery.set(imageBottomRight.id, imageBottomRight);
258
418
 
259
- const allMatrixes = tags(nodes, 'TileMatrixSet');
419
+ const tileSet = { ...TileSetAerial };
420
+ tileSet.layers = [{ 3857: imageBottomRight.id, name: 'b_bottom_right' }];
260
421
 
261
- o(allMatrixes[0].children[0].textContent).equals('EPSG:2193');
262
- o(allMatrixes[1].children[0].textContent).equals('EPSG:2193');
263
- o(allMatrixes[2].children[0].textContent).equals('EPSG:3857');
264
- o(allMatrixes[3].children[0].textContent).equals('NZTM2000Quad');
422
+ const raw = new WmtsCapabilities({
423
+ httpBase: 'https://basemaps.test',
424
+ provider: Provider,
425
+ tileMatrix: [GoogleTms],
426
+ tileSet,
427
+ imagery,
428
+ formats: [ImageFormat.Png],
429
+ isIndividualLayers: true,
430
+ }).toVNode();
265
431
 
266
- o(allMatrixes[4].find('ows:Identifier')?.textContent).equals('EPSG:2193');
267
- o(allMatrixes[5].find('ows:Identifier')?.textContent).equals('EPSG:3857');
268
- o(allMatrixes[6].find('ows:Identifier')?.textContent).equals('NZTM2000Quad');
269
- o(allMatrixes.length).equals(7);
432
+ const boundingBox = tags(raw, 'ows:WGS84BoundingBox').map((c) =>
433
+ roundNumbersInString(c.toString(), 4)
434
+ .split('\n')
435
+ .map((c) => c.trim()),
436
+ );
437
+ o(boundingBox[0][1]).deepEquals('<ows:LowerCorner>-180 -85.0511</ows:LowerCorner>');
438
+ o(boundingBox[0][2]).equals('<ows:UpperCorner>180 0</ows:UpperCorner>');
270
439
 
271
- const layers = tags(nodes, 'Layer');
272
- o(layers.length).equals(3);
440
+ o(boundingBox[1][1]).deepEquals('<ows:LowerCorner>-180 -85.0511</ows:LowerCorner>');
441
+ o(boundingBox[1][2]).equals('<ows:UpperCorner>180 0</ows:UpperCorner>');
442
+ });
273
443
 
274
- o(layers[0].find('ows:Title')?.textContent).equals(TileSetName.aerial);
275
- o(layers[0].find('TileMatrixSet')?.textContent).equals('EPSG:2193');
444
+ o('should work with NZTM2000Quad', () => {
445
+ const wmts = new WmtsCapabilities({ tileMatrix: [] } as any);
276
446
 
277
- o(layers[1].find('ows:Identifier')?.textContent).equals('01F75X9G7FQ3XMWPJFR9AMQFJ0');
278
- o(layers[1].find('TileMatrixSet')?.textContent).equals('EPSG:2193');
279
- o(layers[1].find('ows:BoundingBox')?.toString()).equals(
280
- '<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::2193">\n' +
281
- ' <ows:LowerCorner>2 1</ows:LowerCorner>\n' +
282
- ' <ows:UpperCorner>4 3</ows:UpperCorner>\n' +
283
- '</ows:BoundingBox>',
284
- );
447
+ // Full NZTM200Quad coverage
448
+ const bbox = wmts.buildWgs84BoundingBox(Nztm2000QuadTms, []);
449
+ o(bbox.children[0].textContent).equals('-180 -49.929855');
450
+ o(bbox.children[1].textContent).equals('180 2.938603');
285
451
 
286
- o(layers[2].find('ows:Title')?.textContent).equals('aerial_dunedin_urban');
287
- o(layers[2].find('ows:Identifier')?.textContent).equals('01E7PJFR9AMQFJ05X9G7FQ3XMW');
288
- o(layers[2].find('TileMatrixSet')?.textContent).equals('EPSG:3857');
289
- o(layers[2].find('ows:BoundingBox')?.toString()).equals(
290
- '<ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3857">\n' +
291
- ' <ows:LowerCorner>-20037508.3427892 -20037508.3427892</ows:LowerCorner>\n' +
292
- ' <ows:UpperCorner>20037508.3427892 20037508.3427892</ows:UpperCorner>\n' +
293
- '</ows:BoundingBox>',
294
- );
452
+ // Full NZTM200Quad coverage at z1
453
+ const bboxB = wmts.buildWgs84BoundingBox(Nztm2000QuadTms, [
454
+ Nztm2000QuadTms.tileToSourceBounds({ z: 1, x: 0, y: 0 }),
455
+ Nztm2000QuadTms.tileToSourceBounds({ z: 1, x: 1, y: 1 }),
456
+ ]);
457
+ o(bboxB.children[0].textContent).equals('-180 -49.929855');
458
+ o(bboxB.children[1].textContent).equals('180 2.938603');
459
+
460
+ // Full NZTM200Quad coverage at z5
461
+ const tileCount = Nztm2000QuadTms.zooms[5].matrixWidth;
462
+ const bboxC = wmts.buildWgs84BoundingBox(Nztm2000QuadTms, [
463
+ Nztm2000QuadTms.tileToSourceBounds({ z: 5, x: 0, y: 0 }),
464
+ Nztm2000QuadTms.tileToSourceBounds({ z: 5, x: tileCount - 1, y: tileCount - 1 }),
465
+ ]);
466
+ o(bboxC.children[0].textContent).equals('-180 -49.929855');
467
+ o(bboxC.children[1].textContent).equals('180 2.938603');
295
468
  });
296
469
  });