@loaders.gl/tiles-3d 5.0.0-beta.5 → 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/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles/dist.dev.js +50 -1
- package/dist/3d-tiles/dist.min.js +11 -11
- package/dist/3d-tiles/index.cjs +55 -4
- package/dist/3d-tiles/index.cjs.map +1 -1
- package/dist/3d-tiles/lib/utils/version.js +1 -1
- package/dist/3d-tiles-archive-writer.cjs +1 -1
- package/dist/cesium-ion-loader-with-parser.cjs +2 -1
- package/dist/cesium-ion-loader-with-parser.cjs.map +1 -1
- package/dist/copc/copc-source-loader.js +1 -1
- package/dist/copc/copc-writer.js +1 -1
- package/dist/copc/index.cjs +99 -5
- package/dist/copc/index.cjs.map +1 -1
- package/dist/dist.dev.js +92 -2
- package/dist/dist.min.js +10 -10
- package/dist/i3s/arcgis-webscene-loader.js +1 -1
- package/dist/i3s/dist.dev.js +93 -2
- package/dist/i3s/dist.min.js +31 -31
- package/dist/i3s/i3s-attribute-loader.js +1 -1
- package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
- package/dist/i3s/i3s-content-loader.js +1 -1
- package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
- package/dist/i3s/i3s-loader.js +1 -1
- package/dist/i3s/i3s-node-page-loader.js +1 -1
- package/dist/i3s/i3s-slpk-loader.js +1 -1
- package/dist/i3s/i3s-slpk-writer.js +1 -1
- package/dist/i3s/index.cjs +107 -12
- package/dist/i3s/index.cjs.map +2 -2
- package/dist/i3s-content-worker-node.js +7 -7
- package/dist/i3s-content-worker-node.js.map +1 -1
- package/dist/i3s-content-worker.js +5 -4
- package/dist/i3s-lepcc-worker-node.js +2 -2
- package/dist/i3s-lepcc-worker.js +2 -2
- package/dist/i3s-mesh-writer.cjs +1 -0
- package/dist/i3s-mesh-writer.cjs.map +1 -1
- package/dist/i3s-slpk-writer.cjs +1 -1
- package/dist/index.cjs +98 -4
- package/dist/index.cjs.map +2 -2
- package/dist/point-cloud-tile-source-loader-types.js +1 -1
- package/dist/point-cloud-tile-source-loader.cjs +46 -2
- package/dist/point-cloud-tile-source-loader.cjs.map +2 -2
- package/dist/point-cloud-tile-source.cjs +45 -1
- package/dist/point-cloud-tile-source.cjs.map +1 -1
- package/dist/potree/dist.dev.js +99 -9
- package/dist/potree/dist.min.js +15 -15
- package/dist/potree/index.cjs +107 -16
- package/dist/potree/index.cjs.map +2 -2
- package/dist/potree/potree-bin-loader.js +1 -1
- package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
- package/dist/potree/potree-loader-types.js +1 -1
- package/dist/potree/potree-source-loader.js +1 -1
- package/dist/potree/potree-writer.js +1 -1
- package/dist/potree/potree2-source.d.ts.map +1 -1
- package/dist/potree/potree2-source.js +3 -13
- package/dist/potree/potree2-source.js.map +1 -1
- package/dist/potree-loader.cjs +1 -1
- package/package.json +13 -13
- package/src/potree/potree2-source.ts +3 -14
|
@@ -11,7 +11,7 @@ import { createLASTypedExtraBytesAttributes, LASLoader, populateLASTypedExtraByt
|
|
|
11
11
|
import { normalizeCOPCProjectionDefinition } from "./lib/copc-wkt.js";
|
|
12
12
|
// __VERSION__ is injected by the package build.
|
|
13
13
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
14
|
-
const VERSION = typeof "5.0.0-beta.
|
|
14
|
+
const VERSION = typeof "5.0.0-beta.6" !== 'undefined' ? "5.0.0-beta.6" : 'latest';
|
|
15
15
|
const COPC_PREFIX_CACHE_LENGTH = 65536;
|
|
16
16
|
const COORDINATE_SYSTEM = {
|
|
17
17
|
CARTESIAN: 'cartesian',
|
package/dist/copc/copc-writer.js
CHANGED
|
@@ -6,7 +6,7 @@ import { LASWriter } from '@loaders.gl/pointclouds/las';
|
|
|
6
6
|
import { COPCFormat } from "./copc-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
|
const LAS_1_4_HEADER_LENGTH = 375;
|
|
11
11
|
const COPC_INFO_PAYLOAD_LENGTH = 160;
|
|
12
12
|
const VLR_HEADER_LENGTH = 54;
|
package/dist/copc/index.cjs
CHANGED
|
@@ -8692,6 +8692,8 @@ var init_http_file_transport = __esm({
|
|
|
8692
8692
|
identityHints;
|
|
8693
8693
|
/** Failure objects already included in telemetry. */
|
|
8694
8694
|
countedFailures = /* @__PURE__ */ new WeakSet();
|
|
8695
|
+
/** Observer for cumulative transport counters, including asynchronous cancellation. */
|
|
8696
|
+
onTelemetry;
|
|
8695
8697
|
/** Mutable counters backing immutable telemetry snapshots. */
|
|
8696
8698
|
telemetry = {
|
|
8697
8699
|
requestedBytes: 0,
|
|
@@ -8705,6 +8707,7 @@ var init_http_file_transport = __esm({
|
|
|
8705
8707
|
constructor(url, options) {
|
|
8706
8708
|
validateKnownByteLength(options.byteLength);
|
|
8707
8709
|
this.url = url;
|
|
8710
|
+
this.onTelemetry = options.onTelemetry;
|
|
8708
8711
|
this.fetchFunction = options.fetch || ((input, init) => globalThis.fetch(input, init));
|
|
8709
8712
|
this.fetchOptions = options.fetchOptions ? { ...options.fetchOptions, headers: new Headers(options.fetchOptions.headers) } : void 0;
|
|
8710
8713
|
this.consistency = options.consistency || "best-effort";
|
|
@@ -8731,6 +8734,7 @@ var init_http_file_transport = __esm({
|
|
|
8731
8734
|
}
|
|
8732
8735
|
/** Counts each failure object once even when it passes through several async layers. */
|
|
8733
8736
|
trackFailure(error) {
|
|
8737
|
+
var _a;
|
|
8734
8738
|
if (typeof error === "object" && error !== null) {
|
|
8735
8739
|
if (this.countedFailures.has(error)) {
|
|
8736
8740
|
return;
|
|
@@ -8742,10 +8746,11 @@ var init_http_file_transport = __esm({
|
|
|
8742
8746
|
} else {
|
|
8743
8747
|
this.telemetry.errorCount++;
|
|
8744
8748
|
}
|
|
8749
|
+
(_a = this.onTelemetry) == null ? void 0 : _a.call(this, this.getTelemetry(), error);
|
|
8745
8750
|
}
|
|
8746
8751
|
/** Performs and validates one exact HTTP range request. */
|
|
8747
8752
|
async requestRange(offset, length, signal, expectedIdentity) {
|
|
8748
|
-
var _a;
|
|
8753
|
+
var _a, _b;
|
|
8749
8754
|
const requestStartTime = getTimestamp2();
|
|
8750
8755
|
const abortContext = createCombinedAbortContext(signal, (_a = this.fetchOptions) == null ? void 0 : _a.signal);
|
|
8751
8756
|
this.telemetry.requestCount++;
|
|
@@ -8762,7 +8767,13 @@ var init_http_file_transport = __esm({
|
|
|
8762
8767
|
await cancelResponse(response);
|
|
8763
8768
|
throw new Error(`HTTP byte-range request expected 206, received ${response.status}`);
|
|
8764
8769
|
}
|
|
8765
|
-
const contentRange = await readContentRange(response)
|
|
8770
|
+
const contentRange = response.headers.has("Content-Range") ? await readContentRange(response) : await this.inferContentRange(
|
|
8771
|
+
response,
|
|
8772
|
+
offset,
|
|
8773
|
+
length,
|
|
8774
|
+
expectedIdentity,
|
|
8775
|
+
abortContext.signal
|
|
8776
|
+
);
|
|
8766
8777
|
const responseIdentity = getResponseIdentity(response, contentRange.byteLength);
|
|
8767
8778
|
const responseError = getIdentityError(
|
|
8768
8779
|
expectedIdentity,
|
|
@@ -8796,6 +8807,45 @@ var init_http_file_transport = __esm({
|
|
|
8796
8807
|
} finally {
|
|
8797
8808
|
abortContext.removeAbortListeners();
|
|
8798
8809
|
this.telemetry.networkTimeMs += getTimestamp2() - requestStartTime;
|
|
8810
|
+
(_b = this.onTelemetry) == null ? void 0 : _b.call(this, this.getTelemetry());
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
/** Infers bounds for a CORS-filtered 206; the caller still validates the body length. */
|
|
8814
|
+
async inferContentRange(response, offset, length, expectedIdentity, signal) {
|
|
8815
|
+
var _a;
|
|
8816
|
+
try {
|
|
8817
|
+
let byteLength = (expectedIdentity == null ? void 0 : expectedIdentity.byteLength) ?? this.identityHints.byteLength;
|
|
8818
|
+
if (byteLength === void 0) {
|
|
8819
|
+
const headers = new Headers((_a = this.fetchOptions) == null ? void 0 : _a.headers);
|
|
8820
|
+
headers.delete("Range");
|
|
8821
|
+
this.telemetry.requestCount++;
|
|
8822
|
+
const metadata = await this.fetchFunction(this.url, {
|
|
8823
|
+
...this.fetchOptions,
|
|
8824
|
+
method: "HEAD",
|
|
8825
|
+
body: void 0,
|
|
8826
|
+
headers,
|
|
8827
|
+
signal
|
|
8828
|
+
});
|
|
8829
|
+
await cancelResponse(metadata);
|
|
8830
|
+
const value = metadata.headers.get("Content-Length");
|
|
8831
|
+
byteLength = value && /^\d+$/.test(value) ? Number(value) : NaN;
|
|
8832
|
+
if (metadata.status !== 200 || !Number.isSafeInteger(byteLength) || byteLength < offset + length) {
|
|
8833
|
+
throw new Error(
|
|
8834
|
+
"HTTP byte-range response is missing Content-Range and HEAD did not provide a valid file length"
|
|
8835
|
+
);
|
|
8836
|
+
}
|
|
8837
|
+
const identityError = getIdentityError(
|
|
8838
|
+
getResponseIdentity(metadata, byteLength),
|
|
8839
|
+
getResponseIdentity(response, byteLength),
|
|
8840
|
+
this.identityHints,
|
|
8841
|
+
this.consistency
|
|
8842
|
+
);
|
|
8843
|
+
if (identityError) throw new Error(identityError);
|
|
8844
|
+
}
|
|
8845
|
+
return { offset, endOffset: offset + length - 1, byteLength };
|
|
8846
|
+
} catch (error) {
|
|
8847
|
+
await cancelResponse(response);
|
|
8848
|
+
throw error;
|
|
8799
8849
|
}
|
|
8800
8850
|
}
|
|
8801
8851
|
/** Validates and consumes the special empty-object identity response. */
|
|
@@ -9096,7 +9146,7 @@ function getSourceLoaderOptions(options) {
|
|
|
9096
9146
|
if (options == null ? void 0 : options.core) {
|
|
9097
9147
|
loadOptions.core = { ...options.core };
|
|
9098
9148
|
const parserCore = loadOptions.core;
|
|
9099
|
-
for (const key of ["type", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
9149
|
+
for (const key of ["type", "name", "attributions", "loaders", "onError", "loadOptions"]) {
|
|
9100
9150
|
delete parserCore[key];
|
|
9101
9151
|
}
|
|
9102
9152
|
if (Object.keys(parserCore).length === 0) {
|
|
@@ -9131,6 +9181,44 @@ function unavailableCoreApiMethod(methodName) {
|
|
|
9131
9181
|
);
|
|
9132
9182
|
};
|
|
9133
9183
|
}
|
|
9184
|
+
function getDataSourceName(data, options) {
|
|
9185
|
+
var _a, _b, _c;
|
|
9186
|
+
const explicitName = (_a = options.core) == null ? void 0 : _a.name;
|
|
9187
|
+
if (explicitName !== void 0) {
|
|
9188
|
+
if (typeof explicitName !== "string" || !explicitName.trim())
|
|
9189
|
+
throw new Error("Data source name must be a non-empty string.");
|
|
9190
|
+
return explicitName;
|
|
9191
|
+
}
|
|
9192
|
+
if (data && typeof data === "object") {
|
|
9193
|
+
const named = data;
|
|
9194
|
+
if (typeof named.name === "string" && named.name.trim())
|
|
9195
|
+
return data instanceof Blob ? removeFileExtension(named.name) : named.name;
|
|
9196
|
+
const metadata = (_b = named.schema) == null ? void 0 : _b.metadata;
|
|
9197
|
+
const embeddedName = metadata instanceof Map ? metadata.get("name") : metadata == null ? void 0 : metadata.name;
|
|
9198
|
+
if (typeof embeddedName === "string" && embeddedName.trim()) return embeddedName;
|
|
9199
|
+
}
|
|
9200
|
+
if (typeof data === "string") {
|
|
9201
|
+
try {
|
|
9202
|
+
const url = new URL(data.replace(/\\/g, "/"), "https://source.invalid/");
|
|
9203
|
+
if (!["data:", "blob:"].includes(url.protocol)) {
|
|
9204
|
+
let basename = url.pathname.split("/").filter(Boolean).pop();
|
|
9205
|
+
if (basename) {
|
|
9206
|
+
try {
|
|
9207
|
+
basename = decodeURIComponent(basename);
|
|
9208
|
+
} catch {
|
|
9209
|
+
}
|
|
9210
|
+
return removeFileExtension(basename);
|
|
9211
|
+
}
|
|
9212
|
+
}
|
|
9213
|
+
} catch {
|
|
9214
|
+
}
|
|
9215
|
+
}
|
|
9216
|
+
return ((_c = options.core) == null ? void 0 : _c.type) && options.core.type !== "auto" ? options.core.type : "source";
|
|
9217
|
+
}
|
|
9218
|
+
function removeFileExtension(name) {
|
|
9219
|
+
const extension = name.lastIndexOf(".");
|
|
9220
|
+
return extension > 0 ? name.slice(0, extension) : name;
|
|
9221
|
+
}
|
|
9134
9222
|
var UNAVAILABLE_CORE_API, DataSource;
|
|
9135
9223
|
var init_data_source = __esm({
|
|
9136
9224
|
"../core/src/loader-utils/lib/sources/data-source.ts"() {
|
|
@@ -9162,6 +9250,8 @@ var init_data_source = __esm({
|
|
|
9162
9250
|
options;
|
|
9163
9251
|
data;
|
|
9164
9252
|
url;
|
|
9253
|
+
/** Stable query-visible name, resolved without fetching source data. */
|
|
9254
|
+
name;
|
|
9165
9255
|
/** Shared parser options derived from the source options, excluding source-only core controls. */
|
|
9166
9256
|
loadOptions;
|
|
9167
9257
|
/** A resolved fetch function extracted from the shared core options. */
|
|
@@ -9178,6 +9268,7 @@ var init_data_source = __esm({
|
|
|
9178
9268
|
);
|
|
9179
9269
|
this.data = data;
|
|
9180
9270
|
this.url = typeof data === "string" ? resolvePath(data) : "";
|
|
9271
|
+
this.name = getDataSourceName(data, this.options);
|
|
9181
9272
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(this.options));
|
|
9182
9273
|
this.loadOptions = loadOptions;
|
|
9183
9274
|
const fetch2 = getFetchFunction(loadOptions);
|
|
@@ -9186,6 +9277,9 @@ var init_data_source = __esm({
|
|
|
9186
9277
|
this.fetch = fetch2;
|
|
9187
9278
|
}
|
|
9188
9279
|
setProps(options) {
|
|
9280
|
+
var _a;
|
|
9281
|
+
if (((_a = options.core) == null ? void 0 : _a.name) !== void 0 && options.core.name !== this.name)
|
|
9282
|
+
throw new Error("Data source names are fixed at creation.");
|
|
9189
9283
|
const mergedOptions = mergeOptions(this.options, options);
|
|
9190
9284
|
const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(mergedOptions));
|
|
9191
9285
|
this.options = mergedOptions;
|
|
@@ -15474,7 +15568,7 @@ function normalizeCOPCProjectionDefinition(projectionData) {
|
|
|
15474
15568
|
}
|
|
15475
15569
|
|
|
15476
15570
|
// dist/copc/copc-source-loader.js
|
|
15477
|
-
var VERSION4 = true ? "5.0.0-beta.
|
|
15571
|
+
var VERSION4 = true ? "5.0.0-beta.6" : "latest";
|
|
15478
15572
|
var COPC_PREFIX_CACHE_LENGTH = 65536;
|
|
15479
15573
|
var COORDINATE_SYSTEM = {
|
|
15480
15574
|
CARTESIAN: "cartesian",
|
|
@@ -16812,7 +16906,7 @@ function createCachedCOPCRangeReader(readableFile) {
|
|
|
16812
16906
|
|
|
16813
16907
|
// dist/copc/copc-writer.js
|
|
16814
16908
|
init_loader_utils();
|
|
16815
|
-
var VERSION5 = true ? "5.0.0-beta.
|
|
16909
|
+
var VERSION5 = true ? "5.0.0-beta.6" : "latest";
|
|
16816
16910
|
var LAS_1_4_HEADER_LENGTH3 = 375;
|
|
16817
16911
|
var COPC_INFO_PAYLOAD_LENGTH = 160;
|
|
16818
16912
|
var VLR_HEADER_LENGTH3 = 54;
|