@basemaps/lambda-tiler 7.11.0 → 7.13.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 +28 -0
- package/build/index.js +9 -4
- package/build/index.js.map +1 -1
- package/build/routes/__tests__/link.test.d.ts +1 -0
- package/build/routes/__tests__/link.test.js +82 -0
- package/build/routes/__tests__/link.test.js.map +1 -0
- package/build/routes/__tests__/tile.style.json.attribution.test.d.ts +1 -0
- package/build/routes/__tests__/tile.style.json.attribution.test.js +172 -0
- package/build/routes/__tests__/tile.style.json.attribution.test.js.map +1 -0
- package/build/routes/__tests__/tile.style.json.test.js +3 -1
- package/build/routes/__tests__/tile.style.json.test.js.map +1 -1
- package/build/routes/attribution.d.ts +19 -1
- package/build/routes/attribution.js +38 -3
- package/build/routes/attribution.js.map +1 -1
- package/build/routes/link.d.ts +17 -0
- package/build/routes/link.js +42 -0
- package/build/routes/link.js.map +1 -0
- package/build/routes/tile.style.json.d.ts +6 -2
- package/build/routes/tile.style.json.js +13 -5
- package/build/routes/tile.style.json.js.map +1 -1
- package/build/util/__test__/nztm.style.test.js +16 -7
- package/build/util/__test__/nztm.style.test.js.map +1 -1
- package/build/util/nztm.style.js +0 -3
- package/build/util/nztm.style.js.map +1 -1
- package/dist/index.js +86535 -0
- package/dist/node_modules/.package-lock.json +179 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/README.md +47 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/glib-2.0/include/glibconfig.h +219 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/index.js +1 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/lib/libvips-cpp.so.42 +0 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/package.json +45 -0
- package/dist/node_modules/@img/sharp-libvips-linux-arm64/versions.json +31 -0
- package/dist/node_modules/@img/sharp-linux-arm64/LICENSE +191 -0
- package/dist/node_modules/@img/sharp-linux-arm64/README.md +18 -0
- package/dist/node_modules/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node +0 -0
- package/dist/node_modules/@img/sharp-linux-arm64/package.json +47 -0
- package/dist/node_modules/color/LICENSE +21 -0
- package/dist/node_modules/color/README.md +123 -0
- package/dist/node_modules/color/index.js +496 -0
- package/dist/node_modules/color/package.json +47 -0
- package/dist/node_modules/color-convert/CHANGELOG.md +54 -0
- package/dist/node_modules/color-convert/LICENSE +21 -0
- package/dist/node_modules/color-convert/README.md +68 -0
- package/dist/node_modules/color-convert/conversions.js +839 -0
- package/dist/node_modules/color-convert/index.js +81 -0
- package/dist/node_modules/color-convert/package.json +48 -0
- package/dist/node_modules/color-convert/route.js +97 -0
- package/dist/node_modules/color-name/LICENSE +8 -0
- package/dist/node_modules/color-name/README.md +11 -0
- package/dist/node_modules/color-name/index.js +152 -0
- package/dist/node_modules/color-name/package.json +28 -0
- package/dist/node_modules/color-string/LICENSE +21 -0
- package/dist/node_modules/color-string/README.md +62 -0
- package/dist/node_modules/color-string/index.js +242 -0
- package/dist/node_modules/color-string/package.json +39 -0
- package/dist/node_modules/detect-libc/LICENSE +201 -0
- package/dist/node_modules/detect-libc/README.md +163 -0
- package/dist/node_modules/detect-libc/index.d.ts +14 -0
- package/dist/node_modules/detect-libc/lib/detect-libc.js +267 -0
- package/dist/node_modules/detect-libc/lib/filesystem.js +41 -0
- package/dist/node_modules/detect-libc/lib/process.js +24 -0
- package/dist/node_modules/detect-libc/package.json +40 -0
- package/dist/node_modules/is-arrayish/LICENSE +21 -0
- package/dist/node_modules/is-arrayish/README.md +16 -0
- package/dist/node_modules/is-arrayish/index.js +9 -0
- package/dist/node_modules/is-arrayish/package.json +45 -0
- package/dist/node_modules/is-arrayish/yarn-error.log +1443 -0
- package/dist/node_modules/lerc/CHANGELOG.md +69 -0
- package/dist/node_modules/lerc/LercDecode.d.ts +61 -0
- package/dist/node_modules/lerc/LercDecode.es.d.ts +61 -0
- package/dist/node_modules/lerc/LercDecode.es.js +434 -0
- package/dist/node_modules/lerc/LercDecode.es.min.js +17 -0
- package/dist/node_modules/lerc/LercDecode.js +448 -0
- package/dist/node_modules/lerc/LercDecode.min.js +17 -0
- package/dist/node_modules/lerc/README.md +123 -0
- package/dist/node_modules/lerc/lerc-wasm.wasm +0 -0
- package/dist/node_modules/lerc/package.json +30 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/README.md +654 -0
- package/dist/node_modules/semver/bin/semver.js +188 -0
- package/dist/node_modules/semver/classes/comparator.js +141 -0
- package/dist/node_modules/semver/classes/index.js +5 -0
- package/dist/node_modules/semver/classes/range.js +554 -0
- package/dist/node_modules/semver/classes/semver.js +302 -0
- package/dist/node_modules/semver/functions/clean.js +6 -0
- package/dist/node_modules/semver/functions/cmp.js +52 -0
- package/dist/node_modules/semver/functions/coerce.js +60 -0
- package/dist/node_modules/semver/functions/compare-build.js +7 -0
- package/dist/node_modules/semver/functions/compare-loose.js +3 -0
- package/dist/node_modules/semver/functions/compare.js +5 -0
- package/dist/node_modules/semver/functions/diff.js +65 -0
- package/dist/node_modules/semver/functions/eq.js +3 -0
- package/dist/node_modules/semver/functions/gt.js +3 -0
- package/dist/node_modules/semver/functions/gte.js +3 -0
- package/dist/node_modules/semver/functions/inc.js +19 -0
- package/dist/node_modules/semver/functions/lt.js +3 -0
- package/dist/node_modules/semver/functions/lte.js +3 -0
- package/dist/node_modules/semver/functions/major.js +3 -0
- package/dist/node_modules/semver/functions/minor.js +3 -0
- package/dist/node_modules/semver/functions/neq.js +3 -0
- package/dist/node_modules/semver/functions/parse.js +16 -0
- package/dist/node_modules/semver/functions/patch.js +3 -0
- package/dist/node_modules/semver/functions/prerelease.js +6 -0
- package/dist/node_modules/semver/functions/rcompare.js +3 -0
- package/dist/node_modules/semver/functions/rsort.js +3 -0
- package/dist/node_modules/semver/functions/satisfies.js +10 -0
- package/dist/node_modules/semver/functions/sort.js +3 -0
- package/dist/node_modules/semver/functions/valid.js +6 -0
- package/dist/node_modules/semver/index.js +89 -0
- package/dist/node_modules/semver/internal/constants.js +35 -0
- package/dist/node_modules/semver/internal/debug.js +9 -0
- package/dist/node_modules/semver/internal/identifiers.js +23 -0
- package/dist/node_modules/semver/internal/lrucache.js +40 -0
- package/dist/node_modules/semver/internal/parse-options.js +15 -0
- package/dist/node_modules/semver/internal/re.js +217 -0
- package/dist/node_modules/semver/package.json +77 -0
- package/dist/node_modules/semver/preload.js +2 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +4 -0
- package/dist/node_modules/semver/ranges/intersects.js +7 -0
- package/dist/node_modules/semver/ranges/ltr.js +4 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/dist/node_modules/semver/ranges/min-version.js +61 -0
- package/dist/node_modules/semver/ranges/outside.js +80 -0
- package/dist/node_modules/semver/ranges/simplify.js +47 -0
- package/dist/node_modules/semver/ranges/subset.js +247 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +8 -0
- package/dist/node_modules/semver/ranges/valid.js +11 -0
- package/dist/node_modules/sharp/LICENSE +191 -0
- package/dist/node_modules/sharp/README.md +118 -0
- package/dist/node_modules/sharp/install/check.js +36 -0
- package/dist/node_modules/sharp/lib/channel.js +174 -0
- package/dist/node_modules/sharp/lib/colour.js +182 -0
- package/dist/node_modules/sharp/lib/composite.js +210 -0
- package/dist/node_modules/sharp/lib/constructor.js +444 -0
- package/dist/node_modules/sharp/lib/index.d.ts +1717 -0
- package/dist/node_modules/sharp/lib/index.js +16 -0
- package/dist/node_modules/sharp/lib/input.js +657 -0
- package/dist/node_modules/sharp/lib/is.js +169 -0
- package/dist/node_modules/sharp/lib/libvips.js +171 -0
- package/dist/node_modules/sharp/lib/operation.js +919 -0
- package/dist/node_modules/sharp/lib/output.js +1561 -0
- package/dist/node_modules/sharp/lib/resize.js +582 -0
- package/dist/node_modules/sharp/lib/sharp.js +86 -0
- package/dist/node_modules/sharp/lib/utility.js +287 -0
- package/dist/node_modules/sharp/package.json +219 -0
- package/dist/node_modules/sharp/src/binding.gyp +277 -0
- package/dist/node_modules/sharp/src/common.cc +1090 -0
- package/dist/node_modules/sharp/src/common.h +393 -0
- package/dist/node_modules/sharp/src/metadata.cc +287 -0
- package/dist/node_modules/sharp/src/metadata.h +82 -0
- package/dist/node_modules/sharp/src/operations.cc +471 -0
- package/dist/node_modules/sharp/src/operations.h +125 -0
- package/dist/node_modules/sharp/src/pipeline.cc +1724 -0
- package/dist/node_modules/sharp/src/pipeline.h +385 -0
- package/dist/node_modules/sharp/src/sharp.cc +40 -0
- package/dist/node_modules/sharp/src/stats.cc +183 -0
- package/dist/node_modules/sharp/src/stats.h +59 -0
- package/dist/node_modules/sharp/src/utilities.cc +269 -0
- package/dist/node_modules/sharp/src/utilities.h +19 -0
- package/dist/node_modules/simple-swizzle/LICENSE +21 -0
- package/dist/node_modules/simple-swizzle/README.md +39 -0
- package/dist/node_modules/simple-swizzle/index.js +29 -0
- package/dist/node_modules/simple-swizzle/package.json +36 -0
- package/dist/package-lock.json +610 -0
- package/dist/package.json +40 -0
- package/dist/static/expected_tile_2193_153_255_z7.png +0 -0
- package/dist/static/expected_tile_NZTM2000Quad_30_33_z6.png +0 -0
- package/dist/static/expected_tile_WebMercatorQuad_252_156_z8.png +0 -0
- package/package.json +9 -9
- package/src/index.ts +10 -4
- package/src/routes/__tests__/link.test.ts +114 -0
- package/src/routes/__tests__/tile.style.json.attribution.test.ts +224 -0
- package/src/routes/__tests__/tile.style.json.test.ts +3 -2
- package/src/routes/attribution.ts +50 -5
- package/src/routes/link.ts +55 -0
- package/src/routes/tile.style.json.ts +16 -5
- package/src/util/__test__/nztm.style.test.ts +18 -8
- package/src/util/nztm.style.ts +0 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -2,7 +2,9 @@ import assert from 'node:assert';
|
|
|
2
2
|
import { describe, it } from 'node:test';
|
|
3
3
|
|
|
4
4
|
import { StyleJson } from '@basemaps/config';
|
|
5
|
+
import { GoogleTms, Nztm2000QuadTms } from '@basemaps/geo';
|
|
5
6
|
|
|
7
|
+
import { setStyleTerrain } from '../../routes/tile.style.json.js';
|
|
6
8
|
import { convertStyleToNztmStyle } from '../nztm.style.js';
|
|
7
9
|
|
|
8
10
|
describe('NZTM2000QuadStyle', () => {
|
|
@@ -25,9 +27,6 @@ describe('NZTM2000QuadStyle', () => {
|
|
|
25
27
|
|
|
26
28
|
convertStyleToNztmStyle(baseStyle);
|
|
27
29
|
assert.equal(baseStyle.terrain?.exaggeration, 1.1);
|
|
28
|
-
|
|
29
|
-
convertStyleToNztmStyle(baseStyle, false);
|
|
30
|
-
assert.equal(baseStyle.terrain?.exaggeration, 4.4);
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
it('should convert min/maxzooms', () => {
|
|
@@ -39,13 +38,24 @@ describe('NZTM2000QuadStyle', () => {
|
|
|
39
38
|
assert.deepEqual(newStyle.layers[0], { minzoom: 3, maxzoom: 8, id: 'something', type: '' });
|
|
40
39
|
});
|
|
41
40
|
|
|
42
|
-
it('should offset terrain', () => {
|
|
43
|
-
const
|
|
41
|
+
it('should not offset terrain for WebMecator', () => {
|
|
42
|
+
const testStyle: StyleJson = {
|
|
44
43
|
...fakeStyle,
|
|
45
|
-
|
|
46
|
-
}
|
|
44
|
+
sources: { 'LINZ-Terrain': { type: 'raster-dem', tiles: ['https://example.com/{z}/{x}/{y}.png'] } },
|
|
45
|
+
};
|
|
46
|
+
setStyleTerrain(testStyle, 'LINZ-Terrain', GoogleTms);
|
|
47
|
+
|
|
48
|
+
assert.deepEqual(testStyle.terrain, { exaggeration: 1.2, source: 'LINZ-Terrain' });
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should offset terrain for NZTM', () => {
|
|
52
|
+
const testStyle: StyleJson = {
|
|
53
|
+
...fakeStyle,
|
|
54
|
+
sources: { 'LINZ-Terrain': { type: 'raster-dem', tiles: ['https://example.com/{z}/{x}/{y}.png'] } },
|
|
55
|
+
};
|
|
56
|
+
setStyleTerrain(testStyle, 'LINZ-Terrain', Nztm2000QuadTms);
|
|
47
57
|
|
|
48
|
-
assert.deepEqual(
|
|
58
|
+
assert.deepEqual(testStyle.terrain, { exaggeration: 4.4, source: 'LINZ-Terrain' });
|
|
49
59
|
});
|
|
50
60
|
|
|
51
61
|
it('should convert stops inside of paint and layout', () => {
|
package/src/util/nztm.style.ts
CHANGED
|
@@ -37,8 +37,5 @@ export function convertStyleToNztmStyle(inputStyle: StyleJson, clone: boolean =
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/** Based on {@link DefaultExaggeration} offsetting by 2 two levels changes the exaggeration needed by approx 4x */
|
|
41
|
-
if (style.terrain) style.terrain.exaggeration = style.terrain.exaggeration * 4;
|
|
42
|
-
|
|
43
40
|
return style;
|
|
44
41
|
}
|