@loaders.gl/raster 5.0.0-beta.4 → 5.0.0-beta.6
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/README.md +1 -1
- package/dist/geotiff/advanced.cjs +4 -4
- package/dist/geotiff/geotiff-loader-types.js +1 -1
- package/dist/geotiff/geotiff-raster-loader-types.js +1 -1
- package/dist/geotiff/geotiff-source-loader.js +1 -1
- package/dist/geotiff/loaders.js +1 -1
- package/dist/geotiff/ometiff-source-loader.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lerc/lerc-loader-types.js +1 -1
- package/dist/quantized-mesh-worker.js +3684 -3505
- package/dist/terrain/heightmap.cjs +2 -333
- package/dist/terrain/heightmap.cjs.map +4 -4
- package/dist/terrain/heightmap.d.ts +1 -5
- package/dist/terrain/heightmap.d.ts.map +1 -1
- package/dist/terrain/heightmap.js +0 -3
- package/dist/terrain/heightmap.js.map +1 -1
- package/dist/terrain/index.cjs +41 -82
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +1 -2
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/lib/helpers/skirt.d.ts +2 -9
- package/dist/terrain/lib/helpers/skirt.d.ts.map +1 -1
- package/dist/terrain/lib/helpers/skirt.js +30 -114
- package/dist/terrain/lib/helpers/skirt.js.map +1 -1
- package/dist/terrain/lib/terrain-contracts.d.ts +0 -15
- package/dist/terrain/lib/terrain-contracts.d.ts.map +1 -1
- package/dist/terrain/lib/utils/version.js +1 -1
- package/dist/terrain/quantized-mesh-loader.js +1 -1
- package/dist/terrain/quantized-mesh-loader.js.map +1 -1
- package/dist/terrain/terrain-loader.js +1 -1
- package/dist/terrain/terrain-loader.js.map +1 -1
- package/dist/terrain-worker.js +788 -457
- package/package.json +5 -17
- package/src/index.ts +0 -7
- package/src/terrain/heightmap.ts +0 -10
- package/src/terrain/index.ts +0 -7
- package/src/terrain/lib/helpers/skirt.ts +41 -151
- package/src/terrain/lib/terrain-contracts.ts +0 -19
- package/src/terrain/quantized-mesh-loader.ts +1 -1
- package/src/terrain/terrain-loader.ts +1 -1
- package/dist/terrain/lib/terrain-height-field.d.ts +0 -51
- package/dist/terrain/lib/terrain-height-field.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-height-field.js +0 -260
- package/dist/terrain/lib/terrain-height-field.js.map +0 -1
- package/dist/terrain/lib/terrain-height-grid.d.ts +0 -14
- package/dist/terrain/lib/terrain-height-grid.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-height-grid.js +0 -104
- package/dist/terrain/lib/terrain-height-grid.js.map +0 -1
- package/dist/terrain/lib/terrain-neighborhood.d.ts +0 -15
- package/dist/terrain/lib/terrain-neighborhood.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-neighborhood.js +0 -58
- package/dist/terrain/lib/terrain-neighborhood.js.map +0 -1
- package/src/terrain/lib/terrain-height-field.ts +0 -355
- package/src/terrain/lib/terrain-height-grid.ts +0 -157
- package/src/terrain/lib/terrain-neighborhood.ts +0 -69
package/README.md
CHANGED
|
@@ -67,4 +67,4 @@ names, default output shapes, and writer behavior are preserved; loader `module`
|
|
|
67
67
|
## Sources and credits
|
|
68
68
|
|
|
69
69
|
See [THIRD-PARTY-NOTICES.md](./THIRD-PARTY-NOTICES.md) for implementation lineage
|
|
70
|
-
and applicable notices, and the project-wide [
|
|
70
|
+
and applicable notices, and the project-wide [Attributions and Credits](https://loaders.gl/docs/references-and-credits).
|
|
@@ -65,7 +65,7 @@ var OMETiffFormat = {
|
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
// dist/geotiff/geotiff-loader-types.js
|
|
68
|
-
var VERSION = true ? "5.0.0-beta.
|
|
68
|
+
var VERSION = true ? "5.0.0-beta.6" : "latest";
|
|
69
69
|
async function preload() {
|
|
70
70
|
const { GeoTIFFLoaderWithParser } = await import("@loaders.gl/raster/geotiff-loader");
|
|
71
71
|
return GeoTIFFLoaderWithParser;
|
|
@@ -131,7 +131,7 @@ async function openGeoTIFFSourceDecoder(source, signal) {
|
|
|
131
131
|
|
|
132
132
|
// dist/geotiff/geotiff-source-loader.js
|
|
133
133
|
var import_loader_utils = require("@loaders.gl/core/loader-utils");
|
|
134
|
-
var VERSION2 = true ? "5.0.0-beta.
|
|
134
|
+
var VERSION2 = true ? "5.0.0-beta.6" : "latest";
|
|
135
135
|
var GEOTIFF_RASTER_QUERY_CAPABILITIES = Object.freeze({
|
|
136
136
|
bounds: "pushdown",
|
|
137
137
|
level: "pushdown",
|
|
@@ -1634,7 +1634,7 @@ async function loadOmeTiff(tiff, firstImage) {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
1636
|
// dist/geotiff/ometiff-source-loader.js
|
|
1637
|
-
var VERSION3 = true ? "5.0.0-beta.
|
|
1637
|
+
var VERSION3 = true ? "5.0.0-beta.6" : "latest";
|
|
1638
1638
|
var OMETiffSourceLoader = {
|
|
1639
1639
|
dataType: null,
|
|
1640
1640
|
batchType: null,
|
|
@@ -1871,7 +1871,7 @@ async function loadGeoTiff(source, opts = {}) {
|
|
|
1871
1871
|
}
|
|
1872
1872
|
|
|
1873
1873
|
// dist/geotiff/geotiff-raster-loader-types.js
|
|
1874
|
-
var VERSION4 = true ? "5.0.0-beta.
|
|
1874
|
+
var VERSION4 = true ? "5.0.0-beta.6" : "latest";
|
|
1875
1875
|
async function preload2() {
|
|
1876
1876
|
const { GeoTIFFRasterLoaderWithParser } = await import("@loaders.gl/raster/geotiff-raster-loader");
|
|
1877
1877
|
return GeoTIFFRasterLoaderWithParser;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { GeoTIFFFormat } from "./geotiff-format.js";
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "5.0.0-beta.
|
|
7
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
8
8
|
/** Preloads the parser-bearing GeoTIFF loader implementation. */
|
|
9
9
|
async function preload() {
|
|
10
10
|
const { GeoTIFFLoaderWithParser } = await import('@loaders.gl/raster/geotiff-loader');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { GeoTIFFFormat } from "./geotiff-format.js";
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "5.0.0-beta.
|
|
7
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
8
8
|
/** Loads the optional numeric TIFF parser on first use by an asynchronous core API. */
|
|
9
9
|
async function preload() {
|
|
10
10
|
const { GeoTIFFRasterLoaderWithParser } = await import('@loaders.gl/raster/geotiff-raster-loader');
|
|
@@ -6,7 +6,7 @@ import { createTileGrid, createTileGridMatrix, DataSource, getRasterViewportBoun
|
|
|
6
6
|
import { GeoTIFFFormat } from "./geotiff-format.js";
|
|
7
7
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
8
8
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
9
|
-
const VERSION = typeof "5.0.0-beta.
|
|
9
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
10
10
|
/** Common raster-query capabilities of GeoTIFF and COG sources. */
|
|
11
11
|
export const GEOTIFF_RASTER_QUERY_CAPABILITIES = Object.freeze({
|
|
12
12
|
bounds: 'pushdown',
|
package/dist/geotiff/loaders.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { fromArrayBuffer } from 'geotiff';
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "5.0.0-beta.
|
|
7
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
8
8
|
/**
|
|
9
9
|
* Loads a GeoTIFF file containing a RGB image.
|
|
10
10
|
*/
|
|
@@ -8,7 +8,7 @@ import { ensureArray, getImageSize, intToRgba } from "./lib/utils/tiff-utils.js"
|
|
|
8
8
|
import { OMETiffFormat } from "./geotiff-format.js";
|
|
9
9
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
10
10
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
11
|
-
const VERSION = typeof "5.0.0-beta.
|
|
11
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
12
12
|
/**
|
|
13
13
|
* Source factory for non-geospatial OME-TIFF plane data.
|
|
14
14
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ var OMETiffFormat = {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// dist/geotiff/geotiff-loader-types.js
|
|
71
|
-
var VERSION = true ? "5.0.0-beta.
|
|
71
|
+
var VERSION = true ? "5.0.0-beta.6" : "latest";
|
|
72
72
|
async function preload() {
|
|
73
73
|
const { GeoTIFFLoaderWithParser } = await import("@loaders.gl/raster/geotiff-loader");
|
|
74
74
|
return GeoTIFFLoaderWithParser;
|
|
@@ -87,7 +87,7 @@ var GeoTIFFLoader = {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
// dist/geotiff/geotiff-raster-loader-types.js
|
|
90
|
-
var VERSION2 = true ? "5.0.0-beta.
|
|
90
|
+
var VERSION2 = true ? "5.0.0-beta.6" : "latest";
|
|
91
91
|
async function preload2() {
|
|
92
92
|
const { GeoTIFFRasterLoaderWithParser } = await import("@loaders.gl/raster/geotiff-raster-loader");
|
|
93
93
|
return GeoTIFFRasterLoaderWithParser;
|
|
@@ -116,7 +116,7 @@ var LERCFormat = {
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
// dist/lerc/lerc-loader-types.js
|
|
119
|
-
var VERSION3 = true ? "5.0.0-beta.
|
|
119
|
+
var VERSION3 = true ? "5.0.0-beta.6" : "latest";
|
|
120
120
|
async function preload3() {
|
|
121
121
|
const { LERCLoaderWithParser } = await import("@loaders.gl/raster/lerc-loader");
|
|
122
122
|
return LERCLoaderWithParser;
|
|
@@ -140,7 +140,7 @@ var LERCLoader = {
|
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
// dist/terrain/lib/utils/version.js
|
|
143
|
-
var VERSION4 = true ? "5.0.0-beta.
|
|
143
|
+
var VERSION4 = true ? "5.0.0-beta.6" : "latest";
|
|
144
144
|
|
|
145
145
|
// dist/terrain/terrain-format.js
|
|
146
146
|
var TerrainFormat = {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/geotiff/geotiff-format.ts", "../src/geotiff/geotiff-loader-types.ts", "../src/geotiff/geotiff-raster-loader-types.ts", "../src/lerc/lerc-format.ts", "../src/lerc/lerc-loader-types.ts", "../src/terrain/lib/utils/version.ts", "../src/terrain/terrain-format.ts", "../src/terrain/terrain-loader-types.ts", "../src/terrain/quantized-mesh-loader-types.ts", "../src/terrain/quantized-mesh-writer.ts", "../src/geotiff/geotiff-source-loader-types.ts", "../src/geotiff/ometiff-source-loader-types.ts"],
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {GeoTIFFLoader} from './geotiff/geotiff-loader-types';\nexport type {GeoTIFFLoaderOptions} from './geotiff/geotiff-loader-types';\nexport {GeoTIFFRasterLoader} from './geotiff/geotiff-raster-loader-types';\nexport type {\n GeoTIFFRasterData,\n GeoTIFFRasterImage,\n GeoTIFFRasterBand,\n GeoTIFFRasterLoaderOptions\n} from './geotiff/geotiff-raster-types';\nexport {GeoTIFFFormat, OMETiffFormat} from './geotiff/geotiff-format';\nexport {LERCLoader} from './lerc/lerc-loader-types';\nexport type {LERCLoaderOptions} from './lerc/lerc-loader-types';\nexport {LERCFormat} from './lerc/lerc-format';\nexport type {LERCData} from './lerc/lib/parsers/lerc/lerc-types';\nexport {TerrainLoader} from './terrain/terrain-loader-types';\n/** @deprecated Use TerrainLoader. */\nexport {TerrainLoader as TerrainWorkerLoader} from './terrain/terrain-loader-types';\nexport type {TerrainLoaderOptions} from './terrain/terrain-loader-types';\nexport {QuantizedMeshLoader} from './terrain/quantized-mesh-loader-types';\n/** @deprecated Use QuantizedMeshLoader. */\nexport {QuantizedMeshLoader as QuantizedMeshWorkerLoader} from './terrain/quantized-mesh-loader-types';\nexport type {QuantizedMeshLoaderOptions} from './terrain/quantized-mesh-loader-types';\nexport {TerrainFormat, QuantizedMeshFormat} from './terrain/terrain-format';\nexport {QuantizedMeshWriter} from './terrain/quantized-mesh-writer';\nexport type {QuantizedMeshWriterOptions} from './terrain/quantized-mesh-writer';\nexport type {\n ElevationDecoder,\n TerrainHeightmap,\n TerrainHeightmapImage\n} from './terrain/lib/terrain-heightmap-types';\nexport type {\n TerrainGridMetadata,\n TerrainHeightGrid,\n TerrainRay,\n TerrainSurfaceHit,\n TerrainSurfaceBounds,\n TerrainSurface\n} from './terrain/lib/terrain-contracts';\nexport {GeoTIFFSourceLoader} from './geotiff/geotiff-source-loader-types';\nexport {OMETiffSourceLoader} from './geotiff/ometiff-source-loader-types';\nexport type {GeoTIFFSourceLoaderOptions} from './geotiff/geotiff-source-loader';\nexport type {OMETiffSourceLoaderOptions} from './geotiff/ometiff-source-loader';\nexport type {\n TerrainFieldBounds,\n TerrainHeightFieldOptions,\n TerrainHeightFieldStatistics\n} from './terrain/lib/terrain-height-field';\nexport type {\n GetOMETiffParameters,\n OMETiffChannelMetadata,\n OMETiffLevelMetadata,\n OMETiffSourceLoaderMetadata\n} from './geotiff/ometiff-source-loader';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\n/** GeoTIFF raster image format. */\nexport const GeoTIFFFormat = {\n id: 'geotiff',\n name: 'GeoTIFF',\n module: 'raster',\n encoding: 'image',\n format: 'geotiff',\n mimeTypes: ['image/tiff'],\n extensions: ['geotiff', 'tiff', 'geotif', 'tif']\n} as const satisfies Format;\n\n/** OME-TIFF raster image format. */\nexport const OMETiffFormat = {\n name: 'OME-TIFF',\n id: 'ometiff',\n module: 'raster',\n encoding: 'image',\n format: 'ome-tiff',\n extensions: ['ome.tif', 'ome.tiff'],\n mimeTypes: ['image/tiff', 'image/geotiff']\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray, Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {CRSIdentifier} from '@math.gl/geospatial/crs';\nimport {GeoTIFFFormat} from './geotiff-format';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Return type definition for GeoTIFF loader\ntype GeoTIFFData = {\n crs?: CRSIdentifier;\n bounds: number[];\n metadata: Record<string, unknown>;\n\n width: number;\n height: number;\n data: TypedArray;\n};\n\n/** GeoTIFF load options */\nexport type GeoTIFFLoaderOptions = LoaderOptions & {\n geotiff?: {\n enableAlpha: boolean;\n };\n};\n\n/** Preloads the parser-bearing GeoTIFF loader implementation. */\nasync function preload() {\n const {GeoTIFFLoaderWithParser} = await import('@loaders.gl/raster/geotiff-loader');\n return GeoTIFFLoaderWithParser;\n}\n\n/** Metadata-only GeoTIFF loader. */\nexport const GeoTIFFLoader = {\n dataType: null as unknown as GeoTIFFData,\n batchType: null as never,\n\n ...GeoTIFFFormat,\n version: VERSION,\n options: {\n geotiff: {\n enableAlpha: true\n }\n },\n preload\n} as const satisfies Loader<GeoTIFFData, never, GeoTIFFLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader} from '@loaders.gl/core/loader-utils';\nimport {GeoTIFFFormat} from './geotiff-format';\nimport type {GeoTIFFRasterData, GeoTIFFRasterLoaderOptions} from './geotiff-raster-types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Loads the optional numeric TIFF parser on first use by an asynchronous core API. */\nasync function preload() {\n const {GeoTIFFRasterLoaderWithParser} = await import('@loaders.gl/raster/geotiff-raster-loader');\n return GeoTIFFRasterLoaderWithParser;\n}\n\n/** Metadata-only loader for original numeric TIFF bands and geospatial metadata. */\nexport const GeoTIFFRasterLoader = {\n ...GeoTIFFFormat,\n id: 'geotiff-raster',\n name: 'GeoTIFF Raster',\n version: VERSION,\n dataType: null as unknown as GeoTIFFRasterData,\n batchType: null as never,\n options: {geotiff: {}},\n preload\n} as const satisfies Loader<GeoTIFFRasterData, never, GeoTIFFRasterLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\nexport const LERCFormat = {\n name: 'LERC',\n id: 'lerc',\n module: 'raster',\n encoding: 'binary',\n format: 'lerc',\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n binary: true\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {LERCData} from './lib/parsers/lerc/lerc-types';\n\nimport {LERCFormat} from './lerc-format';\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** LERC loader options */\nexport type LERCLoaderOptions = LoaderOptions & {\n /** LERC loader options */\n lerc?: {\n /**\tThe number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */\n inputOffset?: number;\n /**\tIt is recommended to use the returned mask instead of setting this value. */\n noDataValue?: number;\n /**\t(ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */\n returnInterleaved?: boolean;\n };\n};\n\n/** Preloads the parser-bearing LERC loader implementation. */\nasync function preload() {\n const {LERCLoaderWithParser} = await import('@loaders.gl/raster/lerc-loader');\n return LERCLoaderWithParser;\n}\n\n/** Metadata-only loader for the LERC raster format. */\nexport const LERCLoader = {\n ...LERCFormat,\n dataType: null as unknown as LERCData,\n batchType: null as never,\n\n id: 'lerc',\n name: 'LERC',\n\n module: 'raster',\n version: VERSION,\n worker: false,\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n // test: ?,\n options: {\n lerc: {}\n },\n preload\n} as const satisfies Loader<LERCData, never, LERCLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\n/** Image-encoded terrain format. */\nexport const TerrainFormat = {\n name: 'Terrain',\n id: 'terrain',\n module: 'raster',\n encoding: 'image',\n format: 'terrain',\n extensions: ['png', 'pngraw', 'jpg', 'jpeg', 'gif', 'webp', 'bmp'],\n mimeTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/bmp']\n} as const satisfies Format;\n\n/** Quantized mesh terrain format. */\nexport const QuantizedMeshFormat = {\n name: 'Quantized Mesh',\n id: 'quantized-mesh',\n module: 'raster',\n encoding: 'binary',\n format: 'quantized-mesh',\n extensions: ['terrain'],\n mimeTypes: ['application/vnd.quantized-mesh'],\n binary: true\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';\nimport type {ImageLoaderOptions} from '@loaders.gl/images';\nimport {VERSION} from './lib/utils/version';\n\nimport type {TerrainOptions} from './lib/parse-terrain';\nimport {TerrainFormat} from './terrain-format';\n\n/** TerrainLoader options */\nexport type TerrainLoaderOptions = ImageLoaderOptions & {\n /** TerrainLoader options */\n terrain?: TerrainOptions & {\n /** Selects mesh output or Apache Arrow output. */\n shape?: 'mesh' | 'arrow-table';\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for image encoded terrain\n */\nexport const TerrainLoader = {\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n\n ...TerrainFormat,\n version: VERSION,\n worker: true,\n /** Loads the parser-bearing terrain loader implementation. */\n preload: async () => (await import('@loaders.gl/raster/terrain-loader')).TerrainLoaderWithParser,\n options: {\n terrain: {\n tesselator: 'auto',\n shape: 'arrow-table',\n bounds: undefined!,\n meshMaxError: 10,\n elevationDecoder: {\n rScaler: 1,\n gScaler: 0,\n bScaler: 0,\n offset: 0\n },\n skirtHeight: undefined\n }\n }\n} as const satisfies Loader<Mesh | MeshArrowTable, never, TerrainLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';\nimport {VERSION} from './lib/utils/version';\nimport {QuantizedMeshFormat} from './terrain-format';\n\n/** QuantizedMeshLoader options */\nexport type QuantizedMeshLoaderOptions = LoaderOptions & {\n /** QuantizedMeshLoader options */\n 'quantized-mesh'?: {\n /** Selects mesh output or Apache Arrow output. */\n shape?: 'mesh' | 'arrow-table';\n bounds?: [number, number, number, number];\n skirtHeight?: number | null;\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for quantized meshes\n */\nexport const QuantizedMeshLoader = {\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n\n ...QuantizedMeshFormat,\n version: VERSION,\n worker: true,\n /** Loads the parser-bearing quantized mesh loader implementation. */\n preload: async () =>\n (await import('@loaders.gl/raster/quantized-mesh-loader')).QuantizedMeshLoaderWithParser,\n options: {\n 'quantized-mesh': {\n shape: 'arrow-table',\n bounds: [0, 0, 1, 1],\n skirtHeight: null\n }\n }\n} as const satisfies Loader<Mesh | MeshArrowTable, never, QuantizedMeshLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {WriterOptions, WriterWithEncoder} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable, MeshAttribute} from '@loaders.gl/core/schema';\nimport {convertMeshToTable, convertTableToMesh} from '@loaders.gl/core/schema-utils';\nimport {VERSION} from './lib/utils/version';\nimport {QuantizedMeshFormat} from './terrain-format';\n\nconst QUANTIZED_MESH_HEADER_LENGTH = 88;\nconst QUANTIZED_COORDINATE_RANGE = 32767;\nconst EMPTY_EDGE_INDICES_LENGTH = Uint32Array.BYTES_PER_ELEMENT * 4;\n\n/** Options for `QuantizedMeshWriter`. */\nexport type QuantizedMeshWriterOptions = WriterOptions & {\n /** Quantized mesh-specific writer options. */\n 'quantized-mesh'?: {\n /** Bounds used to map x/y positions to quantized u/v coordinates. */\n bounds?: [number, number, number, number];\n };\n};\n\n/**\n * Writer for the quantized mesh terrain format.\n */\nexport const QuantizedMeshWriter = {\n ...QuantizedMeshFormat,\n version: VERSION,\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n options: {\n 'quantized-mesh': {}\n },\n encode: async (data, options) => encodeQuantizedMeshSync(data, options),\n encodeSync: encodeQuantizedMeshSync\n} as const satisfies WriterWithEncoder<Mesh | MeshArrowTable, never, QuantizedMeshWriterOptions>;\n\n/** Encode mesh category data as quantized mesh terrain bytes. */\nfunction encodeQuantizedMeshSync(\n data: Mesh | MeshArrowTable,\n options: QuantizedMeshWriterOptions = {}\n): ArrayBuffer {\n const mesh = convertTableToMesh(normalizeMeshArrowTable(data));\n const positionAttribute = getRequiredAttribute(mesh, 'POSITION');\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n const boundingBox = getBoundingBox(positionAttribute, vertexCount);\n const bounds = options['quantized-mesh']?.bounds || [\n boundingBox[0][0],\n boundingBox[0][1],\n boundingBox[1][0],\n boundingBox[1][1]\n ];\n const triangleIndices = getTriangleIndices(mesh, vertexCount);\n const highWatermarkMesh = reorderMeshForHighWatermark(triangleIndices, vertexCount);\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n const vertexDataLength =\n Uint32Array.BYTES_PER_ELEMENT + vertexCount * 3 * Uint16Array.BYTES_PER_ELEMENT;\n const triangleDataOffset = getAlignedOffset(\n QUANTIZED_MESH_HEADER_LENGTH + vertexDataLength,\n bytesPerIndex\n );\n const triangleDataLength = Uint32Array.BYTES_PER_ELEMENT + triangleIndices.length * bytesPerIndex;\n const arrayBuffer = new ArrayBuffer(\n triangleDataOffset + triangleDataLength + EMPTY_EDGE_INDICES_LENGTH\n );\n const dataView = new DataView(arrayBuffer);\n\n writeHeader(dataView, boundingBox);\n dataView.setUint32(QUANTIZED_MESH_HEADER_LENGTH, vertexCount, true);\n writeVertexData(dataView, QUANTIZED_MESH_HEADER_LENGTH + Uint32Array.BYTES_PER_ELEMENT, {\n positionAttribute,\n vertexCount,\n boundingBox,\n bounds,\n sourceVertexIndices: highWatermarkMesh.sourceVertexIndices\n });\n writeTriangleIndices(\n dataView,\n triangleDataOffset,\n highWatermarkMesh.triangleIndices,\n bytesPerIndex\n );\n writeEmptyEdgeIndices(dataView, triangleDataOffset + triangleDataLength);\n\n return arrayBuffer;\n}\n\n/** Return mesh data as a MeshArrowTable, converting plain Mesh data first. */\nfunction normalizeMeshArrowTable(data: Mesh | MeshArrowTable): MeshArrowTable {\n if ('shape' in data && data.shape === 'arrow-table') {\n return data;\n }\n return convertMeshToTable(data as Mesh, 'arrow-table');\n}\n\n/** Return a required mesh attribute or throw a format-specific error. */\nfunction getRequiredAttribute(mesh: Mesh, attributeName: string): MeshAttribute {\n const attribute = mesh.attributes[attributeName];\n if (!attribute) {\n throw new Error(`QuantizedMeshWriter: ${attributeName} attribute is required`);\n }\n return attribute;\n}\n\n/** Write the fixed-length quantized mesh header. */\nfunction writeHeader(\n dataView: DataView,\n boundingBox: [[number, number, number], [number, number, number]]\n): void {\n const center = getCenter(boundingBox);\n const radius = getRadius(boundingBox, center);\n let byteOffset = 0;\n\n for (const value of center) {\n dataView.setFloat64(byteOffset, value, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n }\n\n dataView.setFloat32(byteOffset, boundingBox[0][2], true);\n byteOffset += Float32Array.BYTES_PER_ELEMENT;\n dataView.setFloat32(byteOffset, boundingBox[1][2], true);\n byteOffset += Float32Array.BYTES_PER_ELEMENT;\n\n for (const value of center) {\n dataView.setFloat64(byteOffset, value, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n }\n dataView.setFloat64(byteOffset, radius, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n\n dataView.setFloat64(byteOffset, 0, true);\n dataView.setFloat64(byteOffset + 8, 0, true);\n dataView.setFloat64(byteOffset + 16, 0, true);\n}\n\n/** Write delta and zig-zag encoded u, v, and height vertex arrays. */\nfunction writeVertexData(\n dataView: DataView,\n byteOffset: number,\n parameters: {\n positionAttribute: MeshAttribute;\n vertexCount: number;\n boundingBox: [[number, number, number], [number, number, number]];\n bounds: [number, number, number, number];\n sourceVertexIndices: number[];\n }\n): void {\n const quantizedCoordinates = getQuantizedCoordinates(parameters);\n const arrayByteLength = parameters.vertexCount * Uint16Array.BYTES_PER_ELEMENT;\n\n writeDeltaEncodedArray(dataView, byteOffset, quantizedCoordinates.u);\n writeDeltaEncodedArray(dataView, byteOffset + arrayByteLength, quantizedCoordinates.v);\n writeDeltaEncodedArray(dataView, byteOffset + arrayByteLength * 2, quantizedCoordinates.height);\n}\n\n/** Return quantized u, v, and height arrays from positions. */\nfunction getQuantizedCoordinates(parameters: {\n positionAttribute: MeshAttribute;\n vertexCount: number;\n boundingBox: [[number, number, number], [number, number, number]];\n bounds: [number, number, number, number];\n sourceVertexIndices: number[];\n}): {u: Uint16Array; v: Uint16Array; height: Uint16Array} {\n const [minimumX, minimumY, maximumX, maximumY] = parameters.bounds;\n const heightMinimum = parameters.boundingBox[0][2];\n const heightMaximum = parameters.boundingBox[1][2];\n const u = new Uint16Array(parameters.vertexCount);\n const v = new Uint16Array(parameters.vertexCount);\n const height = new Uint16Array(parameters.vertexCount);\n\n for (let vertexIndex = 0; vertexIndex < parameters.vertexCount; vertexIndex++) {\n const sourceVertexIndex = parameters.sourceVertexIndices[vertexIndex];\n u[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 0),\n minimumX,\n maximumX\n );\n v[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 1),\n minimumY,\n maximumY\n );\n height[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 2),\n heightMinimum,\n heightMaximum\n );\n }\n\n return {u, v, height};\n}\n\n/** Write a delta and zig-zag encoded Uint16 array. */\nfunction writeDeltaEncodedArray(dataView: DataView, byteOffset: number, values: Uint16Array): void {\n let previousValue = 0;\n for (let valueIndex = 0; valueIndex < values.length; valueIndex++) {\n const value = values[valueIndex];\n const delta = value - previousValue;\n dataView.setUint16(\n byteOffset + valueIndex * Uint16Array.BYTES_PER_ELEMENT,\n encodeZigZag(delta),\n true\n );\n previousValue = value;\n }\n}\n\n/** Write high-watermark encoded triangle indices. */\nfunction writeTriangleIndices(\n dataView: DataView,\n byteOffset: number,\n triangleIndices: number[],\n bytesPerIndex: number\n): void {\n dataView.setUint32(byteOffset, triangleIndices.length / 3, true);\n let highestIndex = 0;\n let indexByteOffset = byteOffset + Uint32Array.BYTES_PER_ELEMENT;\n\n for (const triangleIndex of triangleIndices) {\n const code = highestIndex - triangleIndex;\n if (code < 0) {\n throw new Error('QuantizedMeshWriter: triangle indices must be high-watermark encodable');\n }\n\n if (bytesPerIndex === Uint16Array.BYTES_PER_ELEMENT) {\n dataView.setUint16(indexByteOffset, code, true);\n } else {\n dataView.setUint32(indexByteOffset, code, true);\n }\n\n if (code === 0) {\n highestIndex++;\n }\n indexByteOffset += bytesPerIndex;\n }\n}\n\n/** Write empty west, south, east, and north edge-index lists. */\nfunction writeEmptyEdgeIndices(dataView: DataView, byteOffset: number): void {\n dataView.setUint32(byteOffset, 0, true);\n dataView.setUint32(byteOffset + 4, 0, true);\n dataView.setUint32(byteOffset + 8, 0, true);\n dataView.setUint32(byteOffset + 12, 0, true);\n}\n\n/** Return triangle indices for indexed or sequential triangle-list meshes. */\nfunction getTriangleIndices(mesh: Mesh, vertexCount: number): number[] {\n if (mesh.indices?.value?.length) {\n return Array.from(mesh.indices.value);\n }\n\n if (mesh.mode !== 4 && mesh.topology !== 'triangle-list') {\n throw new Error('QuantizedMeshWriter: triangle-list mesh data is required');\n }\n\n const triangleIndices: number[] = [];\n for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {\n triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n }\n return triangleIndices;\n}\n\n/** Return vertices and indices reordered into first-reference order for high-watermark encoding. */\nfunction reorderMeshForHighWatermark(\n triangleIndices: number[],\n vertexCount: number\n): {triangleIndices: number[]; sourceVertexIndices: number[]} {\n const remappedVertexIndices = new Map<number, number>();\n const sourceVertexIndices: number[] = [];\n const remappedTriangleIndices = triangleIndices.map(triangleIndex => {\n if (!Number.isInteger(triangleIndex) || triangleIndex < 0 || triangleIndex >= vertexCount) {\n throw new Error('QuantizedMeshWriter: triangle index is out of range');\n }\n\n const existingIndex = remappedVertexIndices.get(triangleIndex);\n if (existingIndex !== undefined) {\n return existingIndex;\n }\n\n const nextIndex = sourceVertexIndices.length;\n remappedVertexIndices.set(triangleIndex, nextIndex);\n sourceVertexIndices.push(triangleIndex);\n return nextIndex;\n });\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n if (!remappedVertexIndices.has(vertexIndex)) {\n sourceVertexIndices.push(vertexIndex);\n }\n }\n\n return {triangleIndices: remappedTriangleIndices, sourceVertexIndices};\n}\n\n/** Return an aligned byte offset. */\nfunction getAlignedOffset(byteOffset: number, byteAlignment: number): number {\n const remainder = byteOffset % byteAlignment;\n return remainder === 0 ? byteOffset : byteOffset + byteAlignment - remainder;\n}\n\n/** Return a single attribute component with 0 as the missing component fallback. */\nfunction getComponent(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;\n}\n\n/** Compute a bounding box from position data. */\nfunction getBoundingBox(\n positionAttribute: MeshAttribute,\n vertexCount: number\n): [[number, number, number], [number, number, number]] {\n const minimum: [number, number, number] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY\n ];\n const maximum: [number, number, number] = [\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY\n ];\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n for (let componentIndex = 0; componentIndex < 3; componentIndex++) {\n const value = getComponent(positionAttribute, vertexIndex, componentIndex);\n minimum[componentIndex] = Math.min(minimum[componentIndex], value);\n maximum[componentIndex] = Math.max(maximum[componentIndex], value);\n }\n }\n\n return [minimum, maximum];\n}\n\n/** Return the center of a bounding box. */\nfunction getCenter(\n boundingBox: [[number, number, number], [number, number, number]]\n): [number, number, number] {\n return [\n (boundingBox[0][0] + boundingBox[1][0]) / 2,\n (boundingBox[0][1] + boundingBox[1][1]) / 2,\n (boundingBox[0][2] + boundingBox[1][2]) / 2\n ];\n}\n\n/** Return a bounding sphere radius that contains the bounding box. */\nfunction getRadius(\n boundingBox: [[number, number, number], [number, number, number]],\n center: [number, number, number]\n): number {\n const xDistance = Math.max(\n Math.abs(boundingBox[0][0] - center[0]),\n Math.abs(boundingBox[1][0] - center[0])\n );\n const yDistance = Math.max(\n Math.abs(boundingBox[0][1] - center[1]),\n Math.abs(boundingBox[1][1] - center[1])\n );\n const zDistance = Math.max(\n Math.abs(boundingBox[0][2] - center[2]),\n Math.abs(boundingBox[1][2] - center[2])\n );\n return Math.hypot(xDistance, yDistance, zDistance);\n}\n\n/** Quantize a value into the terrain coordinate range. */\nfunction quantize(value: number, minimum: number, maximum: number): number {\n const range = maximum - minimum || 1;\n const quantizedValue = Math.round(((value - minimum) / range) * QUANTIZED_COORDINATE_RANGE);\n return Math.max(0, Math.min(QUANTIZED_COORDINATE_RANGE, quantizedValue));\n}\n\n/** Zig-zag encode a signed delta. */\nfunction encodeZigZag(value: number): number {\n return (value << 1) ^ (value >> 31);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {SourceLoader} from '@loaders.gl/core/loader-utils';\nimport type {GeoTIFFRasterSource, GeoTIFFSourceLoaderOptions} from './geotiff-source-loader';\nimport {GeoTIFFFormat} from './geotiff-format';\nimport {GeoTIFFLoader} from './geotiff-loader-types';\n\n/** Metadata-only GeoTIFF source loader. */\nexport const GeoTIFFSourceLoader = {\n dataType: null as unknown as GeoTIFFRasterSource,\n batchType: null as never,\n ...GeoTIFFFormat,\n name: 'GeoTIFFSourceLoader',\n version: GeoTIFFLoader.version,\n type: 'geotiff',\n fromUrl: true,\n fromBlob: true,\n\n options: {\n geotiff: {\n headers: undefined!,\n interleaved: false,\n resampleMethod: 'nearest'\n }\n },\n\n defaultOptions: {\n geotiff: {\n headers: undefined!,\n interleaved: false,\n resampleMethod: 'nearest'\n }\n },\n\n testURL: (url: string): boolean => {\n if (/\\.ome\\.tiff?(?:$|[?#])/i.test(url)) {\n return false;\n }\n return /\\.(?:geotiff?|tiff?)(?:$|[?#])/i.test(url);\n },\n /** Loads the implementation for asynchronous source construction. */\n preload: async () =>\n (await import('@loaders.gl/raster/geotiff-source-loader')).GeoTIFFSourceLoader,\n /** Synchronous construction requires the source implementation subpath. */\n createDataSource(\n _data: string | Blob,\n _options: GeoTIFFSourceLoaderOptions\n ): GeoTIFFRasterSource {\n throw new Error(\n 'GeoTIFFSourceLoader requires async load() or its source implementation subpath'\n );\n }\n} as const satisfies SourceLoader<GeoTIFFRasterSource>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {SourceLoader} from '@loaders.gl/core/loader-utils';\nimport type {OMETiffImageSource, OMETiffSourceLoaderOptions} from './ometiff-source-loader';\nimport {OMETiffFormat} from './geotiff-format';\nimport {GeoTIFFLoader} from './geotiff-loader-types';\n\n/** Metadata-only OMETiff source loader. */\nexport const OMETiffSourceLoader = {\n dataType: null as unknown as OMETiffImageSource,\n batchType: null as never,\n ...OMETiffFormat,\n name: 'OMETiffSourceLoader',\n version: GeoTIFFLoader.version,\n type: 'ometiff',\n fromUrl: true,\n fromBlob: true,\n\n options: {\n ometiff: {\n headers: undefined!,\n interleaved: false,\n defaultChannels: undefined!\n }\n },\n\n defaultOptions: {\n ometiff: {\n headers: undefined!,\n interleaved: false,\n defaultChannels: undefined!\n }\n },\n\n testURL: (url: string): boolean => /\\.ome\\.tiff?(?:$|[?#])/i.test(url),\n /** Loads the implementation for asynchronous source construction. */\n preload: async () =>\n (await import('@loaders.gl/raster/ometiff-source-loader')).OMETiffSourceLoader,\n /** Synchronous construction requires the source implementation subpath. */\n createDataSource(_data: string | Blob, _options: OMETiffSourceLoaderOptions): OMETiffImageSource {\n throw new Error(\n 'OMETiffSourceLoader requires async load() or its source implementation subpath'\n );\n }\n} as const satisfies SourceLoader<OMETiffImageSource>;\n"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {GeoTIFFLoader} from './geotiff/geotiff-loader-types';\nexport type {GeoTIFFLoaderOptions} from './geotiff/geotiff-loader-types';\nexport {GeoTIFFRasterLoader} from './geotiff/geotiff-raster-loader-types';\nexport type {\n GeoTIFFRasterData,\n GeoTIFFRasterImage,\n GeoTIFFRasterBand,\n GeoTIFFRasterLoaderOptions\n} from './geotiff/geotiff-raster-types';\nexport {GeoTIFFFormat, OMETiffFormat} from './geotiff/geotiff-format';\nexport {LERCLoader} from './lerc/lerc-loader-types';\nexport type {LERCLoaderOptions} from './lerc/lerc-loader-types';\nexport {LERCFormat} from './lerc/lerc-format';\nexport type {LERCData} from './lerc/lib/parsers/lerc/lerc-types';\nexport {TerrainLoader} from './terrain/terrain-loader-types';\n/** @deprecated Use TerrainLoader. */\nexport {TerrainLoader as TerrainWorkerLoader} from './terrain/terrain-loader-types';\nexport type {TerrainLoaderOptions} from './terrain/terrain-loader-types';\nexport {QuantizedMeshLoader} from './terrain/quantized-mesh-loader-types';\n/** @deprecated Use QuantizedMeshLoader. */\nexport {QuantizedMeshLoader as QuantizedMeshWorkerLoader} from './terrain/quantized-mesh-loader-types';\nexport type {QuantizedMeshLoaderOptions} from './terrain/quantized-mesh-loader-types';\nexport {TerrainFormat, QuantizedMeshFormat} from './terrain/terrain-format';\nexport {QuantizedMeshWriter} from './terrain/quantized-mesh-writer';\nexport type {QuantizedMeshWriterOptions} from './terrain/quantized-mesh-writer';\nexport type {\n ElevationDecoder,\n TerrainHeightmap,\n TerrainHeightmapImage\n} from './terrain/lib/terrain-heightmap-types';\nexport type {\n TerrainRay,\n TerrainSurfaceHit,\n TerrainSurfaceBounds,\n TerrainSurface\n} from './terrain/lib/terrain-contracts';\nexport {GeoTIFFSourceLoader} from './geotiff/geotiff-source-loader-types';\nexport {OMETiffSourceLoader} from './geotiff/ometiff-source-loader-types';\nexport type {GeoTIFFSourceLoaderOptions} from './geotiff/geotiff-source-loader';\nexport type {OMETiffSourceLoaderOptions} from './geotiff/ometiff-source-loader';\nexport type {\n GetOMETiffParameters,\n OMETiffChannelMetadata,\n OMETiffLevelMetadata,\n OMETiffSourceLoaderMetadata\n} from './geotiff/ometiff-source-loader';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\n/** GeoTIFF raster image format. */\nexport const GeoTIFFFormat = {\n id: 'geotiff',\n name: 'GeoTIFF',\n module: 'raster',\n encoding: 'image',\n format: 'geotiff',\n mimeTypes: ['image/tiff'],\n extensions: ['geotiff', 'tiff', 'geotif', 'tif']\n} as const satisfies Format;\n\n/** OME-TIFF raster image format. */\nexport const OMETiffFormat = {\n name: 'OME-TIFF',\n id: 'ometiff',\n module: 'raster',\n encoding: 'image',\n format: 'ome-tiff',\n extensions: ['ome.tif', 'ome.tiff'],\n mimeTypes: ['image/tiff', 'image/geotiff']\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray, Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {CRSIdentifier} from '@math.gl/geospatial/crs';\nimport {GeoTIFFFormat} from './geotiff-format';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n// Return type definition for GeoTIFF loader\ntype GeoTIFFData = {\n crs?: CRSIdentifier;\n bounds: number[];\n metadata: Record<string, unknown>;\n\n width: number;\n height: number;\n data: TypedArray;\n};\n\n/** GeoTIFF load options */\nexport type GeoTIFFLoaderOptions = LoaderOptions & {\n geotiff?: {\n enableAlpha: boolean;\n };\n};\n\n/** Preloads the parser-bearing GeoTIFF loader implementation. */\nasync function preload() {\n const {GeoTIFFLoaderWithParser} = await import('@loaders.gl/raster/geotiff-loader');\n return GeoTIFFLoaderWithParser;\n}\n\n/** Metadata-only GeoTIFF loader. */\nexport const GeoTIFFLoader = {\n dataType: null as unknown as GeoTIFFData,\n batchType: null as never,\n\n ...GeoTIFFFormat,\n version: VERSION,\n options: {\n geotiff: {\n enableAlpha: true\n }\n },\n preload\n} as const satisfies Loader<GeoTIFFData, never, GeoTIFFLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader} from '@loaders.gl/core/loader-utils';\nimport {GeoTIFFFormat} from './geotiff-format';\nimport type {GeoTIFFRasterData, GeoTIFFRasterLoaderOptions} from './geotiff-raster-types';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Loads the optional numeric TIFF parser on first use by an asynchronous core API. */\nasync function preload() {\n const {GeoTIFFRasterLoaderWithParser} = await import('@loaders.gl/raster/geotiff-raster-loader');\n return GeoTIFFRasterLoaderWithParser;\n}\n\n/** Metadata-only loader for original numeric TIFF bands and geospatial metadata. */\nexport const GeoTIFFRasterLoader = {\n ...GeoTIFFFormat,\n id: 'geotiff-raster',\n name: 'GeoTIFF Raster',\n version: VERSION,\n dataType: null as unknown as GeoTIFFRasterData,\n batchType: null as never,\n options: {geotiff: {}},\n preload\n} as const satisfies Loader<GeoTIFFRasterData, never, GeoTIFFRasterLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\nexport const LERCFormat = {\n name: 'LERC',\n id: 'lerc',\n module: 'raster',\n encoding: 'binary',\n format: 'lerc',\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n binary: true\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {LERCData} from './lib/parsers/lerc/lerc-types';\n\nimport {LERCFormat} from './lerc-format';\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** LERC loader options */\nexport type LERCLoaderOptions = LoaderOptions & {\n /** LERC loader options */\n lerc?: {\n /**\tThe number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position. */\n inputOffset?: number;\n /**\tIt is recommended to use the returned mask instead of setting this value. */\n noDataValue?: number;\n /**\t(ndepth LERC2 only) If true, returned depth values are pixel-interleaved. */\n returnInterleaved?: boolean;\n };\n};\n\n/** Preloads the parser-bearing LERC loader implementation. */\nasync function preload() {\n const {LERCLoaderWithParser} = await import('@loaders.gl/raster/lerc-loader');\n return LERCLoaderWithParser;\n}\n\n/** Metadata-only loader for the LERC raster format. */\nexport const LERCLoader = {\n ...LERCFormat,\n dataType: null as unknown as LERCData,\n batchType: null as never,\n\n id: 'lerc',\n name: 'LERC',\n\n module: 'raster',\n version: VERSION,\n worker: false,\n extensions: ['lrc', 'lerc', 'lerc2', 'lerc1'],\n mimeTypes: ['application/octet-stream'],\n // test: ?,\n options: {\n lerc: {}\n },\n preload\n} as const satisfies Loader<LERCData, never, LERCLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Format} from '@loaders.gl/core/loader-utils';\n\n/** Image-encoded terrain format. */\nexport const TerrainFormat = {\n name: 'Terrain',\n id: 'terrain',\n module: 'raster',\n encoding: 'image',\n format: 'terrain',\n extensions: ['png', 'pngraw', 'jpg', 'jpeg', 'gif', 'webp', 'bmp'],\n mimeTypes: ['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/bmp']\n} as const satisfies Format;\n\n/** Quantized mesh terrain format. */\nexport const QuantizedMeshFormat = {\n name: 'Quantized Mesh',\n id: 'quantized-mesh',\n module: 'raster',\n encoding: 'binary',\n format: 'quantized-mesh',\n extensions: ['terrain'],\n mimeTypes: ['application/vnd.quantized-mesh'],\n binary: true\n} as const satisfies Format;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';\nimport type {ImageLoaderOptions} from '@loaders.gl/images';\nimport {VERSION} from './lib/utils/version';\n\nimport type {TerrainOptions} from './lib/parse-terrain';\nimport {TerrainFormat} from './terrain-format';\n\n/** TerrainLoader options */\nexport type TerrainLoaderOptions = ImageLoaderOptions & {\n /** TerrainLoader options */\n terrain?: TerrainOptions & {\n /** Selects mesh output or Apache Arrow output. */\n shape?: 'mesh' | 'arrow-table';\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for image encoded terrain\n */\nexport const TerrainLoader = {\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n\n ...TerrainFormat,\n version: VERSION,\n worker: true,\n /** Loads the parser-bearing terrain loader implementation. */\n preload: async () => (await import('@loaders.gl/raster/terrain-loader')).TerrainLoaderWithParser,\n options: {\n terrain: {\n tesselator: 'auto',\n shape: 'arrow-table',\n bounds: undefined!,\n meshMaxError: 10,\n elevationDecoder: {\n rScaler: 1,\n gScaler: 0,\n bScaler: 0,\n offset: 0\n },\n skirtHeight: undefined\n }\n }\n} as const satisfies Loader<Mesh | MeshArrowTable, never, TerrainLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';\nimport {VERSION} from './lib/utils/version';\nimport {QuantizedMeshFormat} from './terrain-format';\n\n/** QuantizedMeshLoader options */\nexport type QuantizedMeshLoaderOptions = LoaderOptions & {\n /** QuantizedMeshLoader options */\n 'quantized-mesh'?: {\n /** Selects mesh output or Apache Arrow output. */\n shape?: 'mesh' | 'arrow-table';\n bounds?: [number, number, number, number];\n skirtHeight?: number | null;\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for quantized meshes\n */\nexport const QuantizedMeshLoader = {\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n\n ...QuantizedMeshFormat,\n version: VERSION,\n worker: true,\n /** Loads the parser-bearing quantized mesh loader implementation. */\n preload: async () =>\n (await import('@loaders.gl/raster/quantized-mesh-loader')).QuantizedMeshLoaderWithParser,\n options: {\n 'quantized-mesh': {\n shape: 'arrow-table',\n bounds: [0, 0, 1, 1],\n skirtHeight: null\n }\n }\n} as const satisfies Loader<Mesh | MeshArrowTable, never, QuantizedMeshLoaderOptions>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {WriterOptions, WriterWithEncoder} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable, MeshAttribute} from '@loaders.gl/core/schema';\nimport {convertMeshToTable, convertTableToMesh} from '@loaders.gl/core/schema-utils';\nimport {VERSION} from './lib/utils/version';\nimport {QuantizedMeshFormat} from './terrain-format';\n\nconst QUANTIZED_MESH_HEADER_LENGTH = 88;\nconst QUANTIZED_COORDINATE_RANGE = 32767;\nconst EMPTY_EDGE_INDICES_LENGTH = Uint32Array.BYTES_PER_ELEMENT * 4;\n\n/** Options for `QuantizedMeshWriter`. */\nexport type QuantizedMeshWriterOptions = WriterOptions & {\n /** Quantized mesh-specific writer options. */\n 'quantized-mesh'?: {\n /** Bounds used to map x/y positions to quantized u/v coordinates. */\n bounds?: [number, number, number, number];\n };\n};\n\n/**\n * Writer for the quantized mesh terrain format.\n */\nexport const QuantizedMeshWriter = {\n ...QuantizedMeshFormat,\n version: VERSION,\n dataType: null as unknown as Mesh | MeshArrowTable,\n batchType: null as never,\n options: {\n 'quantized-mesh': {}\n },\n encode: async (data, options) => encodeQuantizedMeshSync(data, options),\n encodeSync: encodeQuantizedMeshSync\n} as const satisfies WriterWithEncoder<Mesh | MeshArrowTable, never, QuantizedMeshWriterOptions>;\n\n/** Encode mesh category data as quantized mesh terrain bytes. */\nfunction encodeQuantizedMeshSync(\n data: Mesh | MeshArrowTable,\n options: QuantizedMeshWriterOptions = {}\n): ArrayBuffer {\n const mesh = convertTableToMesh(normalizeMeshArrowTable(data));\n const positionAttribute = getRequiredAttribute(mesh, 'POSITION');\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n const boundingBox = getBoundingBox(positionAttribute, vertexCount);\n const bounds = options['quantized-mesh']?.bounds || [\n boundingBox[0][0],\n boundingBox[0][1],\n boundingBox[1][0],\n boundingBox[1][1]\n ];\n const triangleIndices = getTriangleIndices(mesh, vertexCount);\n const highWatermarkMesh = reorderMeshForHighWatermark(triangleIndices, vertexCount);\n const bytesPerIndex =\n vertexCount > 65536 ? Uint32Array.BYTES_PER_ELEMENT : Uint16Array.BYTES_PER_ELEMENT;\n const vertexDataLength =\n Uint32Array.BYTES_PER_ELEMENT + vertexCount * 3 * Uint16Array.BYTES_PER_ELEMENT;\n const triangleDataOffset = getAlignedOffset(\n QUANTIZED_MESH_HEADER_LENGTH + vertexDataLength,\n bytesPerIndex\n );\n const triangleDataLength = Uint32Array.BYTES_PER_ELEMENT + triangleIndices.length * bytesPerIndex;\n const arrayBuffer = new ArrayBuffer(\n triangleDataOffset + triangleDataLength + EMPTY_EDGE_INDICES_LENGTH\n );\n const dataView = new DataView(arrayBuffer);\n\n writeHeader(dataView, boundingBox);\n dataView.setUint32(QUANTIZED_MESH_HEADER_LENGTH, vertexCount, true);\n writeVertexData(dataView, QUANTIZED_MESH_HEADER_LENGTH + Uint32Array.BYTES_PER_ELEMENT, {\n positionAttribute,\n vertexCount,\n boundingBox,\n bounds,\n sourceVertexIndices: highWatermarkMesh.sourceVertexIndices\n });\n writeTriangleIndices(\n dataView,\n triangleDataOffset,\n highWatermarkMesh.triangleIndices,\n bytesPerIndex\n );\n writeEmptyEdgeIndices(dataView, triangleDataOffset + triangleDataLength);\n\n return arrayBuffer;\n}\n\n/** Return mesh data as a MeshArrowTable, converting plain Mesh data first. */\nfunction normalizeMeshArrowTable(data: Mesh | MeshArrowTable): MeshArrowTable {\n if ('shape' in data && data.shape === 'arrow-table') {\n return data;\n }\n return convertMeshToTable(data as Mesh, 'arrow-table');\n}\n\n/** Return a required mesh attribute or throw a format-specific error. */\nfunction getRequiredAttribute(mesh: Mesh, attributeName: string): MeshAttribute {\n const attribute = mesh.attributes[attributeName];\n if (!attribute) {\n throw new Error(`QuantizedMeshWriter: ${attributeName} attribute is required`);\n }\n return attribute;\n}\n\n/** Write the fixed-length quantized mesh header. */\nfunction writeHeader(\n dataView: DataView,\n boundingBox: [[number, number, number], [number, number, number]]\n): void {\n const center = getCenter(boundingBox);\n const radius = getRadius(boundingBox, center);\n let byteOffset = 0;\n\n for (const value of center) {\n dataView.setFloat64(byteOffset, value, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n }\n\n dataView.setFloat32(byteOffset, boundingBox[0][2], true);\n byteOffset += Float32Array.BYTES_PER_ELEMENT;\n dataView.setFloat32(byteOffset, boundingBox[1][2], true);\n byteOffset += Float32Array.BYTES_PER_ELEMENT;\n\n for (const value of center) {\n dataView.setFloat64(byteOffset, value, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n }\n dataView.setFloat64(byteOffset, radius, true);\n byteOffset += Float64Array.BYTES_PER_ELEMENT;\n\n dataView.setFloat64(byteOffset, 0, true);\n dataView.setFloat64(byteOffset + 8, 0, true);\n dataView.setFloat64(byteOffset + 16, 0, true);\n}\n\n/** Write delta and zig-zag encoded u, v, and height vertex arrays. */\nfunction writeVertexData(\n dataView: DataView,\n byteOffset: number,\n parameters: {\n positionAttribute: MeshAttribute;\n vertexCount: number;\n boundingBox: [[number, number, number], [number, number, number]];\n bounds: [number, number, number, number];\n sourceVertexIndices: number[];\n }\n): void {\n const quantizedCoordinates = getQuantizedCoordinates(parameters);\n const arrayByteLength = parameters.vertexCount * Uint16Array.BYTES_PER_ELEMENT;\n\n writeDeltaEncodedArray(dataView, byteOffset, quantizedCoordinates.u);\n writeDeltaEncodedArray(dataView, byteOffset + arrayByteLength, quantizedCoordinates.v);\n writeDeltaEncodedArray(dataView, byteOffset + arrayByteLength * 2, quantizedCoordinates.height);\n}\n\n/** Return quantized u, v, and height arrays from positions. */\nfunction getQuantizedCoordinates(parameters: {\n positionAttribute: MeshAttribute;\n vertexCount: number;\n boundingBox: [[number, number, number], [number, number, number]];\n bounds: [number, number, number, number];\n sourceVertexIndices: number[];\n}): {u: Uint16Array; v: Uint16Array; height: Uint16Array} {\n const [minimumX, minimumY, maximumX, maximumY] = parameters.bounds;\n const heightMinimum = parameters.boundingBox[0][2];\n const heightMaximum = parameters.boundingBox[1][2];\n const u = new Uint16Array(parameters.vertexCount);\n const v = new Uint16Array(parameters.vertexCount);\n const height = new Uint16Array(parameters.vertexCount);\n\n for (let vertexIndex = 0; vertexIndex < parameters.vertexCount; vertexIndex++) {\n const sourceVertexIndex = parameters.sourceVertexIndices[vertexIndex];\n u[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 0),\n minimumX,\n maximumX\n );\n v[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 1),\n minimumY,\n maximumY\n );\n height[vertexIndex] = quantize(\n getComponent(parameters.positionAttribute, sourceVertexIndex, 2),\n heightMinimum,\n heightMaximum\n );\n }\n\n return {u, v, height};\n}\n\n/** Write a delta and zig-zag encoded Uint16 array. */\nfunction writeDeltaEncodedArray(dataView: DataView, byteOffset: number, values: Uint16Array): void {\n let previousValue = 0;\n for (let valueIndex = 0; valueIndex < values.length; valueIndex++) {\n const value = values[valueIndex];\n const delta = value - previousValue;\n dataView.setUint16(\n byteOffset + valueIndex * Uint16Array.BYTES_PER_ELEMENT,\n encodeZigZag(delta),\n true\n );\n previousValue = value;\n }\n}\n\n/** Write high-watermark encoded triangle indices. */\nfunction writeTriangleIndices(\n dataView: DataView,\n byteOffset: number,\n triangleIndices: number[],\n bytesPerIndex: number\n): void {\n dataView.setUint32(byteOffset, triangleIndices.length / 3, true);\n let highestIndex = 0;\n let indexByteOffset = byteOffset + Uint32Array.BYTES_PER_ELEMENT;\n\n for (const triangleIndex of triangleIndices) {\n const code = highestIndex - triangleIndex;\n if (code < 0) {\n throw new Error('QuantizedMeshWriter: triangle indices must be high-watermark encodable');\n }\n\n if (bytesPerIndex === Uint16Array.BYTES_PER_ELEMENT) {\n dataView.setUint16(indexByteOffset, code, true);\n } else {\n dataView.setUint32(indexByteOffset, code, true);\n }\n\n if (code === 0) {\n highestIndex++;\n }\n indexByteOffset += bytesPerIndex;\n }\n}\n\n/** Write empty west, south, east, and north edge-index lists. */\nfunction writeEmptyEdgeIndices(dataView: DataView, byteOffset: number): void {\n dataView.setUint32(byteOffset, 0, true);\n dataView.setUint32(byteOffset + 4, 0, true);\n dataView.setUint32(byteOffset + 8, 0, true);\n dataView.setUint32(byteOffset + 12, 0, true);\n}\n\n/** Return triangle indices for indexed or sequential triangle-list meshes. */\nfunction getTriangleIndices(mesh: Mesh, vertexCount: number): number[] {\n if (mesh.indices?.value?.length) {\n return Array.from(mesh.indices.value);\n }\n\n if (mesh.mode !== 4 && mesh.topology !== 'triangle-list') {\n throw new Error('QuantizedMeshWriter: triangle-list mesh data is required');\n }\n\n const triangleIndices: number[] = [];\n for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {\n triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n }\n return triangleIndices;\n}\n\n/** Return vertices and indices reordered into first-reference order for high-watermark encoding. */\nfunction reorderMeshForHighWatermark(\n triangleIndices: number[],\n vertexCount: number\n): {triangleIndices: number[]; sourceVertexIndices: number[]} {\n const remappedVertexIndices = new Map<number, number>();\n const sourceVertexIndices: number[] = [];\n const remappedTriangleIndices = triangleIndices.map(triangleIndex => {\n if (!Number.isInteger(triangleIndex) || triangleIndex < 0 || triangleIndex >= vertexCount) {\n throw new Error('QuantizedMeshWriter: triangle index is out of range');\n }\n\n const existingIndex = remappedVertexIndices.get(triangleIndex);\n if (existingIndex !== undefined) {\n return existingIndex;\n }\n\n const nextIndex = sourceVertexIndices.length;\n remappedVertexIndices.set(triangleIndex, nextIndex);\n sourceVertexIndices.push(triangleIndex);\n return nextIndex;\n });\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n if (!remappedVertexIndices.has(vertexIndex)) {\n sourceVertexIndices.push(vertexIndex);\n }\n }\n\n return {triangleIndices: remappedTriangleIndices, sourceVertexIndices};\n}\n\n/** Return an aligned byte offset. */\nfunction getAlignedOffset(byteOffset: number, byteAlignment: number): number {\n const remainder = byteOffset % byteAlignment;\n return remainder === 0 ? byteOffset : byteOffset + byteAlignment - remainder;\n}\n\n/** Return a single attribute component with 0 as the missing component fallback. */\nfunction getComponent(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;\n}\n\n/** Compute a bounding box from position data. */\nfunction getBoundingBox(\n positionAttribute: MeshAttribute,\n vertexCount: number\n): [[number, number, number], [number, number, number]] {\n const minimum: [number, number, number] = [\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY,\n Number.POSITIVE_INFINITY\n ];\n const maximum: [number, number, number] = [\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY,\n Number.NEGATIVE_INFINITY\n ];\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n for (let componentIndex = 0; componentIndex < 3; componentIndex++) {\n const value = getComponent(positionAttribute, vertexIndex, componentIndex);\n minimum[componentIndex] = Math.min(minimum[componentIndex], value);\n maximum[componentIndex] = Math.max(maximum[componentIndex], value);\n }\n }\n\n return [minimum, maximum];\n}\n\n/** Return the center of a bounding box. */\nfunction getCenter(\n boundingBox: [[number, number, number], [number, number, number]]\n): [number, number, number] {\n return [\n (boundingBox[0][0] + boundingBox[1][0]) / 2,\n (boundingBox[0][1] + boundingBox[1][1]) / 2,\n (boundingBox[0][2] + boundingBox[1][2]) / 2\n ];\n}\n\n/** Return a bounding sphere radius that contains the bounding box. */\nfunction getRadius(\n boundingBox: [[number, number, number], [number, number, number]],\n center: [number, number, number]\n): number {\n const xDistance = Math.max(\n Math.abs(boundingBox[0][0] - center[0]),\n Math.abs(boundingBox[1][0] - center[0])\n );\n const yDistance = Math.max(\n Math.abs(boundingBox[0][1] - center[1]),\n Math.abs(boundingBox[1][1] - center[1])\n );\n const zDistance = Math.max(\n Math.abs(boundingBox[0][2] - center[2]),\n Math.abs(boundingBox[1][2] - center[2])\n );\n return Math.hypot(xDistance, yDistance, zDistance);\n}\n\n/** Quantize a value into the terrain coordinate range. */\nfunction quantize(value: number, minimum: number, maximum: number): number {\n const range = maximum - minimum || 1;\n const quantizedValue = Math.round(((value - minimum) / range) * QUANTIZED_COORDINATE_RANGE);\n return Math.max(0, Math.min(QUANTIZED_COORDINATE_RANGE, quantizedValue));\n}\n\n/** Zig-zag encode a signed delta. */\nfunction encodeZigZag(value: number): number {\n return (value << 1) ^ (value >> 31);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {SourceLoader} from '@loaders.gl/core/loader-utils';\nimport type {GeoTIFFRasterSource, GeoTIFFSourceLoaderOptions} from './geotiff-source-loader';\nimport {GeoTIFFFormat} from './geotiff-format';\nimport {GeoTIFFLoader} from './geotiff-loader-types';\n\n/** Metadata-only GeoTIFF source loader. */\nexport const GeoTIFFSourceLoader = {\n dataType: null as unknown as GeoTIFFRasterSource,\n batchType: null as never,\n ...GeoTIFFFormat,\n name: 'GeoTIFFSourceLoader',\n version: GeoTIFFLoader.version,\n type: 'geotiff',\n fromUrl: true,\n fromBlob: true,\n\n options: {\n geotiff: {\n headers: undefined!,\n interleaved: false,\n resampleMethod: 'nearest'\n }\n },\n\n defaultOptions: {\n geotiff: {\n headers: undefined!,\n interleaved: false,\n resampleMethod: 'nearest'\n }\n },\n\n testURL: (url: string): boolean => {\n if (/\\.ome\\.tiff?(?:$|[?#])/i.test(url)) {\n return false;\n }\n return /\\.(?:geotiff?|tiff?)(?:$|[?#])/i.test(url);\n },\n /** Loads the implementation for asynchronous source construction. */\n preload: async () =>\n (await import('@loaders.gl/raster/geotiff-source-loader')).GeoTIFFSourceLoader,\n /** Synchronous construction requires the source implementation subpath. */\n createDataSource(\n _data: string | Blob,\n _options: GeoTIFFSourceLoaderOptions\n ): GeoTIFFRasterSource {\n throw new Error(\n 'GeoTIFFSourceLoader requires async load() or its source implementation subpath'\n );\n }\n} as const satisfies SourceLoader<GeoTIFFRasterSource>;\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {SourceLoader} from '@loaders.gl/core/loader-utils';\nimport type {OMETiffImageSource, OMETiffSourceLoaderOptions} from './ometiff-source-loader';\nimport {OMETiffFormat} from './geotiff-format';\nimport {GeoTIFFLoader} from './geotiff-loader-types';\n\n/** Metadata-only OMETiff source loader. */\nexport const OMETiffSourceLoader = {\n dataType: null as unknown as OMETiffImageSource,\n batchType: null as never,\n ...OMETiffFormat,\n name: 'OMETiffSourceLoader',\n version: GeoTIFFLoader.version,\n type: 'ometiff',\n fromUrl: true,\n fromBlob: true,\n\n options: {\n ometiff: {\n headers: undefined!,\n interleaved: false,\n defaultChannels: undefined!\n }\n },\n\n defaultOptions: {\n ometiff: {\n headers: undefined!,\n interleaved: false,\n defaultChannels: undefined!\n }\n },\n\n testURL: (url: string): boolean => /\\.ome\\.tiff?(?:$|[?#])/i.test(url),\n /** Loads the implementation for asynchronous source construction. */\n preload: async () =>\n (await import('@loaders.gl/raster/ometiff-source-loader')).OMETiffSourceLoader,\n /** Synchronous construction requires the source implementation subpath. */\n createDataSource(_data: string | Blob, _options: OMETiffSourceLoaderOptions): OMETiffImageSource {\n throw new Error(\n 'OMETiffSourceLoader requires async load() or its source implementation subpath'\n );\n }\n} as const satisfies SourceLoader<OMETiffImageSource>;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;ACOO,IAAM,gBAAgB;EAC3B,IAAI;EACJ,MAAM;EACN,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,WAAW,CAAC,YAAY;EACxB,YAAY,CAAC,WAAW,QAAQ,UAAU,KAAK;;AAI1C,IAAM,gBAAgB;EAC3B,MAAM;EACN,IAAI;EACJ,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,YAAY,CAAC,WAAW,UAAU;EAClC,WAAW,CAAC,cAAc,eAAe;;;;ACf3C,IAAM,UAAU,OAAoC,iBAAe;AAqBnE,eAAe,UAAO;AACpB,QAAM,EAAC,wBAAuB,IAAI,MAAM,OAAO,mCAAmC;AAClF,SAAO;AACT;AAGO,IAAM,gBAAgB;EAC3B,UAAU;EACV,WAAW;EAEX,GAAG;EACH,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UAAU;EAEV,SAAS;IACP,SAAS;MACP,SAAS;MACT,aAAa;MACb,gBAAgB;;;EAIpB,gBAAgB;IACd,SAAS;MACP,SAAS;MACT,aAAa;MACb,gBAAgB;;;EAIpB,SAAS,CAAC,QAAwB;AAChC,QAAI,0BAA0B,KAAK,GAAG,GAAG;AACvC,aAAO;IACT;AACA,WAAO,kCAAkC,KAAK,GAAG;EACnD;;EAEA,SAAS,aACN,MAAM,OAAO,0CAA0C,GAAG;;EAE7D,iBACE,OACA,UAAoC;AAEpC,UAAM,IAAI,MACR,gFAAgF;EAEpF;;;;AC3CK,IAAM,sBAAsB;EACjC,UAAU;EACV,WAAW;EACX,GAAG;EACH,MAAM;EACN,SAAS,cAAc;EACvB,MAAM;EACN,SAAS;EACT,UAAU;EAEV,SAAS;IACP,SAAS;MACP,SAAS;MACT,aAAa;MACb,iBAAiB;;;EAIrB,gBAAgB;IACd,SAAS;MACP,SAAS;MACT,aAAa;MACb,iBAAiB;;;EAIrB,SAAS,CAAC,QAAyB,0BAA0B,KAAK,GAAG;;EAErE,SAAS,aACN,MAAM,OAAO,0CAA0C,GAAG;;EAE7D,iBAAiB,OAAsB,UAAoC;AACzE,UAAM,IAAI,MACR,gFAAgF;EAEpF;;",
|
|
6
6
|
"names": ["VERSION", "preload", "VERSION", "preload", "VERSION", "VERSION", "VERSION", "VERSION"]
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,11 +19,10 @@ export { TerrainFormat, QuantizedMeshFormat } from "./terrain/terrain-format.js"
|
|
|
19
19
|
export { QuantizedMeshWriter } from "./terrain/quantized-mesh-writer.js";
|
|
20
20
|
export type { QuantizedMeshWriterOptions } from "./terrain/quantized-mesh-writer.js";
|
|
21
21
|
export type { ElevationDecoder, TerrainHeightmap, TerrainHeightmapImage } from "./terrain/lib/terrain-heightmap-types.js";
|
|
22
|
-
export type {
|
|
22
|
+
export type { TerrainRay, TerrainSurfaceHit, TerrainSurfaceBounds, TerrainSurface } from "./terrain/lib/terrain-contracts.js";
|
|
23
23
|
export { GeoTIFFSourceLoader } from "./geotiff/geotiff-source-loader-types.js";
|
|
24
24
|
export { OMETiffSourceLoader } from "./geotiff/ometiff-source-loader-types.js";
|
|
25
25
|
export type { GeoTIFFSourceLoaderOptions } from "./geotiff/geotiff-source-loader.js";
|
|
26
26
|
export type { OMETiffSourceLoaderOptions } from "./geotiff/ometiff-source-loader.js";
|
|
27
|
-
export type { TerrainFieldBounds, TerrainHeightFieldOptions, TerrainHeightFieldStatistics } from "./terrain/lib/terrain-height-field.js";
|
|
28
27
|
export type { GetOMETiffParameters, OMETiffChannelMetadata, OMETiffLevelMetadata, OMETiffSourceLoaderMetadata } from "./geotiff/ometiff-source-loader.js";
|
|
29
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAC7D,YAAY,EAAC,oBAAoB,EAAC,0CAAuC;AACzE,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC3B,0CAAuC;AACxC,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,oCAAiC;AACtE,OAAO,EAAC,UAAU,EAAC,oCAAiC;AACpD,YAAY,EAAC,iBAAiB,EAAC,oCAAiC;AAChE,OAAO,EAAC,UAAU,EAAC,8BAA2B;AAC9C,YAAY,EAAC,QAAQ,EAAC,8CAA2C;AACjE,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAC7D,qCAAqC;AACrC,OAAO,EAAC,aAAa,IAAI,mBAAmB,EAAC,0CAAuC;AACpF,YAAY,EAAC,oBAAoB,EAAC,0CAAuC;AACzE,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,2CAA2C;AAC3C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,2CAAwC;AAChF,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACtB,iDAA8C;AAC/C,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,2CAAwC;AACzC,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,YAAY,EAAC,0BAA0B,EAAC,2CAAwC;AAChF,YAAY,EAAC,0BAA0B,EAAC,2CAAwC;AAChF,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC5B,2CAAwC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAE7D,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAO1E,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,oCAAiC;AACtE,OAAO,EAAC,UAAU,EAAC,oCAAiC;AAEpD,OAAO,EAAC,UAAU,EAAC,8BAA2B;AAE9C,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAC7D,qCAAqC;AACrC,OAAO,EAAC,aAAa,IAAI,mBAAmB,EAAC,0CAAuC;AAEpF,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,2CAA2C;AAC3C,OAAO,EAAC,mBAAmB,IAAI,yBAAyB,EAAC,iDAA8C;AAEvG,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,oCAAiC;AAC5E,OAAO,EAAC,mBAAmB,EAAC,2CAAwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAE7D,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAO1E,OAAO,EAAC,aAAa,EAAE,aAAa,EAAC,oCAAiC;AACtE,OAAO,EAAC,UAAU,EAAC,oCAAiC;AAEpD,OAAO,EAAC,UAAU,EAAC,8BAA2B;AAE9C,OAAO,EAAC,aAAa,EAAC,0CAAuC;AAC7D,qCAAqC;AACrC,OAAO,EAAC,aAAa,IAAI,mBAAmB,EAAC,0CAAuC;AAEpF,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,2CAA2C;AAC3C,OAAO,EAAC,mBAAmB,IAAI,yBAAyB,EAAC,iDAA8C;AAEvG,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,oCAAiC;AAC5E,OAAO,EAAC,mBAAmB,EAAC,2CAAwC;AAapE,OAAO,EAAC,mBAAmB,EAAC,iDAA8C;AAC1E,OAAO,EAAC,mBAAmB,EAAC,iDAA8C"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { LERCFormat } from "./lerc-format.js";
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
const VERSION = typeof "5.0.0-beta.
|
|
7
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
8
8
|
/** Preloads the parser-bearing LERC loader implementation. */
|
|
9
9
|
async function preload() {
|
|
10
10
|
const { LERCLoaderWithParser } = await import('@loaders.gl/raster/lerc-loader');
|