@math.gl/geospatial 5.0.0-beta.1 → 5.0.0-beta.3
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/dist/crs/crs-identifier.d.ts +23 -0
- package/dist/crs/crs-identifier.d.ts.map +1 -0
- package/dist/crs/crs-identifier.js +74 -0
- package/dist/crs/crs-identifier.js.map +1 -0
- package/dist/crs/index.cjs +48 -0
- package/dist/crs/index.cjs.map +2 -2
- package/dist/crs/index.d.ts +1 -0
- package/dist/crs/index.d.ts.map +1 -1
- package/dist/crs/index.js +1 -0
- package/dist/crs/index.js.map +1 -1
- package/dist/discontinuous/cap-map.d.ts.map +1 -1
- package/dist/discontinuous/cap-map.js +197 -13
- package/dist/discontinuous/cap-map.js.map +1 -1
- package/dist/discontinuous/elastic/geometry.d.ts +1 -1
- package/dist/discontinuous/elastic/geometry.d.ts.map +1 -1
- package/dist/discontinuous/elastic/geometry.js +7 -7
- package/dist/discontinuous/elastic/geometry.js.map +1 -1
- package/dist/discontinuous/elastic/map.d.ts.map +1 -1
- package/dist/discontinuous/elastic/map.js +263 -23
- package/dist/discontinuous/elastic/map.js.map +1 -1
- package/dist/discontinuous/elastic/source-arc.d.ts +10 -0
- package/dist/discontinuous/elastic/source-arc.d.ts.map +1 -0
- package/dist/discontinuous/elastic/source-arc.js +111 -0
- package/dist/discontinuous/elastic/source-arc.js.map +1 -0
- package/dist/discontinuous/global-polygons.d.ts +1 -1
- package/dist/discontinuous/global-polygons.d.ts.map +1 -1
- package/dist/discontinuous/global-polygons.js +49 -1
- package/dist/discontinuous/global-polygons.js.map +1 -1
- package/dist/discontinuous/map-engine.d.ts +9 -0
- package/dist/discontinuous/map-engine.d.ts.map +1 -1
- package/dist/discontinuous/map-layout.d.ts +21 -0
- package/dist/discontinuous/map-layout.d.ts.map +1 -1
- package/dist/discontinuous/map-layout.js +116 -1
- package/dist/discontinuous/map-layout.js.map +1 -1
- package/dist/discontinuous/map-transition.d.ts.map +1 -1
- package/dist/discontinuous/map-transition.js +66 -3
- package/dist/discontinuous/map-transition.js.map +1 -1
- package/dist/discontinuous/mercator-map.d.ts +2 -2
- package/dist/discontinuous/mercator-map.d.ts.map +1 -1
- package/dist/discontinuous/mercator-map.js +123 -11
- package/dist/discontinuous/mercator-map.js.map +1 -1
- package/dist/discontinuous/polygon-constraints.d.ts +16 -0
- package/dist/discontinuous/polygon-constraints.d.ts.map +1 -0
- package/dist/discontinuous/polygon-constraints.js +157 -0
- package/dist/discontinuous/polygon-constraints.js.map +1 -0
- package/dist/discontinuous/prepare-features.d.ts +27 -0
- package/dist/discontinuous/prepare-features.d.ts.map +1 -1
- package/dist/discontinuous/prepare-features.js +106 -5
- package/dist/discontinuous/prepare-features.js.map +1 -1
- package/dist/discontinuous/rotated-map.d.ts +9 -0
- package/dist/discontinuous/rotated-map.d.ts.map +1 -1
- package/dist/discontinuous/source-arc.d.ts +4 -0
- package/dist/discontinuous/source-arc.d.ts.map +1 -0
- package/dist/discontinuous/source-arc.js +23 -0
- package/dist/discontinuous/source-arc.js.map +1 -0
- package/dist/discontinuous/world-kernels.d.ts +1 -1
- package/dist/discontinuous.cjs +1047 -75
- package/dist/discontinuous.cjs.map +3 -3
- package/dist/index.cjs +422 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/tasks/definitions.d.ts +90 -0
- package/dist/tasks/definitions.d.ts.map +1 -0
- package/dist/tasks/definitions.js +54 -0
- package/dist/tasks/definitions.js.map +1 -0
- package/dist/{workers → tasks}/index.cjs +1223 -191
- package/dist/tasks/index.cjs.map +6 -0
- package/dist/tasks/index.d.ts +12 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +30 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/{workers → tasks}/map-worker.d.ts.map +1 -1
- package/dist/tasks/map-worker.js +7 -0
- package/dist/tasks/map-worker.js.map +1 -0
- package/dist/{workers → tasks}/operations.d.ts +6 -4
- package/dist/tasks/operations.d.ts.map +1 -0
- package/dist/{workers → tasks}/operations.js +3 -5
- package/dist/tasks/operations.js.map +1 -0
- package/dist/tasks/projection-worker.d.ts.map +1 -0
- package/dist/tasks/projection-worker.js +7 -0
- package/dist/tasks/projection-worker.js.map +1 -0
- package/dist/terrain/filtered-pyramid.d.ts +22 -0
- package/dist/terrain/filtered-pyramid.d.ts.map +1 -0
- package/dist/terrain/filtered-pyramid.js +71 -0
- package/dist/terrain/filtered-pyramid.js.map +1 -0
- package/dist/terrain/index.cjs +375 -1
- package/dist/terrain/index.cjs.map +2 -2
- package/dist/terrain/index.d.ts +12 -0
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js +7 -0
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/profile-horizon.d.ts +20 -0
- package/dist/terrain/profile-horizon.d.ts.map +1 -0
- package/dist/terrain/profile-horizon.js +69 -0
- package/dist/terrain/profile-horizon.js.map +1 -0
- package/dist/terrain/profile-slope.d.ts +3 -0
- package/dist/terrain/profile-slope.d.ts.map +1 -0
- package/dist/terrain/profile-slope.js +35 -0
- package/dist/terrain/profile-slope.js.map +1 -0
- package/dist/terrain/profile-viewshed.d.ts +17 -0
- package/dist/terrain/profile-viewshed.d.ts.map +1 -0
- package/dist/terrain/profile-viewshed.js +51 -0
- package/dist/terrain/profile-viewshed.js.map +1 -0
- package/dist/terrain/profile-visibility.d.ts +21 -0
- package/dist/terrain/profile-visibility.d.ts.map +1 -0
- package/dist/terrain/profile-visibility.js +61 -0
- package/dist/terrain/profile-visibility.js.map +1 -0
- package/dist/terrain/vertex-halo-invalidation.d.ts +16 -0
- package/dist/terrain/vertex-halo-invalidation.d.ts.map +1 -0
- package/dist/terrain/vertex-halo-invalidation.js +50 -0
- package/dist/terrain/vertex-halo-invalidation.js.map +1 -0
- package/dist/terrain/vertex-halo-update.d.ts +18 -0
- package/dist/terrain/vertex-halo-update.d.ts.map +1 -0
- package/dist/terrain/vertex-halo-update.js +76 -0
- package/dist/terrain/vertex-halo-update.js.map +1 -0
- package/dist/terrain/vertex-halos.d.ts +26 -0
- package/dist/terrain/vertex-halos.d.ts.map +1 -0
- package/dist/terrain/vertex-halos.js +80 -0
- package/dist/terrain/vertex-halos.js.map +1 -0
- package/dist/turf.cjs +69 -5
- package/dist/turf.cjs.map +2 -2
- package/dist/turf.d.ts +9 -0
- package/dist/turf.d.ts.map +1 -1
- package/dist/turf.js +67 -0
- package/dist/turf.js.map +1 -1
- package/package.json +10 -15
- package/src/crs/crs-identifier.ts +86 -0
- package/src/crs/index.ts +1 -0
- package/src/discontinuous/cap-map.ts +248 -19
- package/src/discontinuous/elastic/geometry.ts +18 -7
- package/src/discontinuous/elastic/map.ts +334 -30
- package/src/discontinuous/elastic/source-arc.ts +129 -0
- package/src/discontinuous/global-polygons.ts +56 -2
- package/src/discontinuous/map-layout.ts +165 -2
- package/src/discontinuous/map-transition.ts +67 -3
- package/src/discontinuous/mercator-map.ts +151 -12
- package/src/discontinuous/polygon-constraints.ts +184 -0
- package/src/discontinuous/prepare-features.ts +154 -6
- package/src/discontinuous/source-arc.ts +31 -0
- package/src/index.ts +13 -0
- package/src/tasks/definitions.ts +89 -0
- package/src/tasks/index.ts +39 -0
- package/src/tasks/map-worker.ts +6 -0
- package/src/{workers → tasks}/operations.ts +11 -7
- package/src/tasks/projection-worker.ts +6 -0
- package/src/terrain/filtered-pyramid.ts +95 -0
- package/src/terrain/index.ts +12 -0
- package/src/terrain/profile-horizon.ts +86 -0
- package/src/terrain/profile-slope.ts +32 -0
- package/src/terrain/profile-viewshed.ts +57 -0
- package/src/terrain/profile-visibility.ts +81 -0
- package/src/terrain/vertex-halo-invalidation.ts +57 -0
- package/src/terrain/vertex-halo-update.ts +91 -0
- package/src/terrain/vertex-halos.ts +101 -0
- package/src/turf.ts +86 -0
- package/dist/workers/index.cjs.map +0 -6
- package/dist/workers/index.d.ts +0 -12
- package/dist/workers/index.d.ts.map +0 -1
- package/dist/workers/index.js +0 -41
- package/dist/workers/index.js.map +0 -1
- package/dist/workers/map-worker.js +0 -7
- package/dist/workers/map-worker.js.map +0 -1
- package/dist/workers/operations.cjs +0 -20036
- package/dist/workers/operations.cjs.map +0 -6
- package/dist/workers/operations.d.ts.map +0 -1
- package/dist/workers/operations.js.map +0 -1
- package/dist/workers/projection-worker.d.ts.map +0 -1
- package/dist/workers/projection-worker.js +0 -7
- package/dist/workers/projection-worker.js.map +0 -1
- package/src/workers/index.ts +0 -59
- package/src/workers/map-worker.ts +0 -7
- package/src/workers/projection-worker.ts +0 -7
- /package/dist/{workers → tasks}/map-worker.d.ts +0 -0
- /package/dist/{workers → tasks}/projection-worker.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TaskWorker } from '@math.gl/core/tasks';
|
|
2
|
+
import { ProjectCoordinatesTask as projectionTask, PrepareMapTask as mapTask } from "./definitions.js";
|
|
3
|
+
export type { ProjectCoordinatesTypes, PrepareMapTypes } from "./definitions.js";
|
|
4
|
+
/** Reproject coordinates with an automatic or explicitly retained worker. */
|
|
5
|
+
export declare const ProjectCoordinatesTask: typeof projectionTask & {
|
|
6
|
+
worker: TaskWorker;
|
|
7
|
+
};
|
|
8
|
+
/** Prepare a portable map snapshot in a worker. */
|
|
9
|
+
export declare const PrepareMapTask: typeof mapTask & {
|
|
10
|
+
worker: TaskWorker;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAC,sBAAsB,IAAI,cAAc,EAAE,cAAc,IAAI,OAAO,EAAC,yBAAsB;AAClG,YAAY,EAAC,uBAAuB,EAAE,eAAe,EAAC,yBAAsB;AAU5E,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,OAAO,cAAc,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAW/E,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,OAAO,OAAO,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAQhE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ProjectCoordinatesTask as projectionTask, PrepareMapTask as mapTask } from "./definitions.js";
|
|
2
|
+
// Resolve compiled worker modules in both ESM and CommonJS package entries.
|
|
3
|
+
const isBrowser = !globalThis.process?.versions?.node;
|
|
4
|
+
const path = typeof __filename === 'string' ? __filename.replace(/\\/g, '/') : '';
|
|
5
|
+
const moduleUrl = path
|
|
6
|
+
? `file://${path.startsWith('/') ? '' : '/'}${encodeURI(path).replace(/#/g, '%23').replace(/\?/g, '%3F')}`
|
|
7
|
+
: import.meta.url;
|
|
8
|
+
/** Reproject coordinates with an automatic or explicitly retained worker. */
|
|
9
|
+
export const ProjectCoordinatesTask = {
|
|
10
|
+
...projectionTask,
|
|
11
|
+
worker: {
|
|
12
|
+
...(!isBrowser
|
|
13
|
+
? { url: /* @__PURE__ */ (() => new URL('./projection-worker.js', moduleUrl).href)() }
|
|
14
|
+
: {
|
|
15
|
+
create: () => new Worker(new URL('./projection-worker.js', import.meta.url), { type: 'module' })
|
|
16
|
+
}),
|
|
17
|
+
capabilities: { atomic: true, streaming: true }
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** Prepare a portable map snapshot in a worker. */
|
|
21
|
+
export const PrepareMapTask = {
|
|
22
|
+
...mapTask,
|
|
23
|
+
worker: {
|
|
24
|
+
...(!isBrowser
|
|
25
|
+
? { url: /* @__PURE__ */ (() => new URL('./map-worker.js', moduleUrl).href)() }
|
|
26
|
+
: { create: () => new Worker(new URL('./map-worker.js', import.meta.url), { type: 'module' }) }),
|
|
27
|
+
capabilities: { atomic: true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AE,QAAQ,EAAC,CAAC;aACnF,CAAC;QACN,YAAY,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC;KAC9C;CACF,CAAC;AAEF,mDAAmD;AACnD,MAAM,CAAC,MAAM,cAAc,GAA0C;IACnE,GAAG,OAAO;IACV,MAAM,EAAE;QACN,GAAG,CAAC,CAAC,SAAS;YACZ,CAAC,CAAC,EAAC,GAAG,EAAE,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,EAAC;YAC7E,CAAC,CAAC,EAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,EAAC,CAAC;QAC9F,YAAY,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAC;KAC/C;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-worker.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"map-worker.d.ts","sourceRoot":"","sources":["../../src/tasks/map-worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { initializeTaskWorker } from '@math.gl/core/tasks';
|
|
5
|
+
import { PrepareMapTask } from "./definitions.js";
|
|
6
|
+
void initializeTaskWorker(PrepareMapTask);
|
|
7
|
+
//# sourceMappingURL=map-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-worker.js","sourceRoot":"","sources":["../../src/tasks/map-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,cAAc,EAAC,yBAAsB;AAC7C,KAAK,oBAAoB,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MapEngine, type MapDescription, type MapEngineOptions } from "../discontinuous/map-engine.js";
|
|
2
|
-
import type { CreateProjectionOptions, ProjectionArray } from "../projection/types.js";
|
|
3
|
-
import type {
|
|
2
|
+
import type { CreateProjectionOptions, ProjectionArray, Projection } from "../projection/types.js";
|
|
3
|
+
import type { TaskContext } from '@math.gl/core/tasks';
|
|
4
|
+
type OperationContext = Partial<Omit<TaskContext<unknown>, 'state'>>;
|
|
4
5
|
export type BulkProjectionTask = {
|
|
5
6
|
projection: CreateProjectionOptions;
|
|
6
7
|
coordinates: ProjectionArray;
|
|
@@ -9,7 +10,8 @@ export type BulkProjectionTask = {
|
|
|
9
10
|
chunkSize?: number;
|
|
10
11
|
};
|
|
11
12
|
/** Setup callbacks belong in the worker and cannot be sent in a request. */
|
|
12
|
-
export declare function setupMap(description: MapDescription, context:
|
|
13
|
+
export declare function setupMap(description: MapDescription, context: OperationContext, options?: MapEngineOptions): MapEngine;
|
|
13
14
|
/** Process worker-owned storage in chunks. Failed jobs return no partial result. */
|
|
14
|
-
export declare function projectBulk(input: BulkProjectionTask, context:
|
|
15
|
+
export declare function projectBulk(input: BulkProjectionTask, context: OperationContext, preparedProjection?: Projection): Promise<ProjectionArray>;
|
|
16
|
+
export {};
|
|
15
17
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/tasks/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAC,uCAAoC;AAClG,OAAO,KAAK,EAAC,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAC,+BAA4B;AAC9F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACrD,KAAK,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,QAAQ,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,CAMX;AAED,oFAAoF;AACpF,wBAAsB,WAAW,CAC/B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,CAAC,EAAE,UAAU,GAC9B,OAAO,CAAC,eAAe,CAAC,CAkC1B"}
|
|
@@ -11,7 +11,7 @@ export function setupMap(description, context, options) {
|
|
|
11
11
|
return map;
|
|
12
12
|
}
|
|
13
13
|
/** Process worker-owned storage in chunks. Failed jobs return no partial result. */
|
|
14
|
-
export async function projectBulk(input, context) {
|
|
14
|
+
export async function projectBulk(input, context, preparedProjection) {
|
|
15
15
|
const { coordinates, dimension = 2, chunkSize = 4096 } = input;
|
|
16
16
|
if (!(coordinates instanceof Float32Array || coordinates instanceof Float64Array) ||
|
|
17
17
|
!(coordinates.buffer instanceof ArrayBuffer) ||
|
|
@@ -22,8 +22,8 @@ export async function projectBulk(input, context) {
|
|
|
22
22
|
chunkSize < 1)
|
|
23
23
|
throw new Error('Expected ordinary floating-point buffers, complete records and positive chunk size');
|
|
24
24
|
context.reportProgress?.({ phase: 'projection-setup', completed: 0, total: 1, unit: 'tasks' });
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const projection = preparedProjection ??
|
|
26
|
+
new (await import("../projection/lib/projection.js")).FullProjectionEngine().createProjection(input.projection);
|
|
27
27
|
context.reportProgress?.({ phase: 'projection-setup', completed: 1, total: 1, unit: 'tasks' });
|
|
28
28
|
const total = coordinates.length / dimension;
|
|
29
29
|
context.reportProgress?.({ phase: 'bulk-projection', completed: 0, total, unit: 'records' });
|
|
@@ -36,8 +36,6 @@ export async function projectBulk(input, context) {
|
|
|
36
36
|
projection.unprojectFlatSync(chunk, dimension);
|
|
37
37
|
else
|
|
38
38
|
projection.projectFlatSync(chunk, dimension);
|
|
39
|
-
if (total <= 0x7fffffff)
|
|
40
|
-
context.sharedState?.setProgress(end, total);
|
|
41
39
|
context.reportProgress?.({ phase: 'bulk-projection', completed: end, total, unit: 'records' });
|
|
42
40
|
await new Promise(resolve => setTimeout(resolve, 0));
|
|
43
41
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/tasks/operations.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,SAAS,EAA6C,uCAAoC;AAalG,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CACtB,WAA2B,EAC3B,OAAyB,EACzB,OAA0B;IAE1B,OAAO,CAAC,cAAc,EAAE,CAAC,EAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;IACtF,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,OAAO,CAAC,cAAc,EAAE,CAAC,EAAC,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,C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EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAC;IAC3F,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,CAAC;QACtD,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,SAAS,EAAE,GAAG,GAAG,SAAS,CAAC,CAAC;QACvE,IAAI,KAAK,CAAC,OAAO;YAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;;YAC7D,UAAU,CAAC,eAAe,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAClD,OAAO,CAAC,cAAc,EAAE,CAAC,EAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAC;QAC7F,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-worker.d.ts","sourceRoot":"","sources":["../../src/tasks/projection-worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { initializeTaskWorker } from '@math.gl/core/tasks';
|
|
5
|
+
import { ProjectCoordinatesTask } from "./definitions.js";
|
|
6
|
+
void initializeTaskWorker(ProjectCoordinatesTask);
|
|
7
|
+
//# sourceMappingURL=projection-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection-worker.js","sourceRoot":"","sources":["../../src/tasks/projection-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,sBAAsB,EAAC,yBAAsB;AACrD,KAAK,oBAAoB,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TerrainFilteredLevel = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
/** Mean of valid original samples, or zero when validCounts is zero. */
|
|
5
|
+
heights: Float64Array;
|
|
6
|
+
validCounts: Uint32Array;
|
|
7
|
+
/** Original sample count represented, including missing samples. */
|
|
8
|
+
sampleCounts: Uint32Array;
|
|
9
|
+
};
|
|
10
|
+
/** Box-filter a cell raster into a weighted pyramid. Odd edges retain their true
|
|
11
|
+
* source counts. Missing data is excluded from means but remains visible in counts.
|
|
12
|
+
* These averages are not conservative collision bounds or vertex-registered meshes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createTerrainFilteredPyramid(input: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
heights: Float32Array | Float64Array;
|
|
18
|
+
validity?: Uint8Array;
|
|
19
|
+
}, options?: {
|
|
20
|
+
maxSamples?: number;
|
|
21
|
+
}): TerrainFilteredLevel[];
|
|
22
|
+
//# sourceMappingURL=filtered-pyramid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filtered-pyramid.d.ts","sourceRoot":"","sources":["../../src/terrain/filtered-pyramid.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,oEAAoE;IACpE,YAAY,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE;IACL,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC;IACrC,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB,EACD,OAAO,GAAE;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAM,GAClC,oBAAoB,EAAE,CAoExB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Box-filter a cell raster into a weighted pyramid. Odd edges retain their true
|
|
5
|
+
* source counts. Missing data is excluded from means but remains visible in counts.
|
|
6
|
+
* These averages are not conservative collision bounds or vertex-registered meshes.
|
|
7
|
+
*/
|
|
8
|
+
export function createTerrainFilteredPyramid(input, options = {}) {
|
|
9
|
+
const { width, height, heights, validity } = input;
|
|
10
|
+
const count = width * height;
|
|
11
|
+
const limit = options.maxSamples ?? 4000000;
|
|
12
|
+
if (!Number.isSafeInteger(width) ||
|
|
13
|
+
width < 1 ||
|
|
14
|
+
!Number.isSafeInteger(height) ||
|
|
15
|
+
height < 1 ||
|
|
16
|
+
!Number.isSafeInteger(count) ||
|
|
17
|
+
count > 0xffffffff ||
|
|
18
|
+
!Number.isSafeInteger(limit) ||
|
|
19
|
+
limit < count ||
|
|
20
|
+
!(heights instanceof Float32Array || heights instanceof Float64Array) ||
|
|
21
|
+
heights.length !== count ||
|
|
22
|
+
(validity !== undefined && (!(validity instanceof Uint8Array) || validity.length !== count)))
|
|
23
|
+
throw new Error('Invalid terrain filtered pyramid input or capacity');
|
|
24
|
+
const base = {
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
heights: new Float64Array(count),
|
|
28
|
+
validCounts: new Uint32Array(count),
|
|
29
|
+
sampleCounts: new Uint32Array(count).fill(1)
|
|
30
|
+
};
|
|
31
|
+
for (let i = 0; i < count; i++)
|
|
32
|
+
if ((!validity || validity[i] !== 0) && Number.isFinite(heights[i])) {
|
|
33
|
+
base.heights[i] = heights[i];
|
|
34
|
+
base.validCounts[i] = 1;
|
|
35
|
+
}
|
|
36
|
+
const levels = [base];
|
|
37
|
+
let source = base;
|
|
38
|
+
while (source.width > 1 || source.height > 1) {
|
|
39
|
+
const w = Math.ceil(source.width / 2), h = Math.ceil(source.height / 2);
|
|
40
|
+
const next = {
|
|
41
|
+
width: w,
|
|
42
|
+
height: h,
|
|
43
|
+
heights: new Float64Array(w * h),
|
|
44
|
+
validCounts: new Uint32Array(w * h),
|
|
45
|
+
sampleCounts: new Uint32Array(w * h)
|
|
46
|
+
};
|
|
47
|
+
for (let y = 0; y < h; y++)
|
|
48
|
+
for (let x = 0; x < w; x++) {
|
|
49
|
+
const out = y * w + x;
|
|
50
|
+
for (let dy = 0; dy < 2; dy++)
|
|
51
|
+
for (let dx = 0; dx < 2; dx++) {
|
|
52
|
+
const sx = x * 2 + dx, sy = y * 2 + dy;
|
|
53
|
+
if (sx >= source.width || sy >= source.height)
|
|
54
|
+
continue;
|
|
55
|
+
const index = sy * source.width + sx;
|
|
56
|
+
const n = source.validCounts[index], old = next.validCounts[out];
|
|
57
|
+
next.sampleCounts[out] += source.sampleCounts[index];
|
|
58
|
+
if (n) {
|
|
59
|
+
const total = old + n, a = next.heights[out], b = source.heights[index];
|
|
60
|
+
// Convex combination avoids overflow when values have opposite signs.
|
|
61
|
+
next.heights[out] = old ? a * (old / total) + b * (n / total) : b;
|
|
62
|
+
next.validCounts[out] = total;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
levels.push(next);
|
|
67
|
+
source = next;
|
|
68
|
+
}
|
|
69
|
+
return levels;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=filtered-pyramid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filtered-pyramid.js","sourceRoot":"","sources":["../../src/terrain/filtered-pyramid.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAY5D;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,KAKC,EACD,UAAiC,EAAE;IAEnC,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAC,GAAG,KAAK,CAAC;IACjD,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,IAAI,OAAS,CAAC;IAC9C,IACE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAC5B,KAAK,GAAG,CAAC;QACT,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;QAC7B,MAAM,GAAG,CAAC;QACV,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAC5B,KAAK,GAAG,UAAU;QAClB,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;QAC5B,KAAK,GAAG,KAAK;QACb,CAAC,CAAC,OAAO,YAAY,YAAY,IAAI,OAAO,YAAY,YAAY,CAAC;QACrE,OAAO,CAAC,MAAM,KAAK,KAAK;QACxB,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,QAAQ,YAAY,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC;QAE5F,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,MAAM,IAAI,GAAyB;QACjC,KAAK;QACL,MAAM;QACN,OAAO,EAAE,IAAI,YAAY,CAAC,KAAK,CAAC;QAChC,WAAW,EAAE,IAAI,WAAW,CAAC,K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