@loaders.gl/raster 5.0.0-beta.6 → 5.0.0-beta.8
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 +2 -2
- package/dist/geotiff/advanced.cjs +12 -9
- package/dist/geotiff/advanced.cjs.map +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-types.d.ts +2 -2
- package/dist/geotiff/geotiff-source-loader-types.d.ts.map +1 -1
- package/dist/geotiff/geotiff-source-loader-types.js +2 -2
- package/dist/geotiff/geotiff-source-loader-types.js.map +1 -1
- package/dist/geotiff/geotiff-source-loader.d.ts +1 -1
- package/dist/geotiff/geotiff-source-loader.d.ts.map +1 -1
- package/dist/geotiff/geotiff-source-loader.js +2 -2
- package/dist/geotiff/geotiff-source-loader.js.map +1 -1
- package/dist/geotiff/lib/tiff-pixel-source.d.ts.map +1 -1
- package/dist/geotiff/lib/tiff-pixel-source.js +2 -1
- package/dist/geotiff/lib/tiff-pixel-source.js.map +1 -1
- package/dist/geotiff/loaders.js +1 -1
- package/dist/geotiff/ometiff-source-loader-types.d.ts +2 -2
- package/dist/geotiff/ometiff-source-loader-types.d.ts.map +1 -1
- package/dist/geotiff/ometiff-source-loader-types.js +2 -2
- package/dist/geotiff/ometiff-source-loader-types.js.map +1 -1
- package/dist/geotiff/ometiff-source-loader.d.ts +1 -1
- package/dist/geotiff/ometiff-source-loader.d.ts.map +1 -1
- package/dist/geotiff/ometiff-source-loader.js +2 -2
- package/dist/geotiff/ometiff-source-loader.js.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +2 -2
- package/dist/lerc/lerc-loader-types.js +1 -1
- package/dist/quantized-mesh-worker.js +37 -1
- package/dist/terrain/index.cjs +1 -1
- package/dist/terrain/lib/utils/version.js +1 -1
- package/dist/terrain-worker.js +800 -30
- package/package.json +5 -5
- package/src/geotiff/geotiff-source-loader-types.ts +2 -2
- package/src/geotiff/geotiff-source-loader.ts +1 -1
- package/src/geotiff/lib/tiff-pixel-source.ts +2 -1
- package/src/geotiff/ometiff-source-loader-types.ts +5 -2
- package/src/geotiff/ometiff-source-loader.ts +1 -1
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.8" : "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.8" : "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.8" : "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.8" : "latest";
|
|
144
144
|
|
|
145
145
|
// dist/terrain/terrain-format.js
|
|
146
146
|
var TerrainFormat = {
|
|
@@ -465,8 +465,8 @@ var GeoTIFFSourceLoader = {
|
|
|
465
465
|
/** Loads the implementation for asynchronous source construction. */
|
|
466
466
|
preload: async () => (await import("@loaders.gl/raster/geotiff-source-loader")).GeoTIFFSourceLoader,
|
|
467
467
|
/** Synchronous construction requires the source implementation subpath. */
|
|
468
|
-
|
|
469
|
-
throw new Error("GeoTIFFSourceLoader requires async
|
|
468
|
+
createDataSourceSync(_data, _options) {
|
|
469
|
+
throw new Error("GeoTIFFSourceLoader requires async createDataSource() or its source implementation subpath");
|
|
470
470
|
}
|
|
471
471
|
};
|
|
472
472
|
|
|
@@ -498,8 +498,8 @@ var OMETiffSourceLoader = {
|
|
|
498
498
|
/** Loads the implementation for asynchronous source construction. */
|
|
499
499
|
preload: async () => (await import("@loaders.gl/raster/ometiff-source-loader")).OMETiffSourceLoader,
|
|
500
500
|
/** Synchronous construction requires the source implementation subpath. */
|
|
501
|
-
|
|
502
|
-
throw new Error("OMETiffSourceLoader requires async
|
|
501
|
+
createDataSourceSync(_data, _options) {
|
|
502
|
+
throw new Error("OMETiffSourceLoader requires async createDataSource() or its source implementation subpath");
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
// Annotate the CommonJS export names for ESM import in node:
|
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 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
|
-
"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,SAAS;EACT,SAAS;IACP,SAAS;MACP,aAAa;;;EAGjB;;;;ACtCF,IAAMA,WAAU,OAAoC,iBAAe;AAGnE,eAAeC,WAAO;AACpB,QAAM,EAAC,8BAA6B,IAAI,MAAM,OAAO,0CAA0C;AAC/F,SAAO;AACT;AAGO,IA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G,GAAG;AACvC,aAAO;IACT;AACA,WAAO,kCAAkC,KAAK,GAAG;EACnD;;EAEA,SAAS,aACN,MAAM,OAAO,0CAA0C,GAAG;;EAE7D,
|
|
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 createDataSourceSync(\n _data: string | Blob,\n _options: GeoTIFFSourceLoaderOptions\n ): GeoTIFFRasterSource {\n throw new Error(\n 'GeoTIFFSourceLoader requires async createDataSource() 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 createDataSourceSync(\n _data: string | Blob,\n _options: OMETiffSourceLoaderOptions\n ): OMETiffImageSource {\n throw new Error(\n 'OMETiffSourceLoader requires async createDataSource() or its source implementation subpath'\n );\n }\n} as const satisfies SourceLoader<OMETiffImageSource>;\n"],
|
|
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,SAAS;EACT,SAAS;IACP,SAAS;MACP,aAAa;;;EAGjB;;;;ACtCF,IAAMA,WAAU,OAAoC,iBAAe;AAGnE,eAAeC,WAAO;AACpB,QAAM,EAAC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gB;;;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,qBACE,OACA,UAAoC;AAEpC,UAAM,IAAI,MACR,4FAA4F;EAEhG;;;;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,qBACE,OACA,UAAoC;AAEpC,UAAM,IAAI,MACR,4FAA4F;EAEhG;;",
|
|
6
6
|
"names": ["VERSION", "preload", "VERSION", "preload", "VERSION", "VERSION", "VERSION", "VERSION"]
|
|
7
7
|
}
|
|
@@ -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.8" !== 'undefined' ? "5.0.0-beta.8" : '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');
|
|
@@ -268,6 +268,12 @@
|
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
270
|
|
|
271
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js
|
|
272
|
+
var init_indexed_arrow_helpers = __esm({
|
|
273
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-helpers.js"() {
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
271
277
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
272
278
|
function __rest(s, e) {
|
|
273
279
|
var t = {};
|
|
@@ -15168,6 +15174,12 @@ return true;`);
|
|
|
15168
15174
|
}
|
|
15169
15175
|
});
|
|
15170
15176
|
|
|
15177
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js
|
|
15178
|
+
var init_arrow_schema_utils = __esm({
|
|
15179
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-schema-utils.js"() {
|
|
15180
|
+
}
|
|
15181
|
+
});
|
|
15182
|
+
|
|
15171
15183
|
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-data.js
|
|
15172
15184
|
function getArrowVariadicBuffers(data) {
|
|
15173
15185
|
return data.variadicBuffers ?? [];
|
|
@@ -15271,27 +15283,43 @@ return true;`);
|
|
|
15271
15283
|
}
|
|
15272
15284
|
});
|
|
15273
15285
|
|
|
15286
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js
|
|
15287
|
+
var init_take_arrow_rows = __esm({
|
|
15288
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/take-arrow-rows.js"() {
|
|
15289
|
+
init_arrow_data();
|
|
15290
|
+
init_split_arrow_buffers();
|
|
15291
|
+
}
|
|
15292
|
+
});
|
|
15293
|
+
|
|
15274
15294
|
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js
|
|
15275
15295
|
var init_indexed_arrow_vector = __esm({
|
|
15276
15296
|
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-vector.js"() {
|
|
15297
|
+
init_indexed_arrow_helpers();
|
|
15277
15298
|
}
|
|
15278
15299
|
});
|
|
15279
15300
|
|
|
15280
15301
|
// ../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js
|
|
15281
15302
|
var init_indexed_arrow_table = __esm({
|
|
15282
15303
|
"../../node_modules/@math.gl/arrow/dist/arrow/indexed-arrow-table.js"() {
|
|
15304
|
+
init_indexed_arrow_helpers();
|
|
15305
|
+
init_arrow_schema_utils();
|
|
15306
|
+
init_take_arrow_rows();
|
|
15307
|
+
init_indexed_arrow_vector();
|
|
15283
15308
|
}
|
|
15284
15309
|
});
|
|
15285
15310
|
|
|
15286
15311
|
// ../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js
|
|
15287
15312
|
var init_mapped_arrow_table = __esm({
|
|
15288
15313
|
"../../node_modules/@math.gl/arrow/dist/arrow/mapped-arrow-table.js"() {
|
|
15314
|
+
init_indexed_arrow_helpers();
|
|
15315
|
+
init_indexed_arrow_table();
|
|
15289
15316
|
}
|
|
15290
15317
|
});
|
|
15291
15318
|
|
|
15292
15319
|
// ../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js
|
|
15293
15320
|
var init_rename_arrow_columns = __esm({
|
|
15294
15321
|
"../../node_modules/@math.gl/arrow/dist/arrow/rename-arrow-columns.js"() {
|
|
15322
|
+
init_arrow_schema_utils();
|
|
15295
15323
|
}
|
|
15296
15324
|
});
|
|
15297
15325
|
|
|
@@ -15345,15 +15373,23 @@ return true;`);
|
|
|
15345
15373
|
}
|
|
15346
15374
|
});
|
|
15347
15375
|
|
|
15376
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
|
|
15377
|
+
var init_arrow_column_utils = __esm({
|
|
15378
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
|
|
15379
|
+
}
|
|
15380
|
+
});
|
|
15381
|
+
|
|
15348
15382
|
// ../../node_modules/@math.gl/arrow/dist/arrow/index.js
|
|
15349
15383
|
var init_arrow = __esm({
|
|
15350
15384
|
"../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
|
|
15351
15385
|
init_indexed_arrow_table();
|
|
15352
15386
|
init_indexed_arrow_vector();
|
|
15353
15387
|
init_mapped_arrow_table();
|
|
15388
|
+
init_arrow_schema_utils();
|
|
15354
15389
|
init_rename_arrow_columns();
|
|
15355
15390
|
init_split_arrow_buffers();
|
|
15356
15391
|
init_arrow_table_transport();
|
|
15392
|
+
init_arrow_column_utils();
|
|
15357
15393
|
}
|
|
15358
15394
|
});
|
|
15359
15395
|
|
|
@@ -16882,7 +16918,7 @@ return true;`);
|
|
|
16882
16918
|
var init_version = __esm({
|
|
16883
16919
|
"src/terrain/lib/utils/version.ts"() {
|
|
16884
16920
|
"use strict";
|
|
16885
|
-
VERSION = true ? "5.0.0-beta.
|
|
16921
|
+
VERSION = true ? "5.0.0-beta.8" : "latest";
|
|
16886
16922
|
}
|
|
16887
16923
|
});
|
|
16888
16924
|
|
package/dist/terrain/index.cjs
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
// Version constant cannot be imported, it needs to correspond to the build version of **this** module.
|
|
5
5
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
6
6
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
7
|
-
export const VERSION = typeof "5.0.0-beta.
|
|
7
|
+
export const VERSION = typeof "5.0.0-beta.8" !== 'undefined' ? "5.0.0-beta.8" : 'latest';
|
|
8
8
|
//# sourceMappingURL=version.js.map
|