@basemaps/lambda-tiler 6.19.0 → 6.20.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 (157) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +2 -2
  3. package/build/__test__/tile.style.json.test.d.ts +2 -0
  4. package/build/__test__/tile.style.json.test.d.ts.map +1 -0
  5. package/build/__test__/tile.style.json.test.js +33 -0
  6. package/build/__test__/xyz.test.js +24 -23
  7. package/build/cli/dump.js +2 -2
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +2 -0
  10. package/build/routes/esri/rest.d.ts +10 -0
  11. package/build/routes/esri/rest.d.ts.map +1 -0
  12. package/build/routes/esri/rest.js +87 -0
  13. package/build/routes/imagery.d.ts +2 -0
  14. package/build/routes/imagery.d.ts.map +1 -1
  15. package/build/routes/imagery.js +3 -1
  16. package/build/routes/response.d.ts +4 -0
  17. package/build/routes/response.d.ts.map +1 -0
  18. package/build/routes/response.js +3 -0
  19. package/build/routes/tile.d.ts +0 -20
  20. package/build/routes/tile.d.ts.map +1 -1
  21. package/build/routes/tile.js +11 -161
  22. package/build/routes/tile.json.d.ts +10 -0
  23. package/build/routes/tile.json.d.ts.map +1 -0
  24. package/build/routes/tile.json.js +31 -0
  25. package/build/routes/tile.style.json.d.ts +10 -0
  26. package/build/routes/tile.style.json.d.ts.map +1 -0
  27. package/build/routes/tile.style.json.js +74 -0
  28. package/build/routes/tile.wmts.d.ts +9 -0
  29. package/build/routes/tile.wmts.d.ts.map +1 -0
  30. package/build/routes/tile.wmts.js +57 -0
  31. package/build/routes/tile.xyz.d.ts +13 -0
  32. package/build/routes/tile.xyz.d.ts.map +1 -0
  33. package/build/routes/tile.xyz.js +28 -0
  34. package/build/tile.set.raster.d.ts +2 -0
  35. package/build/tile.set.raster.d.ts.map +1 -1
  36. package/build/tile.set.raster.js +3 -1
  37. package/build/tile.set.vector.js +1 -1
  38. package/dist/index.js +10545 -9583
  39. package/dist/node_modules/color/README.md +7 -7
  40. package/dist/node_modules/color/index.js +173 -158
  41. package/dist/node_modules/color/package.json +18 -16
  42. package/dist/node_modules/color-convert/conversions.js +281 -310
  43. package/dist/node_modules/color-convert/index.js +27 -24
  44. package/dist/node_modules/color-convert/package.json +16 -14
  45. package/dist/node_modules/color-convert/route.js +22 -22
  46. package/dist/node_modules/color-name/package.json +17 -14
  47. package/dist/node_modules/color-string/package.json +5 -5
  48. package/dist/node_modules/decompress-response/index.d.ts +14 -21
  49. package/dist/node_modules/decompress-response/index.js +34 -16
  50. package/dist/node_modules/decompress-response/license +1 -1
  51. package/dist/node_modules/decompress-response/package.json +23 -17
  52. package/dist/node_modules/decompress-response/readme.md +2 -6
  53. package/dist/node_modules/detect-libc/package.json +0 -1
  54. package/dist/node_modules/mimic-response/index.d.ts +2 -2
  55. package/dist/node_modules/mimic-response/index.js +41 -2
  56. package/dist/node_modules/mimic-response/package.json +17 -17
  57. package/dist/node_modules/mimic-response/readme.md +22 -1
  58. package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
  59. package/dist/node_modules/node-abi/.releaserc.json +9 -0
  60. package/dist/node_modules/node-abi/abi_registry.json +39 -4
  61. package/dist/node_modules/node-abi/index.js +5 -2
  62. package/dist/node_modules/node-abi/package.json +17 -16
  63. package/dist/node_modules/node-abi/test/index.js +7 -15
  64. package/dist/node_modules/node-addon-api/README.md +2 -2
  65. package/dist/node_modules/node-addon-api/except.gypi +20 -11
  66. package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
  67. package/dist/node_modules/node-addon-api/napi.h +420 -164
  68. package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
  69. package/dist/node_modules/node-addon-api/package.json +43 -14
  70. package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
  71. package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
  72. package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
  73. package/dist/node_modules/prebuild-install/README.md +24 -4
  74. package/dist/node_modules/prebuild-install/asset.js +10 -10
  75. package/dist/node_modules/prebuild-install/bin.js +13 -13
  76. package/dist/node_modules/prebuild-install/download.js +22 -22
  77. package/dist/node_modules/prebuild-install/log.js +4 -4
  78. package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
  79. package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
  80. package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
  81. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
  82. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
  83. package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
  84. package/dist/node_modules/prebuild-install/package.json +18 -19
  85. package/dist/node_modules/prebuild-install/proxy.js +10 -10
  86. package/dist/node_modules/prebuild-install/rc.js +12 -12
  87. package/dist/node_modules/prebuild-install/util.js +14 -14
  88. package/dist/node_modules/semver/package.json +1 -0
  89. package/dist/node_modules/sharp/README.md +2 -2
  90. package/dist/node_modules/sharp/binding.gyp +12 -9
  91. package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  92. package/dist/node_modules/sharp/install/dll-copy.js +6 -6
  93. package/dist/node_modules/sharp/install/libvips.js +4 -8
  94. package/dist/node_modules/sharp/lib/channel.js +11 -7
  95. package/dist/node_modules/sharp/lib/colour.js +42 -1
  96. package/dist/node_modules/sharp/lib/constructor.js +18 -31
  97. package/dist/node_modules/sharp/lib/input.js +45 -3
  98. package/dist/node_modules/sharp/lib/is.js +19 -5
  99. package/dist/node_modules/sharp/lib/libvips.js +4 -19
  100. package/dist/node_modules/sharp/lib/operation.js +28 -5
  101. package/dist/node_modules/sharp/lib/output.js +147 -16
  102. package/dist/node_modules/sharp/lib/sharp.js +31 -0
  103. package/dist/node_modules/sharp/lib/utility.js +3 -2
  104. package/dist/node_modules/sharp/package.json +32 -23
  105. package/dist/node_modules/sharp/src/common.cc +67 -11
  106. package/dist/node_modules/sharp/src/common.h +25 -5
  107. package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
  108. package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
  109. package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
  110. package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
  111. package/dist/node_modules/sharp/src/metadata.cc +14 -0
  112. package/dist/node_modules/sharp/src/metadata.h +1 -0
  113. package/dist/node_modules/sharp/src/operations.cc +29 -3
  114. package/dist/node_modules/sharp/src/operations.h +13 -2
  115. package/dist/node_modules/sharp/src/pipeline.cc +103 -35
  116. package/dist/node_modules/sharp/src/pipeline.h +23 -3
  117. package/dist/node_modules/sharp/src/utilities.cc +1 -1
  118. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
  119. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
  120. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
  121. package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
  122. package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
  123. package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  124. package/dist/node_modules/simple-get/README.md +17 -3
  125. package/dist/node_modules/simple-get/index.js +9 -0
  126. package/dist/node_modules/simple-get/package.json +27 -13
  127. package/dist/package-lock.json +51 -51
  128. package/dist/package.json +9 -9
  129. package/package.json +10 -10
  130. package/src/__test__/tile.style.json.test.ts +40 -0
  131. package/src/__test__/xyz.test.ts +32 -30
  132. package/src/cli/dump.ts +2 -2
  133. package/src/index.ts +2 -0
  134. package/src/routes/esri/rest.ts +90 -0
  135. package/src/routes/imagery.ts +3 -1
  136. package/src/routes/response.ts +4 -0
  137. package/src/routes/tile.json.ts +44 -0
  138. package/src/routes/tile.style.json.ts +77 -0
  139. package/src/routes/tile.ts +11 -183
  140. package/src/routes/tile.wmts.ts +59 -0
  141. package/src/routes/tile.xyz.ts +30 -0
  142. package/src/tile.set.raster.ts +4 -1
  143. package/src/tile.set.vector.ts +1 -1
  144. package/tsconfig.tsbuildinfo +1 -1
  145. package/dist/node_modules/color-name/.eslintrc.json +0 -43
  146. package/dist/node_modules/color-name/test.js +0 -7
  147. package/dist/node_modules/node-abi/.travis.yml +0 -17
  148. package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
  149. package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
  150. package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
  151. package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
  152. package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
  153. package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
  154. package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
  155. package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
  156. package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
  157. package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
@@ -0,0 +1,31 @@
1
+ import { Env } from '@basemaps/shared';
2
+ import { HttpHeader, LambdaHttpResponse } from '@linzjs/lambda';
3
+ import { createHash } from 'crypto';
4
+ import { Router } from '../router.js';
5
+ import { NotModified } from './response.js';
6
+ import { TileEtag } from './tile.etag.js';
7
+ export async function tileJson(req) {
8
+ var _a;
9
+ const { version, rest, name } = Router.action(req);
10
+ const apiKey = Router.apiKey(req);
11
+ const host = (_a = Env.get(Env.PublicUrlBase)) !== null && _a !== void 0 ? _a : '';
12
+ const tileUrl = `${host}/${version}/${name}/${rest[0]}/${rest[1]}/{z}/{x}/{y}.pbf?api=${apiKey}`;
13
+ const tileJson = {
14
+ tiles: [tileUrl],
15
+ minzoom: 0,
16
+ maxzoom: 15,
17
+ format: 'pbf',
18
+ tilejson: '2.0.0',
19
+ };
20
+ const json = JSON.stringify(tileJson);
21
+ const data = Buffer.from(json);
22
+ const cacheKey = createHash('sha256').update(data).digest('base64');
23
+ if (TileEtag.isNotModified(req, cacheKey))
24
+ return NotModified;
25
+ const response = new LambdaHttpResponse(200, 'ok');
26
+ response.header(HttpHeader.ETag, cacheKey);
27
+ response.header(HttpHeader.CacheControl, 'max-age=120');
28
+ response.buffer(data, 'application/json');
29
+ req.set('bytes', data.byteLength);
30
+ return response;
31
+ }
@@ -0,0 +1,10 @@
1
+ import { LambdaHttpRequest, LambdaHttpResponse } from '@linzjs/lambda';
2
+ /**
3
+ * Convert relative URLS into a full hostname url
4
+ * @param url possible url to update
5
+ * @param apiKey ApiKey to append with ?api= if required
6
+ * @returns Updated Url or empty string if url is empty
7
+ */
8
+ export declare function convertRelativeUrl(url?: string, apiKey?: string): string;
9
+ export declare function styleJson(req: LambdaHttpRequest, fileName: string): Promise<LambdaHttpResponse>;
10
+ //# sourceMappingURL=tile.style.json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile.style.json.d.ts","sourceRoot":"","sources":["../../src/routes/tile.style.json.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAOnF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAOxE;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmDrG"}
@@ -0,0 +1,74 @@
1
+ import { Config, Env } from '@basemaps/shared';
2
+ import { fsa } from '@chunkd/fs';
3
+ import { HttpHeader, LambdaHttpResponse } from '@linzjs/lambda';
4
+ import { createHash } from 'crypto';
5
+ import { URL } from 'url';
6
+ import { Router } from '../router.js';
7
+ import { NotFound, NotModified } from './response.js';
8
+ import { TileEtag } from './tile.etag.js';
9
+ /**
10
+ * Convert relative URLS into a full hostname url
11
+ * @param url possible url to update
12
+ * @param apiKey ApiKey to append with ?api= if required
13
+ * @returns Updated Url or empty string if url is empty
14
+ */
15
+ export function convertRelativeUrl(url, apiKey) {
16
+ var _a;
17
+ if (url == null)
18
+ return '';
19
+ const host = (_a = Env.get(Env.PublicUrlBase)) !== null && _a !== void 0 ? _a : '';
20
+ if (!url.startsWith('/'))
21
+ return url; // Not relative ignore
22
+ const fullUrl = new URL(fsa.join(host, url));
23
+ if (apiKey)
24
+ fullUrl.searchParams.set('api', apiKey);
25
+ return fullUrl.toString().replace(/%7B/g, '{').replace(/%7D/g, '}');
26
+ }
27
+ export async function styleJson(req, fileName) {
28
+ const apiKey = Router.apiKey(req);
29
+ if (apiKey == null)
30
+ return new LambdaHttpResponse(400, 'Invalid API Key.');
31
+ const styleName = fileName.split('.json')[0];
32
+ // Get style Config from db
33
+ const dbId = Config.Style.id(styleName);
34
+ const styleConfig = await Config.Style.get(dbId);
35
+ if (styleConfig == null)
36
+ return NotFound;
37
+ // Prepare sources and add linz source
38
+ const style = styleConfig.style;
39
+ const sources = {};
40
+ for (const [key, value] of Object.entries(style.sources)) {
41
+ if (value.type === 'vector') {
42
+ value.url = convertRelativeUrl(value.url, apiKey);
43
+ }
44
+ else if (value.type === 'raster' && Array.isArray(value.tiles)) {
45
+ for (let i = 0; i < value.tiles.length; i++) {
46
+ value.tiles[i] = convertRelativeUrl(value.tiles[i], apiKey);
47
+ }
48
+ }
49
+ sources[key] = value;
50
+ }
51
+ // prepare Style.json
52
+ const styleJson = {
53
+ /** Style.json version 8 */
54
+ version: 8,
55
+ id: style.id,
56
+ name: style.name,
57
+ sources,
58
+ layers: style.layers,
59
+ metadata: style.metadata || {},
60
+ glyphs: convertRelativeUrl(style.glyphs),
61
+ sprite: convertRelativeUrl(style.sprite),
62
+ };
63
+ const json = JSON.stringify(styleJson);
64
+ const data = Buffer.from(json);
65
+ const cacheKey = createHash('sha256').update(data).digest('base64');
66
+ if (TileEtag.isNotModified(req, cacheKey))
67
+ return NotModified;
68
+ const response = new LambdaHttpResponse(200, 'ok');
69
+ response.header(HttpHeader.ETag, cacheKey);
70
+ response.header(HttpHeader.CacheControl, 'no-store');
71
+ response.buffer(data, 'application/json');
72
+ req.set('bytes', data.byteLength);
73
+ return response;
74
+ }
@@ -0,0 +1,9 @@
1
+ import { LambdaHttpRequest, LambdaHttpResponse } from '@linzjs/lambda';
2
+ /**
3
+ * Serve a WMTS request
4
+ *
5
+ * /v1/tiles/:tileSet/:tileMatrixSet/WMTSCapabilities.xml
6
+ * @example `/v1/tiles/aerial/NZTM2000Quad/WMTSCapabilities.xml`
7
+ */
8
+ export declare function wmts(req: LambdaHttpRequest): Promise<LambdaHttpResponse>;
9
+ //# sourceMappingURL=tile.wmts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile.wmts.d.ts","sourceRoot":"","sources":["../../src/routes/tile.wmts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AASnF;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8B9E"}
@@ -0,0 +1,57 @@
1
+ import { Config } from '@basemaps/config';
2
+ import { Env, TileSetName, tileWmtsFromPath } from '@basemaps/shared';
3
+ import { HttpHeader, LambdaHttpResponse } from '@linzjs/lambda';
4
+ import { createHash } from 'crypto';
5
+ import { Router } from '../router.js';
6
+ import { TileSets } from '../tile.set.cache.js';
7
+ import { WmtsCapabilities } from '../wmts.capability.js';
8
+ import { NotFound, NotModified } from './response.js';
9
+ import { TileEtag } from './tile.etag.js';
10
+ /**
11
+ * Serve a WMTS request
12
+ *
13
+ * /v1/tiles/:tileSet/:tileMatrixSet/WMTSCapabilities.xml
14
+ * @example `/v1/tiles/aerial/NZTM2000Quad/WMTSCapabilities.xml`
15
+ */
16
+ export async function wmts(req) {
17
+ var _a;
18
+ const action = Router.action(req);
19
+ const wmtsData = tileWmtsFromPath(action.rest);
20
+ if (wmtsData == null)
21
+ return NotFound;
22
+ const host = (_a = Env.get(Env.PublicUrlBase)) !== null && _a !== void 0 ? _a : '';
23
+ req.timer.start('tileset:load');
24
+ const tileSets = await wmtsLoadTileSets(wmtsData.name, wmtsData.tileMatrix);
25
+ req.timer.end('tileset:load');
26
+ if (tileSets.length === 0)
27
+ return NotFound;
28
+ const providerId = Config.Provider.id('linz');
29
+ const provider = await Config.Provider.get(providerId);
30
+ if (provider == null)
31
+ return NotFound;
32
+ const apiKey = Router.apiKey(req);
33
+ const xml = WmtsCapabilities.toXml(host, provider, tileSets, apiKey);
34
+ if (xml == null)
35
+ return NotFound;
36
+ const data = Buffer.from(xml);
37
+ const cacheKey = createHash('sha256').update(data).digest('base64');
38
+ if (TileEtag.isNotModified(req, cacheKey))
39
+ return NotModified;
40
+ const response = new LambdaHttpResponse(200, 'ok');
41
+ response.header(HttpHeader.ETag, cacheKey);
42
+ response.header(HttpHeader.CacheControl, 'max-age=0');
43
+ response.buffer(data, 'text/xml');
44
+ req.set('bytes', data.byteLength);
45
+ return response;
46
+ }
47
+ async function wmtsLoadTileSets(name, tileMatrix) {
48
+ if (tileMatrix != null) {
49
+ const ts = await TileSets.get(name, tileMatrix);
50
+ if (ts == null || ts.isVector())
51
+ return [];
52
+ return [ts];
53
+ }
54
+ if (name === '')
55
+ name = TileSetName.aerial;
56
+ return (await TileSets.getAll(name, tileMatrix)).filter((f) => f.type === 'raster');
57
+ }
@@ -0,0 +1,13 @@
1
+ import { LambdaHttpRequest, LambdaHttpResponse } from '@linzjs/lambda';
2
+ /**
3
+ * Serve a tile
4
+ *
5
+ * /v1/tiles/:tileSet/:tileMatrixSet/:z/:x/:y.:tileType
6
+ *
7
+ * @example
8
+ * Vector Tile `/v1/tiles/topographic/EPSG:3857/2/1/1.pbf`
9
+ * Raster Tile `/v1/tiles/aerial/EPSG:3857/6/0/38.webp`
10
+ * @returns
11
+ */
12
+ export declare function tileXyz(req: LambdaHttpRequest): Promise<LambdaHttpResponse>;
13
+ //# sourceMappingURL=tile.xyz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile.xyz.d.ts","sourceRoot":"","sources":["../../src/routes/tile.xyz.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMvE;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAYjF"}
@@ -0,0 +1,28 @@
1
+ import { tileXyzFromPath } from '@basemaps/shared';
2
+ import { Router } from '../router.js';
3
+ import { TileSets } from '../tile.set.cache.js';
4
+ import { ValidateTilePath } from '../validate.js';
5
+ import { NotFound } from './response.js';
6
+ /**
7
+ * Serve a tile
8
+ *
9
+ * /v1/tiles/:tileSet/:tileMatrixSet/:z/:x/:y.:tileType
10
+ *
11
+ * @example
12
+ * Vector Tile `/v1/tiles/topographic/EPSG:3857/2/1/1.pbf`
13
+ * Raster Tile `/v1/tiles/aerial/EPSG:3857/6/0/38.webp`
14
+ * @returns
15
+ */
16
+ export async function tileXyz(req) {
17
+ const action = Router.action(req);
18
+ const xyzData = tileXyzFromPath(action.rest);
19
+ if (xyzData == null)
20
+ return NotFound;
21
+ ValidateTilePath.validate(req, xyzData);
22
+ req.timer.start('tileset:load');
23
+ const tileSet = await TileSets.get(xyzData.name, xyzData.tileMatrix);
24
+ req.timer.end('tileset:load');
25
+ if (tileSet == null)
26
+ return NotFound;
27
+ return await tileSet.tile(req, xyzData);
28
+ }
@@ -3,10 +3,12 @@ import { ConfigImagery, ConfigTileSetRaster, TileSetType } from '@basemaps/confi
3
3
  import { Bounds, Tile, TileMatrixSet } from '@basemaps/geo';
4
4
  import { LogType, TileDataXyz } from '@basemaps/shared';
5
5
  import { Tiler } from '@basemaps/tiler';
6
+ import { TileMakerSharp } from '@basemaps/tiler-sharp';
6
7
  import { CogTiff } from '@cogeotiff/core';
7
8
  import { LambdaHttpRequest, LambdaHttpResponse } from '@linzjs/lambda';
8
9
  import { Metrics } from '@linzjs/metrics';
9
10
  import { TileSetHandler } from './tile.set.js';
11
+ export declare const TileComposer: TileMakerSharp;
10
12
  export interface TileSetResponse {
11
13
  buffer: Buffer;
12
14
  metrics: Metrics;
@@ -1 +1 @@
1
- {"version":3,"file":"tile.set.raster.d.ts","sourceRoot":"","sources":["../src/tile.set.raster.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAe,mBAAmB,EAAqB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACnH,OAAO,EAAE,MAAM,EAAQ,IAAI,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AAClF,OAAO,EAAoB,OAAO,EAAE,WAAW,EAAqC,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAc,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/C,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAKD,qBAAa,aAAc,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACpE,IAAI,cAAsB;IAE1B,UAAU,EAAE,aAAa,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CA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I,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE;IAgC5D,OAAO,CAAC,cAAc;IAsBtB,oDAAoD;IACpD,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAShD,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;CAuBpC"}
@@ -2,14 +2,16 @@ import { TileSetNameParser, TileSetType } from '@basemaps/config';
2
2
  import { Bounds, Epsg, TileMatrixSet, TileMatrixSets } from '@basemaps/geo';
3
3
  import { Config, Env, fsa, titleizeImageryName, VectorFormat } from '@basemaps/shared';
4
4
  import { Tiler } from '@basemaps/tiler';
5
+ import { TileMakerSharp } from '@basemaps/tiler-sharp';
5
6
  import { CogTiff } from '@cogeotiff/core';
6
7
  import { HttpHeader, LambdaHttpResponse } from '@linzjs/lambda';
7
8
  import pLimit from 'p-limit';
9
+ import { NotFound, NotModified } from './routes/response.js';
8
10
  import { TileEtag } from './routes/tile.etag.js';
9
- import { NotFound, NotModified, TileComposer } from './routes/tile.js';
10
11
  import { TiffCache } from './tiff.cache.js';
11
12
  import { TileSetHandler } from './tile.set.js';
12
13
  const LoadingQueue = pLimit(Env.getNumber(Env.TiffConcurrency, 5));
14
+ export const TileComposer = new TileMakerSharp(256);
13
15
  const DefaultResizeKernel = { in: 'lanczos3', out: 'lanczos3' };
14
16
  const DefaultBackground = { r: 0, g: 0, b: 0, alpha: 0 };
15
17
  export class TileSetRaster extends TileSetHandler {
@@ -2,7 +2,7 @@ import { TileSetType } from '@basemaps/config';
2
2
  import { fsa, VectorFormat } from '@basemaps/shared';
3
3
  import { Cotar } from '@cotar/core';
4
4
  import { HttpHeader, LambdaHttpResponse } from '@linzjs/lambda';
5
- import { NotFound } from './routes/tile.js';
5
+ import { NotFound } from './routes/response.js';
6
6
  import { TileSetHandler } from './tile.set.js';
7
7
  class CotarCache {
8
8
  constructor() {