@loaders.gl/geospatial 5.0.0-beta.10 → 5.0.0-beta.11
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/dbf-loader-types.cjs +1 -1
- package/dist/dbf-loader.cjs +2 -4
- package/dist/dbf-loader.cjs.map +2 -2
- package/dist/dbf-worker.js +22 -79
- package/dist/flatgeobuf/flatgeobuf-loader-types.cjs +1 -1
- package/dist/flatgeobuf/flatgeobuf-loader-types.js +1 -1
- package/dist/flatgeobuf/lib/parse-flatgeobuf.cjs +6 -20
- package/dist/flatgeobuf/lib/parse-flatgeobuf.cjs.map +2 -2
- package/dist/flatgeobuf/lib/parse-flatgeobuf.d.ts +4 -4
- package/dist/flatgeobuf/lib/parse-flatgeobuf.d.ts.map +1 -1
- package/dist/flatgeobuf/lib/parse-flatgeobuf.js +9 -22
- package/dist/flatgeobuf/lib/parse-flatgeobuf.js.map +1 -1
- package/dist/flatgeobuf-loader-types.cjs +1 -1
- package/dist/flatgeobuf-worker.js +655 -77
- package/dist/geopackage/geopackage-source-loader.cjs +1 -1
- package/dist/geopackage/geopackage-source-loader.cjs.map +2 -2
- package/dist/geopackage/geopackage-source-loader.js +1 -1
- package/dist/geopackage/geopackage-source-loader.js.map +1 -1
- package/dist/geopackage/lib/parse-geopackage.cjs +2 -6
- package/dist/geopackage/lib/parse-geopackage.cjs.map +2 -2
- package/dist/geopackage/lib/parse-geopackage.d.ts +3 -3
- package/dist/geopackage/lib/parse-geopackage.d.ts.map +1 -1
- package/dist/geopackage/lib/parse-geopackage.js +2 -6
- package/dist/geopackage/lib/parse-geopackage.js.map +1 -1
- package/dist/geopackage-source-loader.cjs +1 -1
- package/dist/geopackage-source-loader.cjs.map +2 -2
- package/dist/gpx-loader-types.cjs +1 -1
- package/dist/kml/gpx-loader-types.cjs +1 -1
- package/dist/kml/gpx-loader-types.js +1 -1
- package/dist/kml/kml-loader-types.cjs +1 -1
- package/dist/kml/kml-loader-types.js +1 -1
- package/dist/kml/kml-writer.cjs +1 -1
- package/dist/kml/kml-writer.js +1 -1
- package/dist/kml/kmz-loader-types.cjs +1 -1
- package/dist/kml/kmz-loader-types.js +1 -1
- package/dist/kml/lib/feature-collection-to-arrow.cjs +1 -1
- package/dist/kml/lib/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/kml/lib/feature-collection-to-arrow.js +1 -1
- package/dist/kml/lib/feature-collection-to-arrow.js.map +1 -1
- package/dist/kml/tcx-loader-types.cjs +1 -1
- package/dist/kml/tcx-loader-types.js +1 -1
- package/dist/kml-loader-types.cjs +1 -1
- package/dist/kml-writer.cjs +1 -1
- package/dist/kmz-loader-types.cjs +1 -1
- package/dist/shapefile/dbf-loader-types.cjs +1 -1
- package/dist/shapefile/dbf-loader-types.js +1 -1
- package/dist/shapefile/dbf-loader.cjs +2 -4
- package/dist/shapefile/dbf-loader.cjs.map +2 -2
- package/dist/shapefile/dbf-loader.d.ts.map +1 -1
- package/dist/shapefile/dbf-loader.js +3 -5
- package/dist/shapefile/dbf-loader.js.map +1 -1
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.cjs +1 -5
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.cjs.map +2 -2
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.d.ts +5 -4
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.d.ts.map +1 -1
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.js +2 -6
- package/dist/shapefile/lib/parsers/build-geoarrow-geometry-arrow.js.map +1 -1
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.cjs.map +2 -2
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.d.ts +4 -3
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.d.ts.map +1 -1
- package/dist/shapefile/lib/parsers/build-wkb-geometry-arrow.js.map +1 -1
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.cjs +7 -10
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.cjs.map +2 -2
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.d.ts +3 -3
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.d.ts.map +1 -1
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.js +11 -9
- package/dist/shapefile/lib/parsers/parse-shp-to-arrow.js.map +1 -1
- package/dist/shapefile/lib/shapefile-worker-transport.cjs +0 -3
- package/dist/shapefile/lib/shapefile-worker-transport.cjs.map +2 -2
- package/dist/shapefile/lib/shapefile-worker-transport.d.ts.map +1 -1
- package/dist/shapefile/lib/shapefile-worker-transport.js +1 -5
- package/dist/shapefile/lib/shapefile-worker-transport.js.map +1 -1
- package/dist/shapefile/shapefile-arrow-loader.cjs +53 -48
- package/dist/shapefile/shapefile-arrow-loader.cjs.map +2 -2
- package/dist/shapefile/shapefile-arrow-loader.d.ts +5 -3
- package/dist/shapefile/shapefile-arrow-loader.d.ts.map +1 -1
- package/dist/shapefile/shapefile-arrow-loader.js +54 -52
- package/dist/shapefile/shapefile-arrow-loader.js.map +1 -1
- package/dist/shapefile/shapefile-loader-types.cjs +1 -1
- package/dist/shapefile/shapefile-loader-types.d.ts +4 -4
- package/dist/shapefile/shapefile-loader-types.js +1 -1
- package/dist/shapefile/shapefile-loader.cjs +19 -55
- package/dist/shapefile/shapefile-loader.cjs.map +2 -2
- package/dist/shapefile/shapefile-loader.d.ts +5 -42
- package/dist/shapefile/shapefile-loader.d.ts.map +1 -1
- package/dist/shapefile/shapefile-loader.js +22 -64
- package/dist/shapefile/shapefile-loader.js.map +1 -1
- package/dist/shapefile/shp-loader-types.cjs +1 -1
- package/dist/shapefile/shp-loader-types.js +1 -1
- package/dist/shapefile/shp-loader.cjs +1 -44
- package/dist/shapefile/shp-loader.cjs.map +2 -2
- package/dist/shapefile/shp-loader.d.ts +1 -115
- package/dist/shapefile/shp-loader.d.ts.map +1 -1
- package/dist/shapefile/shp-loader.js +1 -48
- package/dist/shapefile/shp-loader.js.map +1 -1
- package/dist/shapefile-arrow-loader.cjs +53 -48
- package/dist/shapefile-arrow-loader.cjs.map +2 -2
- package/dist/shapefile-loader-types.cjs +1 -1
- package/dist/shapefile-loader.cjs +19 -55
- package/dist/shapefile-loader.cjs.map +2 -2
- package/dist/shapefile-worker.js +117 -272
- package/dist/shp-loader-types.cjs +1 -1
- package/dist/shp-loader.cjs +1 -44
- package/dist/shp-loader.cjs.map +2 -2
- package/dist/shp-worker.js +16964 -17085
- package/dist/tcx-loader-types.cjs +1 -1
- package/dist/wkt/lib/version.cjs +1 -1
- package/dist/wkt/lib/version.js +1 -1
- package/dist/wkt-worker.js +1 -1
- package/dist/workers/shapefile-worker.cjs +3 -3
- package/dist/workers/shapefile-worker.cjs.map +2 -2
- package/dist/workers/shapefile-worker.js +4 -4
- package/dist/workers/shapefile-worker.js.map +1 -1
- package/dist/workers/shp-worker.cjs +1 -1
- package/dist/workers/shp-worker.cjs.map +2 -2
- package/dist/workers/shp-worker.js +2 -2
- package/dist/workers/shp-worker.js.map +1 -1
- package/package.json +6 -6
- package/src/flatgeobuf/lib/parse-flatgeobuf.ts +15 -33
- package/src/geopackage/geopackage-source-loader.ts +1 -1
- package/src/geopackage/lib/parse-geopackage.ts +4 -9
- package/src/kml/lib/feature-collection-to-arrow.ts +1 -1
- package/src/shapefile/dbf-loader.ts +4 -7
- package/src/shapefile/lib/parsers/build-geoarrow-geometry-arrow.ts +5 -9
- package/src/shapefile/lib/parsers/build-wkb-geometry-arrow.ts +4 -3
- package/src/shapefile/lib/parsers/parse-shp-to-arrow.ts +14 -20
- package/src/shapefile/lib/shapefile-worker-transport.ts +1 -6
- package/src/shapefile/shapefile-arrow-loader.ts +76 -70
- package/src/shapefile/shapefile-loader.ts +40 -90
- package/src/shapefile/shp-loader.ts +7 -61
- package/src/workers/shapefile-worker.ts +4 -4
- package/src/workers/shp-worker.ts +2 -2
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
"../core/src/loader-utils/lib/log-utils/log.ts"() {
|
|
719
719
|
"use strict";
|
|
720
720
|
init_log();
|
|
721
|
-
VERSION2 = true ? "5.0.0-beta.
|
|
721
|
+
VERSION2 = true ? "5.0.0-beta.11" : "latest";
|
|
722
722
|
version = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
723
723
|
log2 = createLog();
|
|
724
724
|
NullLog = class {
|
|
@@ -3390,6 +3390,7 @@
|
|
|
3390
3390
|
columns: Object.freeze(columns),
|
|
3391
3391
|
capabilities: queryCapabilities,
|
|
3392
3392
|
queryCapabilities,
|
|
3393
|
+
...options.hasDefaultRowWindow ? { hasDefaultRowWindow: true } : {},
|
|
3393
3394
|
spatial: options.spatial ? Object.freeze({
|
|
3394
3395
|
...options.spatial,
|
|
3395
3396
|
bounds: options.spatial.bounds ? Object.freeze({
|
|
@@ -3719,6 +3720,31 @@
|
|
|
3719
3720
|
}
|
|
3720
3721
|
});
|
|
3721
3722
|
|
|
3723
|
+
// ../../node_modules/@math.gl/core/dist/types/float16.js
|
|
3724
|
+
function getFloat16ArrayConstructor() {
|
|
3725
|
+
return NativeFloat16ArrayConstructor ?? Uint16Array;
|
|
3726
|
+
}
|
|
3727
|
+
var NativeFloat16ArrayConstructor;
|
|
3728
|
+
var init_float16 = __esm({
|
|
3729
|
+
"../../node_modules/@math.gl/core/dist/types/float16.js"() {
|
|
3730
|
+
NativeFloat16ArrayConstructor = globalThis.Float16Array;
|
|
3731
|
+
}
|
|
3732
|
+
});
|
|
3733
|
+
|
|
3734
|
+
// ../../node_modules/@math.gl/core/dist/types/index.js
|
|
3735
|
+
var init_types = __esm({
|
|
3736
|
+
"../../node_modules/@math.gl/core/dist/types/index.js"() {
|
|
3737
|
+
init_float16();
|
|
3738
|
+
}
|
|
3739
|
+
});
|
|
3740
|
+
|
|
3741
|
+
// ../../node_modules/@math.gl/core/dist/types.js
|
|
3742
|
+
var init_types2 = __esm({
|
|
3743
|
+
"../../node_modules/@math.gl/core/dist/types.js"() {
|
|
3744
|
+
init_types();
|
|
3745
|
+
}
|
|
3746
|
+
});
|
|
3747
|
+
|
|
3722
3748
|
// ../../node_modules/@math.gl/core/dist/mat3.js
|
|
3723
3749
|
var init_mat32 = __esm({
|
|
3724
3750
|
"../../node_modules/@math.gl/core/dist/mat3.js"() {
|
|
@@ -3766,6 +3792,7 @@
|
|
|
3766
3792
|
"../../node_modules/@math.gl/core/dist/index.js"() {
|
|
3767
3793
|
init_math_utils();
|
|
3768
3794
|
init_spheroid();
|
|
3795
|
+
init_types2();
|
|
3769
3796
|
init_mat32();
|
|
3770
3797
|
init_mat42();
|
|
3771
3798
|
init_quat2();
|
|
@@ -7473,6 +7500,100 @@
|
|
|
7473
7500
|
}
|
|
7474
7501
|
});
|
|
7475
7502
|
|
|
7503
|
+
// ../core/src/schema-utils/lib/schema/data-type.ts
|
|
7504
|
+
function getDataTypeFromValue(value2, defaultNumberType = "float32") {
|
|
7505
|
+
if (value2 instanceof Date) {
|
|
7506
|
+
return "date-millisecond";
|
|
7507
|
+
}
|
|
7508
|
+
if (typeof value2 === "number") {
|
|
7509
|
+
return defaultNumberType;
|
|
7510
|
+
}
|
|
7511
|
+
if (typeof value2 === "boolean") {
|
|
7512
|
+
return "bool";
|
|
7513
|
+
}
|
|
7514
|
+
if (typeof value2 === "string") {
|
|
7515
|
+
return "utf8";
|
|
7516
|
+
}
|
|
7517
|
+
if (value2 === null || value2 === "undefined") {
|
|
7518
|
+
return "null";
|
|
7519
|
+
}
|
|
7520
|
+
return "null";
|
|
7521
|
+
}
|
|
7522
|
+
function getDataTypeFromArray(array2) {
|
|
7523
|
+
let type = getDataTypeFromTypedArray(array2);
|
|
7524
|
+
if (type !== "null") {
|
|
7525
|
+
return { type, nullable: false };
|
|
7526
|
+
}
|
|
7527
|
+
if (array2.length > 0) {
|
|
7528
|
+
type = getDataTypeFromValue(array2[0]);
|
|
7529
|
+
return { type, nullable: true };
|
|
7530
|
+
}
|
|
7531
|
+
return { type: "null", nullable: true };
|
|
7532
|
+
}
|
|
7533
|
+
function getDataTypeFromTypedArray(array2) {
|
|
7534
|
+
if (typeof Float16Array !== "undefined" && array2 instanceof Float16Array) {
|
|
7535
|
+
return "float16";
|
|
7536
|
+
}
|
|
7537
|
+
switch (array2.constructor) {
|
|
7538
|
+
case Int8Array:
|
|
7539
|
+
return "int8";
|
|
7540
|
+
case Uint8Array:
|
|
7541
|
+
case Uint8ClampedArray:
|
|
7542
|
+
return "uint8";
|
|
7543
|
+
case Int16Array:
|
|
7544
|
+
return "int16";
|
|
7545
|
+
case Uint16Array:
|
|
7546
|
+
return "uint16";
|
|
7547
|
+
case Int32Array:
|
|
7548
|
+
return "int32";
|
|
7549
|
+
case Uint32Array:
|
|
7550
|
+
return "uint32";
|
|
7551
|
+
case BigInt64Array:
|
|
7552
|
+
return "int64";
|
|
7553
|
+
case BigUint64Array:
|
|
7554
|
+
return "uint64";
|
|
7555
|
+
case Float32Array:
|
|
7556
|
+
return "float32";
|
|
7557
|
+
case Float64Array:
|
|
7558
|
+
return "float64";
|
|
7559
|
+
default:
|
|
7560
|
+
return "null";
|
|
7561
|
+
}
|
|
7562
|
+
}
|
|
7563
|
+
function getArrayTypeFromDataType(type, nullable) {
|
|
7564
|
+
if (!nullable) {
|
|
7565
|
+
switch (type) {
|
|
7566
|
+
case "int8":
|
|
7567
|
+
return Int8Array;
|
|
7568
|
+
case "uint8":
|
|
7569
|
+
return Uint8Array;
|
|
7570
|
+
case "int16":
|
|
7571
|
+
return Int16Array;
|
|
7572
|
+
case "uint16":
|
|
7573
|
+
return Uint16Array;
|
|
7574
|
+
case "int32":
|
|
7575
|
+
return Int32Array;
|
|
7576
|
+
case "uint32":
|
|
7577
|
+
return Uint32Array;
|
|
7578
|
+
case "float32":
|
|
7579
|
+
return Float32Array;
|
|
7580
|
+
case "float64":
|
|
7581
|
+
return Float64Array;
|
|
7582
|
+
case "float16":
|
|
7583
|
+
return getFloat16ArrayConstructor();
|
|
7584
|
+
default:
|
|
7585
|
+
break;
|
|
7586
|
+
}
|
|
7587
|
+
}
|
|
7588
|
+
return Array;
|
|
7589
|
+
}
|
|
7590
|
+
var init_data_type = __esm({
|
|
7591
|
+
"../core/src/schema-utils/lib/schema/data-type.ts"() {
|
|
7592
|
+
"use strict";
|
|
7593
|
+
init_dist2();
|
|
7594
|
+
}
|
|
7595
|
+
});
|
|
7596
|
+
|
|
7476
7597
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
7477
7598
|
function __rest(s, e) {
|
|
7478
7599
|
var t = {};
|
|
@@ -22814,6 +22935,91 @@ return true;`);
|
|
|
22814
22935
|
}
|
|
22815
22936
|
});
|
|
22816
22937
|
|
|
22938
|
+
// ../core/src/schema-utils/lib/schema/deduce-table-schema.ts
|
|
22939
|
+
function deduceTableSchema(table) {
|
|
22940
|
+
if (!("shape" in table)) return convertArrowToSchema(table.schema);
|
|
22941
|
+
switch (table.shape) {
|
|
22942
|
+
case "array-row-table":
|
|
22943
|
+
case "object-row-table":
|
|
22944
|
+
return deduceSchemaFromRows(table.data);
|
|
22945
|
+
case "geojson-table":
|
|
22946
|
+
return deduceSchemaFromGeoJSON(table.features);
|
|
22947
|
+
case "columnar-table":
|
|
22948
|
+
return deduceSchemaFromColumns(table.data);
|
|
22949
|
+
default:
|
|
22950
|
+
throw new Error("Deduce schema");
|
|
22951
|
+
}
|
|
22952
|
+
}
|
|
22953
|
+
function deduceSchemaFromColumns(columnarTable) {
|
|
22954
|
+
const fields = [];
|
|
22955
|
+
for (const [columnName, column] of Object.entries(columnarTable)) {
|
|
22956
|
+
const field = deduceFieldFromColumn(column, columnName);
|
|
22957
|
+
fields.push(field);
|
|
22958
|
+
}
|
|
22959
|
+
return { fields, metadata: {} };
|
|
22960
|
+
}
|
|
22961
|
+
function deduceSchemaFromRows(rowTable) {
|
|
22962
|
+
if (!rowTable.length) {
|
|
22963
|
+
throw new Error("deduce from empty table");
|
|
22964
|
+
}
|
|
22965
|
+
const fields = [];
|
|
22966
|
+
const row0 = rowTable[0];
|
|
22967
|
+
for (const [columnName, value2] of Object.entries(row0)) {
|
|
22968
|
+
const name = Array.isArray(row0) ? `column${Number(columnName) + 1}` : columnName;
|
|
22969
|
+
fields.push(deduceFieldFromValue(value2, name));
|
|
22970
|
+
}
|
|
22971
|
+
return { fields, metadata: {} };
|
|
22972
|
+
}
|
|
22973
|
+
function deduceSchemaFromGeoJSON(features) {
|
|
22974
|
+
if (!features.length) {
|
|
22975
|
+
throw new Error("deduce from empty table");
|
|
22976
|
+
}
|
|
22977
|
+
const fields = [];
|
|
22978
|
+
const row0 = features[0].properties || {};
|
|
22979
|
+
for (const [columnName, value2] of Object.entries(row0)) {
|
|
22980
|
+
fields.push(deduceFieldFromValue(value2, columnName));
|
|
22981
|
+
}
|
|
22982
|
+
return { fields, metadata: {} };
|
|
22983
|
+
}
|
|
22984
|
+
function deduceFieldFromColumn(column, name) {
|
|
22985
|
+
if (ArrayBuffer.isView(column)) {
|
|
22986
|
+
const type = getDataTypeFromArray(column);
|
|
22987
|
+
return {
|
|
22988
|
+
name,
|
|
22989
|
+
type: type.type || "null",
|
|
22990
|
+
nullable: type.nullable
|
|
22991
|
+
// metadata: {}
|
|
22992
|
+
};
|
|
22993
|
+
}
|
|
22994
|
+
if (Array.isArray(column) && column.length > 0) {
|
|
22995
|
+
const value2 = column[0];
|
|
22996
|
+
const type = getDataTypeFromValue(value2);
|
|
22997
|
+
return {
|
|
22998
|
+
name,
|
|
22999
|
+
type,
|
|
23000
|
+
nullable: true
|
|
23001
|
+
// metadata: {},
|
|
23002
|
+
};
|
|
23003
|
+
}
|
|
23004
|
+
throw new Error("empty table");
|
|
23005
|
+
}
|
|
23006
|
+
function deduceFieldFromValue(value2, name) {
|
|
23007
|
+
const type = getDataTypeFromValue(value2);
|
|
23008
|
+
return {
|
|
23009
|
+
name,
|
|
23010
|
+
type,
|
|
23011
|
+
nullable: true
|
|
23012
|
+
// metadata: {}
|
|
23013
|
+
};
|
|
23014
|
+
}
|
|
23015
|
+
var init_deduce_table_schema = __esm({
|
|
23016
|
+
"../core/src/schema-utils/lib/schema/deduce-table-schema.ts"() {
|
|
23017
|
+
"use strict";
|
|
23018
|
+
init_convert_arrow_schema();
|
|
23019
|
+
init_data_type();
|
|
23020
|
+
}
|
|
23021
|
+
});
|
|
23022
|
+
|
|
22817
23023
|
// ../core/src/schema-utils/lib/arrow/arrow-metadata.ts
|
|
22818
23024
|
function snapshotArrowSchema(schema) {
|
|
22819
23025
|
return deserializeArrowSchema(serializeArrowSchema(schema));
|
|
@@ -22829,6 +23035,413 @@ return true;`);
|
|
|
22829
23035
|
}
|
|
22830
23036
|
});
|
|
22831
23037
|
|
|
23038
|
+
// ../core/src/schema-utils/lib/table/tables/table-accessors.ts
|
|
23039
|
+
function getTableLength(table) {
|
|
23040
|
+
if (!("shape" in table)) return table.numRows;
|
|
23041
|
+
switch (table.shape) {
|
|
23042
|
+
case "array-row-table":
|
|
23043
|
+
case "object-row-table":
|
|
23044
|
+
return table.data.length;
|
|
23045
|
+
case "geojson-table":
|
|
23046
|
+
return table.features.length;
|
|
23047
|
+
case "columnar-table":
|
|
23048
|
+
for (const column of Object.values(table.data)) {
|
|
23049
|
+
return column.length || 0;
|
|
23050
|
+
}
|
|
23051
|
+
return 0;
|
|
23052
|
+
default:
|
|
23053
|
+
throw new Error("table");
|
|
23054
|
+
}
|
|
23055
|
+
}
|
|
23056
|
+
function getTableNumCols(table) {
|
|
23057
|
+
if (!("shape" in table)) return table.numCols;
|
|
23058
|
+
if (table.schema) {
|
|
23059
|
+
return table.schema.fields.length;
|
|
23060
|
+
}
|
|
23061
|
+
if (getTableLength(table) === 0) {
|
|
23062
|
+
throw new Error("empty table");
|
|
23063
|
+
}
|
|
23064
|
+
switch (table.shape) {
|
|
23065
|
+
case "array-row-table":
|
|
23066
|
+
return table.data[0].length;
|
|
23067
|
+
case "object-row-table":
|
|
23068
|
+
return Object.keys(table.data[0]).length;
|
|
23069
|
+
case "geojson-table":
|
|
23070
|
+
return Object.keys(table.features[0]).length;
|
|
23071
|
+
case "columnar-table":
|
|
23072
|
+
return Object.keys(table.data).length;
|
|
23073
|
+
default:
|
|
23074
|
+
throw new Error("table");
|
|
23075
|
+
}
|
|
23076
|
+
}
|
|
23077
|
+
function getTableCell(table, rowIndex, columnName) {
|
|
23078
|
+
if (!("shape" in table)) return table.getChild(columnName)?.get(rowIndex);
|
|
23079
|
+
switch (table.shape) {
|
|
23080
|
+
case "array-row-table":
|
|
23081
|
+
const columnIndex = getTableColumnIndex(table, columnName);
|
|
23082
|
+
return table.data[rowIndex][columnIndex];
|
|
23083
|
+
case "object-row-table":
|
|
23084
|
+
return table.data[rowIndex][columnName];
|
|
23085
|
+
case "geojson-table":
|
|
23086
|
+
return table.features[rowIndex][columnName];
|
|
23087
|
+
case "columnar-table":
|
|
23088
|
+
const column = table.data[columnName];
|
|
23089
|
+
return column[rowIndex];
|
|
23090
|
+
default:
|
|
23091
|
+
throw new Error("todo");
|
|
23092
|
+
}
|
|
23093
|
+
}
|
|
23094
|
+
function getTableCellAt(table, rowIndex, columnIndex) {
|
|
23095
|
+
if (!("shape" in table)) return table.getChildAt(columnIndex)?.get(rowIndex);
|
|
23096
|
+
switch (table.shape) {
|
|
23097
|
+
case "array-row-table":
|
|
23098
|
+
return table.data[rowIndex][columnIndex];
|
|
23099
|
+
case "object-row-table":
|
|
23100
|
+
const columnName1 = getTableColumnName(table, columnIndex);
|
|
23101
|
+
return table.data[rowIndex][columnName1];
|
|
23102
|
+
case "geojson-table":
|
|
23103
|
+
const columnName2 = getTableColumnName(table, columnIndex);
|
|
23104
|
+
return table.features[rowIndex][columnName2];
|
|
23105
|
+
case "columnar-table":
|
|
23106
|
+
const columnName3 = getTableColumnName(table, columnIndex);
|
|
23107
|
+
const column = table.data[columnName3];
|
|
23108
|
+
return column[rowIndex];
|
|
23109
|
+
default:
|
|
23110
|
+
throw new Error("todo");
|
|
23111
|
+
}
|
|
23112
|
+
}
|
|
23113
|
+
function getTableColumnIndex(table, columnName) {
|
|
23114
|
+
const columnIndex = table.schema?.fields.findIndex((field) => field.name === columnName);
|
|
23115
|
+
if (columnIndex === void 0) {
|
|
23116
|
+
throw new Error(columnName);
|
|
23117
|
+
}
|
|
23118
|
+
return columnIndex;
|
|
23119
|
+
}
|
|
23120
|
+
function getTableColumnName(table, columnIndex) {
|
|
23121
|
+
const columnName = table.schema?.fields[columnIndex]?.name;
|
|
23122
|
+
if (!columnName) {
|
|
23123
|
+
throw new Error(`${columnIndex}`);
|
|
23124
|
+
}
|
|
23125
|
+
return columnName;
|
|
23126
|
+
}
|
|
23127
|
+
function getTableRowAsObject(table, rowIndex, target, copy) {
|
|
23128
|
+
if (!("shape" in table)) {
|
|
23129
|
+
const objectRow = target || {};
|
|
23130
|
+
const row = table.get(rowIndex);
|
|
23131
|
+
for (const field of table.schema.fields) objectRow[field.name] = row?.[field.name];
|
|
23132
|
+
return objectRow;
|
|
23133
|
+
}
|
|
23134
|
+
switch (table.shape) {
|
|
23135
|
+
case "object-row-table":
|
|
23136
|
+
return copy ? Object.fromEntries(Object.entries(table.data[rowIndex])) : table.data[rowIndex];
|
|
23137
|
+
case "array-row-table":
|
|
23138
|
+
if (table.schema) {
|
|
23139
|
+
const objectRow = target || {};
|
|
23140
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23141
|
+
objectRow[table.schema.fields[i].name] = table.data[rowIndex][i];
|
|
23142
|
+
}
|
|
23143
|
+
return objectRow;
|
|
23144
|
+
}
|
|
23145
|
+
throw new Error("no schema");
|
|
23146
|
+
case "geojson-table":
|
|
23147
|
+
if (table.schema) {
|
|
23148
|
+
const objectRow = target || {};
|
|
23149
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23150
|
+
objectRow[table.schema.fields[i].name] = table.features[rowIndex][table.schema.fields[i].name];
|
|
23151
|
+
}
|
|
23152
|
+
return objectRow;
|
|
23153
|
+
}
|
|
23154
|
+
throw new Error("no schema");
|
|
23155
|
+
case "columnar-table":
|
|
23156
|
+
if (table.schema) {
|
|
23157
|
+
const objectRow = target || {};
|
|
23158
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23159
|
+
objectRow[table.schema.fields[i].name] = table.data[table.schema.fields[i].name][rowIndex];
|
|
23160
|
+
}
|
|
23161
|
+
return objectRow;
|
|
23162
|
+
} else {
|
|
23163
|
+
const objectRow = target || {};
|
|
23164
|
+
for (const [name, column] of Object.entries(table.data)) {
|
|
23165
|
+
objectRow[name] = column[rowIndex];
|
|
23166
|
+
}
|
|
23167
|
+
return objectRow;
|
|
23168
|
+
}
|
|
23169
|
+
default:
|
|
23170
|
+
throw new Error("shape");
|
|
23171
|
+
}
|
|
23172
|
+
}
|
|
23173
|
+
function getTableRowAsArray(table, rowIndex, target, copy) {
|
|
23174
|
+
if (!("shape" in table)) {
|
|
23175
|
+
const arrayRow = target || [];
|
|
23176
|
+
const row = table.get(rowIndex);
|
|
23177
|
+
table.schema.fields.forEach((field, columnIndex) => {
|
|
23178
|
+
arrayRow[columnIndex] = row?.[field.name];
|
|
23179
|
+
});
|
|
23180
|
+
return arrayRow;
|
|
23181
|
+
}
|
|
23182
|
+
switch (table.shape) {
|
|
23183
|
+
case "array-row-table":
|
|
23184
|
+
return copy ? Array.from(table.data[rowIndex]) : table.data[rowIndex];
|
|
23185
|
+
case "object-row-table":
|
|
23186
|
+
if (table.schema) {
|
|
23187
|
+
const arrayRow = target || [];
|
|
23188
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23189
|
+
arrayRow[i] = table.data[rowIndex][table.schema.fields[i].name];
|
|
23190
|
+
}
|
|
23191
|
+
return arrayRow;
|
|
23192
|
+
}
|
|
23193
|
+
return Object.values(table.data[rowIndex]);
|
|
23194
|
+
case "geojson-table":
|
|
23195
|
+
if (table.schema) {
|
|
23196
|
+
const arrayRow = target || [];
|
|
23197
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23198
|
+
arrayRow[i] = table.features[rowIndex][table.schema.fields[i].name];
|
|
23199
|
+
}
|
|
23200
|
+
return arrayRow;
|
|
23201
|
+
}
|
|
23202
|
+
return Object.values(table.features[rowIndex]);
|
|
23203
|
+
case "columnar-table":
|
|
23204
|
+
if (table.schema) {
|
|
23205
|
+
const arrayRow = target || [];
|
|
23206
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
23207
|
+
arrayRow[i] = table.data[table.schema.fields[i].name][rowIndex];
|
|
23208
|
+
}
|
|
23209
|
+
return arrayRow;
|
|
23210
|
+
} else {
|
|
23211
|
+
const arrayRow = target || [];
|
|
23212
|
+
let i = 0;
|
|
23213
|
+
for (const column of Object.values(table.data)) {
|
|
23214
|
+
arrayRow[i] = column[rowIndex];
|
|
23215
|
+
i++;
|
|
23216
|
+
}
|
|
23217
|
+
return arrayRow;
|
|
23218
|
+
}
|
|
23219
|
+
default:
|
|
23220
|
+
throw new Error("shape");
|
|
23221
|
+
}
|
|
23222
|
+
}
|
|
23223
|
+
var init_table_accessors = __esm({
|
|
23224
|
+
"../core/src/schema-utils/lib/table/tables/table-accessors.ts"() {
|
|
23225
|
+
"use strict";
|
|
23226
|
+
}
|
|
23227
|
+
});
|
|
23228
|
+
|
|
23229
|
+
// ../core/src/schema-utils/lib/table/tables/table-column.ts
|
|
23230
|
+
function makeColumnFromField(field, length) {
|
|
23231
|
+
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
23232
|
+
return new ArrayType(length);
|
|
23233
|
+
}
|
|
23234
|
+
var init_table_column = __esm({
|
|
23235
|
+
"../core/src/schema-utils/lib/table/tables/table-column.ts"() {
|
|
23236
|
+
"use strict";
|
|
23237
|
+
init_data_type();
|
|
23238
|
+
}
|
|
23239
|
+
});
|
|
23240
|
+
|
|
23241
|
+
// ../core/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts
|
|
23242
|
+
function* makePortableTableRecordBatchIterator(table, options) {
|
|
23243
|
+
const arrowSchema = convertSchemaToArrow(table.schema);
|
|
23244
|
+
const length = getTableLength(table);
|
|
23245
|
+
const numColumns = getTableNumCols(table);
|
|
23246
|
+
const batchSize = options?.batchSize || length;
|
|
23247
|
+
const builders = arrowSchema?.fields.map(
|
|
23248
|
+
(arrowField) => makeBuilder({
|
|
23249
|
+
type: arrowField.type,
|
|
23250
|
+
nullValues: [null, void 0]
|
|
23251
|
+
})
|
|
23252
|
+
);
|
|
23253
|
+
const structField = new Struct(arrowSchema.fields);
|
|
23254
|
+
let batchLength = 0;
|
|
23255
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
23256
|
+
for (let columnIndex = 0; columnIndex < numColumns; ++columnIndex) {
|
|
23257
|
+
const value2 = getTableCellAt(table, rowIndex, columnIndex);
|
|
23258
|
+
const builder = builders[columnIndex];
|
|
23259
|
+
builder.append(value2);
|
|
23260
|
+
}
|
|
23261
|
+
batchLength++;
|
|
23262
|
+
if (batchLength >= batchSize) {
|
|
23263
|
+
const datas = builders.map((builder) => builder.flush());
|
|
23264
|
+
const structData = new Data(structField, 0, batchLength, 0, void 0, datas);
|
|
23265
|
+
yield new RecordBatch3(arrowSchema, structData);
|
|
23266
|
+
batchLength = 0;
|
|
23267
|
+
}
|
|
23268
|
+
}
|
|
23269
|
+
if (batchLength > 0) {
|
|
23270
|
+
const datas = builders.map((builder) => builder.flush());
|
|
23271
|
+
const structData = new Data(structField, 0, batchLength, 0, void 0, datas);
|
|
23272
|
+
yield new RecordBatch3(arrowSchema, structData);
|
|
23273
|
+
batchLength = 0;
|
|
23274
|
+
}
|
|
23275
|
+
builders.map((builder) => builder.finish());
|
|
23276
|
+
}
|
|
23277
|
+
var init_make_arrow_batch_iterator = __esm({
|
|
23278
|
+
"../core/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"() {
|
|
23279
|
+
"use strict";
|
|
23280
|
+
init_Arrow_dom();
|
|
23281
|
+
init_convert_arrow_schema();
|
|
23282
|
+
init_table_accessors();
|
|
23283
|
+
}
|
|
23284
|
+
});
|
|
23285
|
+
|
|
23286
|
+
// ../core/src/schema-utils/lib/table/tables/convert-arrow-table.ts
|
|
23287
|
+
function convertTableToArrow(table, options) {
|
|
23288
|
+
if (!("shape" in table)) return table;
|
|
23289
|
+
const schema = table.schema ?? deduceTableSchema(table);
|
|
23290
|
+
return new Table(convertSchemaToArrow(schema), [
|
|
23291
|
+
...makePortableTableRecordBatchIterator({ ...table, schema }, options)
|
|
23292
|
+
]);
|
|
23293
|
+
}
|
|
23294
|
+
function convertArrowToTable(arrowTable, shape) {
|
|
23295
|
+
switch (shape) {
|
|
23296
|
+
case "arrow":
|
|
23297
|
+
return arrowTable;
|
|
23298
|
+
case "array-row-table":
|
|
23299
|
+
return convertArrowToArrayRowTable(arrowTable);
|
|
23300
|
+
case "object-row-table":
|
|
23301
|
+
return convertArrowToObjectRowTable(arrowTable);
|
|
23302
|
+
case "columnar-table":
|
|
23303
|
+
return convertArrowToColumnarTable(arrowTable);
|
|
23304
|
+
case "geojson-table":
|
|
23305
|
+
return convertArrowToGeoJSONTable(arrowTable);
|
|
23306
|
+
default:
|
|
23307
|
+
throw new Error(shape);
|
|
23308
|
+
}
|
|
23309
|
+
}
|
|
23310
|
+
function convertArrowToArrayRowTable(arrowTable) {
|
|
23311
|
+
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
23312
|
+
return convertTable(columnarTable, "array-row-table");
|
|
23313
|
+
}
|
|
23314
|
+
function convertArrowToObjectRowTable(arrowTable) {
|
|
23315
|
+
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
23316
|
+
return convertTable(columnarTable, "object-row-table");
|
|
23317
|
+
}
|
|
23318
|
+
function convertArrowToColumnarTable(arrowTable) {
|
|
23319
|
+
const columns = {};
|
|
23320
|
+
for (const field of arrowTable.schema.fields) {
|
|
23321
|
+
const arrowColumn = arrowTable.getChild(field.name);
|
|
23322
|
+
const values = arrowColumn?.toArray();
|
|
23323
|
+
columns[field.name] = values;
|
|
23324
|
+
}
|
|
23325
|
+
const schema = convertArrowToSchema(arrowTable.schema);
|
|
23326
|
+
return {
|
|
23327
|
+
shape: "columnar-table",
|
|
23328
|
+
schema,
|
|
23329
|
+
data: columns
|
|
23330
|
+
};
|
|
23331
|
+
}
|
|
23332
|
+
function convertArrowToGeoJSONTable(arrowTable) {
|
|
23333
|
+
const schema = convertArrowToSchema(arrowTable.schema);
|
|
23334
|
+
const features = [];
|
|
23335
|
+
for (let row = 0; row < arrowTable.numRows; row++) {
|
|
23336
|
+
const properties = arrowTable.get(row)?.toJSON() || {};
|
|
23337
|
+
features.push({ type: "Feature", geometry: null, properties });
|
|
23338
|
+
}
|
|
23339
|
+
return {
|
|
23340
|
+
shape: "geojson-table",
|
|
23341
|
+
type: "FeatureCollection",
|
|
23342
|
+
schema,
|
|
23343
|
+
features
|
|
23344
|
+
};
|
|
23345
|
+
}
|
|
23346
|
+
var init_convert_arrow_table = __esm({
|
|
23347
|
+
"../core/src/schema-utils/lib/table/tables/convert-arrow-table.ts"() {
|
|
23348
|
+
"use strict";
|
|
23349
|
+
init_Arrow_dom();
|
|
23350
|
+
init_convert_table();
|
|
23351
|
+
init_deduce_table_schema();
|
|
23352
|
+
init_convert_arrow_schema();
|
|
23353
|
+
init_make_arrow_batch_iterator();
|
|
23354
|
+
}
|
|
23355
|
+
});
|
|
23356
|
+
|
|
23357
|
+
// ../core/src/schema-utils/lib/table/tables/convert-table.ts
|
|
23358
|
+
function convertTable(table, shape) {
|
|
23359
|
+
if (shape === "arrow") return convertTableToArrow(table);
|
|
23360
|
+
if (!("shape" in table)) return convertArrowToTable(table, shape);
|
|
23361
|
+
switch (shape) {
|
|
23362
|
+
case "object-row-table":
|
|
23363
|
+
return convertToObjectRowTable(table);
|
|
23364
|
+
case "array-row-table":
|
|
23365
|
+
return convertToArrayRowTable(table);
|
|
23366
|
+
case "columnar-table":
|
|
23367
|
+
return convertToColumnarTable(table);
|
|
23368
|
+
default:
|
|
23369
|
+
throw new Error(shape);
|
|
23370
|
+
}
|
|
23371
|
+
}
|
|
23372
|
+
function convertToColumnarTable(table) {
|
|
23373
|
+
const schema = table.schema || deduceTableSchema(table);
|
|
23374
|
+
const fields = schema.fields;
|
|
23375
|
+
if (table.shape === "columnar-table") {
|
|
23376
|
+
return { ...table, schema };
|
|
23377
|
+
}
|
|
23378
|
+
const length = getTableLength(table);
|
|
23379
|
+
const columns = {};
|
|
23380
|
+
for (const field of fields) {
|
|
23381
|
+
const column = makeColumnFromField(field, length);
|
|
23382
|
+
columns[field.name] = column;
|
|
23383
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
23384
|
+
column[rowIndex] = getTableCell(table, rowIndex, field.name);
|
|
23385
|
+
}
|
|
23386
|
+
}
|
|
23387
|
+
return {
|
|
23388
|
+
shape: "columnar-table",
|
|
23389
|
+
schema,
|
|
23390
|
+
data: columns
|
|
23391
|
+
};
|
|
23392
|
+
}
|
|
23393
|
+
function convertToArrayRowTable(table) {
|
|
23394
|
+
if (table.shape === "array-row-table") {
|
|
23395
|
+
return table;
|
|
23396
|
+
}
|
|
23397
|
+
const length = getTableLength(table);
|
|
23398
|
+
const data = new Array(length);
|
|
23399
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
23400
|
+
data[rowIndex] = getTableRowAsArray(table, rowIndex);
|
|
23401
|
+
}
|
|
23402
|
+
return {
|
|
23403
|
+
shape: "array-row-table",
|
|
23404
|
+
schema: table.schema,
|
|
23405
|
+
data
|
|
23406
|
+
};
|
|
23407
|
+
}
|
|
23408
|
+
function convertToObjectRowTable(table) {
|
|
23409
|
+
if (table.shape === "object-row-table") {
|
|
23410
|
+
return table;
|
|
23411
|
+
}
|
|
23412
|
+
const length = getTableLength(table);
|
|
23413
|
+
const data = new Array(length);
|
|
23414
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
23415
|
+
data[rowIndex] = getTableRowAsObject(table, rowIndex);
|
|
23416
|
+
}
|
|
23417
|
+
return {
|
|
23418
|
+
shape: "object-row-table",
|
|
23419
|
+
schema: table.schema,
|
|
23420
|
+
data
|
|
23421
|
+
};
|
|
23422
|
+
}
|
|
23423
|
+
var init_convert_table = __esm({
|
|
23424
|
+
"../core/src/schema-utils/lib/table/tables/convert-table.ts"() {
|
|
23425
|
+
"use strict";
|
|
23426
|
+
init_table_accessors();
|
|
23427
|
+
init_deduce_table_schema();
|
|
23428
|
+
init_table_column();
|
|
23429
|
+
init_convert_arrow_table();
|
|
23430
|
+
}
|
|
23431
|
+
});
|
|
23432
|
+
|
|
23433
|
+
// ../core/src/schema-utils/deprecated.ts
|
|
23434
|
+
var convertArrowToTable2;
|
|
23435
|
+
var init_deprecated = __esm({
|
|
23436
|
+
"../core/src/schema-utils/deprecated.ts"() {
|
|
23437
|
+
"use strict";
|
|
23438
|
+
init_convert_arrow_table();
|
|
23439
|
+
convertArrowToTable2 = ((...args) => convertArrowToTable(
|
|
23440
|
+
...args
|
|
23441
|
+
));
|
|
23442
|
+
}
|
|
23443
|
+
});
|
|
23444
|
+
|
|
22832
23445
|
// ../core/src/schema-utils/lib/table/query-arrow-table.ts
|
|
22833
23446
|
function queryArrowTable(table, options = {}, filterRows) {
|
|
22834
23447
|
const availableColumns = table.schema.fields.map((field) => field.name);
|
|
@@ -23019,6 +23632,7 @@ return true;`);
|
|
|
23019
23632
|
"../core/src/schema-utils/index.ts"() {
|
|
23020
23633
|
"use strict";
|
|
23021
23634
|
init_convert_arrow_schema();
|
|
23635
|
+
init_deprecated();
|
|
23022
23636
|
init_query_arrow_table();
|
|
23023
23637
|
init_arrow_table_builder();
|
|
23024
23638
|
init_arrow_metadata();
|
|
@@ -23123,7 +23737,7 @@ return true;`);
|
|
|
23123
23737
|
throw new TypeScriptCRSError("missing-transform-stage", message);
|
|
23124
23738
|
}
|
|
23125
23739
|
var _a5, CRS_ERROR, TypeScriptCRSError;
|
|
23126
|
-
var
|
|
23740
|
+
var init_types3 = __esm({
|
|
23127
23741
|
"../../node_modules/@math.gl/geospatial/dist/projection/experimental/crs/types.js"() {
|
|
23128
23742
|
CRS_ERROR = /* @__PURE__ */ Symbol.for("@math.gl/projection/TypeScriptCRSError");
|
|
23129
23743
|
TypeScriptCRSError = class _TypeScriptCRSError extends Error {
|
|
@@ -23217,7 +23831,7 @@ return true;`);
|
|
|
23217
23831
|
}
|
|
23218
23832
|
var init_spatial_reference2 = __esm({
|
|
23219
23833
|
"../../node_modules/@math.gl/geospatial/dist/projection/experimental/crs/spatial-reference.js"() {
|
|
23220
|
-
|
|
23834
|
+
init_types3();
|
|
23221
23835
|
}
|
|
23222
23836
|
});
|
|
23223
23837
|
|
|
@@ -23727,7 +24341,7 @@ return true;`);
|
|
|
23727
24341
|
init_ellipsoid_table();
|
|
23728
24342
|
init_primemeridian_table();
|
|
23729
24343
|
init_crs_metadata();
|
|
23730
|
-
|
|
24344
|
+
init_types3();
|
|
23731
24345
|
ALIASES = {
|
|
23732
24346
|
WGS84: "+proj=longlat +datum=WGS84",
|
|
23733
24347
|
"EPSG:4326": "+proj=longlat +datum=WGS84",
|
|
@@ -23968,7 +24582,7 @@ return true;`);
|
|
|
23968
24582
|
}
|
|
23969
24583
|
var init_vertical_datum = __esm({
|
|
23970
24584
|
"../../node_modules/@math.gl/geospatial/dist/projection/experimental/vertical-datum.js"() {
|
|
23971
|
-
|
|
24585
|
+
init_types3();
|
|
23972
24586
|
}
|
|
23973
24587
|
});
|
|
23974
24588
|
|
|
@@ -24291,7 +24905,7 @@ return true;`);
|
|
|
24291
24905
|
init_projection_scratch();
|
|
24292
24906
|
init_scalar_output();
|
|
24293
24907
|
init_normalize();
|
|
24294
|
-
|
|
24908
|
+
init_types3();
|
|
24295
24909
|
init_datum();
|
|
24296
24910
|
init_parameters();
|
|
24297
24911
|
init_geographic_rendering_profile();
|
|
@@ -29893,7 +30507,7 @@ return true;`);
|
|
|
29893
30507
|
init_geographic_rendering_profile();
|
|
29894
30508
|
init_parameters();
|
|
29895
30509
|
init_rendering_profile();
|
|
29896
|
-
|
|
30510
|
+
init_types3();
|
|
29897
30511
|
init_rectangular_rendering_profile();
|
|
29898
30512
|
init_geographic_bounds();
|
|
29899
30513
|
init_spherical_rendering_domain();
|
|
@@ -30246,7 +30860,7 @@ return true;`);
|
|
|
30246
30860
|
"../../node_modules/@math.gl/geospatial/dist/projection/experimental/crs/structured.js"() {
|
|
30247
30861
|
init_datum_catalog();
|
|
30248
30862
|
init_parameters();
|
|
30249
|
-
|
|
30863
|
+
init_types3();
|
|
30250
30864
|
METHODS = {
|
|
30251
30865
|
hotineobliquemercator: "omerc",
|
|
30252
30866
|
hotineobliquemercatorvarianta: "omerc",
|
|
@@ -30536,7 +31150,7 @@ return true;`);
|
|
|
30536
31150
|
"../../node_modules/@math.gl/geospatial/dist/projection/experimental/crs/wkt.js"() {
|
|
30537
31151
|
init_spatial_reference();
|
|
30538
31152
|
init_wkt_crs();
|
|
30539
|
-
|
|
31153
|
+
init_types3();
|
|
30540
31154
|
init_structured();
|
|
30541
31155
|
wktCRSParser = {
|
|
30542
31156
|
name: "wkt",
|
|
@@ -32664,7 +33278,7 @@ return true;`);
|
|
|
32664
33278
|
return value2.length;
|
|
32665
33279
|
return Math.max(2, ...value2.map((child2) => getCoordinateDimension(child2)));
|
|
32666
33280
|
}
|
|
32667
|
-
var
|
|
33281
|
+
var init_types4 = __esm({
|
|
32668
33282
|
"../../node_modules/@math.gl/arrow/dist/wkb/types.js"() {
|
|
32669
33283
|
}
|
|
32670
33284
|
});
|
|
@@ -32672,7 +33286,7 @@ return true;`);
|
|
|
32672
33286
|
// ../../node_modules/@math.gl/arrow/dist/wkb/wkb-reader.js
|
|
32673
33287
|
var init_wkb_reader = __esm({
|
|
32674
33288
|
"../../node_modules/@math.gl/arrow/dist/wkb/wkb-reader.js"() {
|
|
32675
|
-
|
|
33289
|
+
init_types4();
|
|
32676
33290
|
}
|
|
32677
33291
|
});
|
|
32678
33292
|
|
|
@@ -32754,7 +33368,7 @@ return true;`);
|
|
|
32754
33368
|
}
|
|
32755
33369
|
var init_wkb = __esm({
|
|
32756
33370
|
"../../node_modules/@math.gl/arrow/dist/wkb/wkb.js"() {
|
|
32757
|
-
|
|
33371
|
+
init_types4();
|
|
32758
33372
|
init_wkb_reader();
|
|
32759
33373
|
}
|
|
32760
33374
|
});
|
|
@@ -33093,14 +33707,14 @@ return true;`);
|
|
|
33093
33707
|
}
|
|
33094
33708
|
var init_wkt2 = __esm({
|
|
33095
33709
|
"../../node_modules/@math.gl/arrow/dist/wkb/wkt.js"() {
|
|
33096
|
-
|
|
33710
|
+
init_types4();
|
|
33097
33711
|
}
|
|
33098
33712
|
});
|
|
33099
33713
|
|
|
33100
33714
|
// ../../node_modules/@math.gl/arrow/dist/wkb/index.js
|
|
33101
33715
|
var init_wkb2 = __esm({
|
|
33102
33716
|
"../../node_modules/@math.gl/arrow/dist/wkb/index.js"() {
|
|
33103
|
-
|
|
33717
|
+
init_types4();
|
|
33104
33718
|
init_wkb();
|
|
33105
33719
|
init_wkb_reader();
|
|
33106
33720
|
init_wkb_builder();
|
|
@@ -34084,11 +34698,7 @@ return true;`);
|
|
|
34084
34698
|
for (const row of rows) {
|
|
34085
34699
|
arrowTableBuilder.addObjectRow(row);
|
|
34086
34700
|
}
|
|
34087
|
-
return
|
|
34088
|
-
shape: "arrow-table",
|
|
34089
|
-
schema: structuredClone(arrowTableBuilder.schema),
|
|
34090
|
-
data: arrowTableBuilder.finishTable()
|
|
34091
|
-
};
|
|
34701
|
+
return arrowTableBuilder.finishTable();
|
|
34092
34702
|
}
|
|
34093
34703
|
function convertFeaturesToNativeGeoArrowTable(features, options, preference) {
|
|
34094
34704
|
const geometries = features.map((feature) => feature.geometry || null);
|
|
@@ -34165,11 +34775,7 @@ return true;`);
|
|
|
34165
34775
|
nullCount: 0,
|
|
34166
34776
|
children: children2
|
|
34167
34777
|
});
|
|
34168
|
-
return
|
|
34169
|
-
shape: "arrow-table",
|
|
34170
|
-
schema: convertArrowToSchema(nextSchema),
|
|
34171
|
-
data: new Table(nextSchema, [new RecordBatch3(nextSchema, data)])
|
|
34172
|
-
};
|
|
34778
|
+
return new Table(nextSchema, [new RecordBatch3(nextSchema, data)]);
|
|
34173
34779
|
}
|
|
34174
34780
|
function resolveGeoArrowEncodingPreference(options) {
|
|
34175
34781
|
return options?.geoarrow?.encodingPreference ?? options?.encodingPreference;
|
|
@@ -35187,7 +35793,7 @@ return true;`);
|
|
|
35187
35793
|
const arrowTable = parseFlatGeobufToArrowTable(arrayBuffer, options);
|
|
35188
35794
|
switch (options.shape) {
|
|
35189
35795
|
case "arrow":
|
|
35190
|
-
return arrowTable
|
|
35796
|
+
return arrowTable;
|
|
35191
35797
|
case "geojson-table":
|
|
35192
35798
|
return makeGeoJsonTable(arrayBuffer, options);
|
|
35193
35799
|
case "binary-geometry":
|
|
@@ -35195,16 +35801,7 @@ return true;`);
|
|
|
35195
35801
|
makeGeoJsonTable(arrayBuffer, options).features
|
|
35196
35802
|
);
|
|
35197
35803
|
case "columnar-table":
|
|
35198
|
-
return
|
|
35199
|
-
shape: "columnar-table",
|
|
35200
|
-
schema: arrowTable.schema,
|
|
35201
|
-
data: Object.fromEntries(
|
|
35202
|
-
(arrowTable.schema?.fields || []).map((field) => [
|
|
35203
|
-
field.name,
|
|
35204
|
-
arrowTable.data.getChild(field.name)?.toArray()
|
|
35205
|
-
])
|
|
35206
|
-
)
|
|
35207
|
-
};
|
|
35804
|
+
return convertArrowToTable2(arrowTable, "columnar-table");
|
|
35208
35805
|
default:
|
|
35209
35806
|
throw new Error(`Unsupported FlatGeobuf output shape ${options.shape}`);
|
|
35210
35807
|
}
|
|
@@ -35252,29 +35849,24 @@ return true;`);
|
|
|
35252
35849
|
void 0,
|
|
35253
35850
|
[...propertyData, geometryData]
|
|
35254
35851
|
);
|
|
35255
|
-
return
|
|
35256
|
-
shape: "arrow-table",
|
|
35257
|
-
schema,
|
|
35258
|
-
data: new Table(arrowSchema, [new RecordBatch3(arrowSchema, structData)])
|
|
35259
|
-
};
|
|
35852
|
+
return new Table(arrowSchema, [new RecordBatch3(arrowSchema, structData)]);
|
|
35260
35853
|
}
|
|
35261
35854
|
function queryFlatGeobufArrowTable(arrayBuffer, options = {}) {
|
|
35262
35855
|
throwIfAborted(options.signal);
|
|
35263
35856
|
const sourceTable = parseFlatGeobufToArrowTable(arrayBuffer, {
|
|
35264
35857
|
boundingBox: options.boundingBox
|
|
35265
35858
|
});
|
|
35266
|
-
const sourceColumnNames = sourceTable.
|
|
35859
|
+
const sourceColumnNames = sourceTable.schema.fields.map((field) => field.name);
|
|
35267
35860
|
const plan = planTableQuery(sourceColumnNames, options);
|
|
35268
35861
|
const scanStep = plan.find((step) => step.kind === "scan");
|
|
35269
35862
|
const projectStep = plan.find((step) => step.kind === "project");
|
|
35270
35863
|
if (!scanStep || scanStep.kind !== "scan" || !projectStep || projectStep.kind !== "project") {
|
|
35271
35864
|
throw new Error("FlatGeobuf query planner produced an invalid plan.");
|
|
35272
35865
|
}
|
|
35273
|
-
if (!sourceTable.schema) throw new Error("FlatGeobuf query source is missing a schema.");
|
|
35274
35866
|
const predicateStep = plan.find((step) => step.kind === "filter");
|
|
35275
35867
|
const limitStep = plan.find((step) => step.kind === "limit");
|
|
35276
35868
|
return queryArrowTable(
|
|
35277
|
-
sourceTable
|
|
35869
|
+
sourceTable,
|
|
35278
35870
|
{
|
|
35279
35871
|
predicate: predicateStep?.kind === "filter" ? predicateStep.predicate : void 0,
|
|
35280
35872
|
columns: projectStep.columns,
|
|
@@ -35718,7 +36310,7 @@ return true;`);
|
|
|
35718
36310
|
"src/flatgeobuf/flatgeobuf-loader-types.ts"() {
|
|
35719
36311
|
"use strict";
|
|
35720
36312
|
init_flatgeobuf_format();
|
|
35721
|
-
VERSION3 = true ? "5.0.0-beta.
|
|
36313
|
+
VERSION3 = true ? "5.0.0-beta.11" : "latest";
|
|
35722
36314
|
FGB_MAGIC_NUMBER = [102, 103, 98, 3, 102, 103, 98, 1];
|
|
35723
36315
|
FlatGeobufLoader = {
|
|
35724
36316
|
/** Matches input for source selection. */
|
|
@@ -35800,6 +36392,20 @@ return true;`);
|
|
|
35800
36392
|
}
|
|
35801
36393
|
});
|
|
35802
36394
|
|
|
36395
|
+
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
|
|
36396
|
+
function isArrowTable2(value2) {
|
|
36397
|
+
const table = value2;
|
|
36398
|
+
return Boolean(table && Number.isInteger(table.numRows) && Array.isArray(table.batches) && Array.isArray(table.schema?.fields) && typeof table.get === "function" && typeof table.getChild === "function");
|
|
36399
|
+
}
|
|
36400
|
+
function isArrowRecordBatch2(value2) {
|
|
36401
|
+
const batch = value2;
|
|
36402
|
+
return Boolean(batch && Number.isInteger(batch.numRows) && Array.isArray(batch.schema?.fields) && Array.isArray(batch.data?.children) && typeof batch.get === "function" && typeof batch.getChild === "function");
|
|
36403
|
+
}
|
|
36404
|
+
var init_arrow_column_utils = __esm({
|
|
36405
|
+
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
|
|
36406
|
+
}
|
|
36407
|
+
});
|
|
36408
|
+
|
|
35803
36409
|
// ../../node_modules/@math.gl/arrow/dist/arrow/split-arrow-buffers.js
|
|
35804
36410
|
function splitArrowBuffers(input, options = {}) {
|
|
35805
36411
|
const retainedBuffers = /* @__PURE__ */ new Set();
|
|
@@ -35821,12 +36427,6 @@ return true;`);
|
|
|
35821
36427
|
}
|
|
35822
36428
|
return splitArrowDataBuffers(input, context);
|
|
35823
36429
|
}
|
|
35824
|
-
function isArrowTable2(input) {
|
|
35825
|
-
return "batches" in input;
|
|
35826
|
-
}
|
|
35827
|
-
function isArrowRecordBatch2(input) {
|
|
35828
|
-
return "schema" in input && "data" in input && !Array.isArray(input.data);
|
|
35829
|
-
}
|
|
35830
36430
|
function isArrowVector2(input) {
|
|
35831
36431
|
return "data" in input && Array.isArray(input.data);
|
|
35832
36432
|
}
|
|
@@ -35898,6 +36498,7 @@ return true;`);
|
|
|
35898
36498
|
init_Arrow_dom();
|
|
35899
36499
|
init_arrow_record_batch();
|
|
35900
36500
|
init_arrow_data();
|
|
36501
|
+
init_arrow_column_utils();
|
|
35901
36502
|
}
|
|
35902
36503
|
});
|
|
35903
36504
|
|
|
@@ -36010,12 +36611,6 @@ return true;`);
|
|
|
36010
36611
|
}
|
|
36011
36612
|
});
|
|
36012
36613
|
|
|
36013
|
-
// ../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js
|
|
36014
|
-
var init_arrow_column_utils = __esm({
|
|
36015
|
-
"../../node_modules/@math.gl/arrow/dist/arrow/arrow-column-utils.js"() {
|
|
36016
|
-
}
|
|
36017
|
-
});
|
|
36018
|
-
|
|
36019
36614
|
// ../../node_modules/@math.gl/arrow/dist/arrow/index.js
|
|
36020
36615
|
var init_arrow = __esm({
|
|
36021
36616
|
"../../node_modules/@math.gl/arrow/dist/arrow/index.js"() {
|
|
@@ -36068,22 +36663,12 @@ return true;`);
|
|
|
36068
36663
|
function serializeWorkerColumns(table, options) {
|
|
36069
36664
|
return {
|
|
36070
36665
|
arrowBatchMetadata: snapshotBatchMetadata(table),
|
|
36071
|
-
data:
|
|
36666
|
+
data: dehydrateArrowTable(table, options)
|
|
36072
36667
|
};
|
|
36073
36668
|
}
|
|
36074
|
-
function dehydrateWorkerTable(table, options) {
|
|
36075
|
-
const payload = dehydrateArrowTable(table, options);
|
|
36076
|
-
if (table.numCols === 0) {
|
|
36077
|
-
for (const [index, batch] of table.batches.entries()) {
|
|
36078
|
-
payload.batches[index].length = batch.numRows;
|
|
36079
|
-
}
|
|
36080
|
-
}
|
|
36081
|
-
return payload;
|
|
36082
|
-
}
|
|
36083
36669
|
function snapshotBatchMetadata(table) {
|
|
36084
36670
|
return table.batches.map((batch) => ({
|
|
36085
|
-
schema: tableToIPC(new Table(batch.schema, []))
|
|
36086
|
-
metadata: Array.from(batch.metadata)
|
|
36671
|
+
schema: tableToIPC(new Table(batch.schema, []))
|
|
36087
36672
|
}));
|
|
36088
36673
|
}
|
|
36089
36674
|
function hydrateWorkerTable(result) {
|
|
@@ -36091,18 +36676,11 @@ return true;`);
|
|
|
36091
36676
|
const table = hydrateArrowTable(data);
|
|
36092
36677
|
const batches = table.batches.map((batch, index) => {
|
|
36093
36678
|
const snapshot = arrowBatchMetadata?.[index];
|
|
36094
|
-
|
|
36679
|
+
return snapshot ? createRecordBatchWithMetadata(
|
|
36095
36680
|
tableFromIPC(snapshot.schema).schema,
|
|
36096
36681
|
batch.data,
|
|
36097
|
-
new Map(snapshot.metadata)
|
|
36682
|
+
snapshot.metadata ? new Map(snapshot.metadata) : getRecordBatchMetadata(batch)
|
|
36098
36683
|
) : batch;
|
|
36099
|
-
const rowCount = data.batches[index].length;
|
|
36100
|
-
if (restored.numCols === 0 && restored.numRows !== rowCount) {
|
|
36101
|
-
Object.defineProperty(restored, "data", {
|
|
36102
|
-
value: new Data(new Struct([]), 0, rowCount, 0, void 0, [])
|
|
36103
|
-
});
|
|
36104
|
-
}
|
|
36105
|
-
return restored;
|
|
36106
36684
|
});
|
|
36107
36685
|
return new Table(table.schema, batches);
|
|
36108
36686
|
}
|