@loaders.gl/geoarrow
Version:
GeoArrow columnar geometry encoding and decoding
19 lines (18 loc) • 726 B
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import { getFixedSizeListSize } from "./arrow-fixed-size-list-utils.js";
export function getSizeAndValueFromMeshArrowVector(attributeVector) {
const size = getFixedSizeListSize(attributeVector);
const typedArrays = getTypedArraysFromMeshArrowVector(attributeVector);
return { size, value: typedArrays[0] };
}
export function getTypedArraysFromMeshArrowVector(attributeVector) {
const typedArrays = [];
for (const attributeData of attributeVector.data) {
const valueData = attributeData?.children[0];
const typedArray = valueData.values;
typedArrays.push(typedArray);
}
return typedArrays;
}