@luma.gl/graph 10.0.0-alpha.5 → 10.0.0-alpha.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/LICENSE +38 -0
- package/README.md +7 -1
- package/dist/arrow/dggs/dggs-gpu-polygons.cjs +667 -0
- package/dist/arrow/dggs/dggs-gpu-polygons.d.ts +75 -0
- package/dist/arrow/dggs/dggs-gpu-polygons.d.ts.map +1 -0
- package/dist/arrow/dggs/dggs-gpu-polygons.js +651 -0
- package/dist/arrow/dggs/dggs-gpu-polygons.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +411 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +31 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +395 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +304 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +32 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +293 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +232 -0
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.d.ts +54 -0
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.d.ts.map +1 -0
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +222 -0
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.cjs +314 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts +42 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.d.ts.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js +318 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-adapters.js.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.cjs +204 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts +30 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.d.ts.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js +195 -0
- package/dist/arrow/gpu/arrow-gpu-analytics-readback.js.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-table-adapters.cjs +257 -0
- package/dist/arrow/gpu/arrow-gpu-table-adapters.d.ts +45 -0
- package/dist/arrow/gpu/arrow-gpu-table-adapters.d.ts.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-table-adapters.js +257 -0
- package/dist/arrow/gpu/arrow-gpu-table-adapters.js.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +230 -0
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +71 -0
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -0
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +215 -0
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -0
- package/dist/arrow/gpu/arrow-input-schema.cjs +36 -0
- package/dist/arrow/gpu/arrow-input-schema.d.ts +41 -0
- package/dist/arrow/gpu/arrow-input-schema.d.ts.map +1 -0
- package/dist/arrow/gpu/arrow-input-schema.js +17 -0
- package/dist/arrow/gpu/arrow-input-schema.js.map +1 -0
- package/dist/arrow/index.cjs +90 -0
- package/dist/arrow/index.cjs.map +6 -0
- package/dist/arrow/index.d.ts +9 -0
- package/dist/arrow/index.d.ts.map +1 -0
- package/dist/arrow/index.js +12 -0
- package/dist/arrow/index.js.map +1 -0
- package/dist/arrow/internal.cjs +30 -0
- package/dist/arrow/internal.cjs.map +6 -0
- package/dist/arrow/internal.d.ts +19 -0
- package/dist/arrow/internal.d.ts.map +1 -0
- package/dist/arrow/internal.js +7 -0
- package/dist/arrow/internal.js.map +1 -0
- package/dist/dist.dev.js +283 -12
- package/dist/dist.min.js +29 -29
- package/dist/geospatial/geospatial-utils.cjs +12 -11
- package/dist/geospatial/geospatial-utils.d.ts +1 -1
- package/dist/geospatial/geospatial-utils.d.ts.map +1 -1
- package/dist/geospatial/geospatial-utils.js +3 -2
- package/dist/geospatial/geospatial-utils.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/gpu-dggs-cell-projection.cjs +2 -2
- package/dist/gpu-dggs/gpu-dggs-cell-projection.js +1 -1
- package/dist/gpu-dggs/gpu-dggs-cell-projection.js.map +1 -1
- package/dist/gpu-dggs/index.cjs.map +1 -1
- package/dist/gpu-h3/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/index.cjs.map +2 -2
- package/dist/gpu-project/projection-program.cjs +2 -2
- package/dist/gpu-project/projection-program.d.ts +1 -1
- package/dist/gpu-project/projection-program.d.ts.map +1 -1
- package/dist/gpu-project/projection-program.js +1 -1
- package/dist/gpu-project/projection-program.js.map +1 -1
- package/dist/gpu-sql/lu-sql.d.ts +1 -1
- package/dist/gpu-sql/lu-sql.js +1 -1
- package/dist/gpu-tables/engine/gpu-table-shader-bindings.d.ts +1 -1
- package/dist/gpu-tables/engine/gpu-table-shader-bindings.d.ts.map +1 -1
- package/dist/gpu-vector-search/index.cjs.map +1 -1
- package/dist/utils/assemble-compute-kernel.cjs +2 -2
- package/dist/utils/assemble-compute-kernel.d.ts +2 -1
- package/dist/utils/assemble-compute-kernel.d.ts.map +1 -1
- package/dist/utils/assemble-compute-kernel.js +2 -2
- package/dist/utils/assemble-compute-kernel.js.map +1 -1
- package/package.json +19 -7
- package/src/arrow/dggs/dggs-gpu-polygons.ts +820 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +519 -0
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +415 -0
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +369 -0
- package/src/arrow/gpu/arrow-gpu-analytics-adapters.ts +474 -0
- package/src/arrow/gpu/arrow-gpu-analytics-readback.ts +294 -0
- package/src/arrow/gpu/arrow-gpu-table-adapters.ts +378 -0
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +324 -0
- package/src/arrow/gpu/arrow-input-schema.ts +98 -0
- package/src/arrow/index.ts +79 -0
- package/src/arrow/internal.ts +23 -0
- package/src/geospatial/geospatial-utils.ts +3 -7
- package/src/gpu-dggs/gpu-dggs-cell-projection.ts +1 -1
- package/src/gpu-project/projection-program.ts +1 -1
- package/src/gpu-sql/lu-sql.ts +1 -1
- package/src/gpu-tables/engine/gpu-table-shader-bindings.ts +1 -1
- package/src/utils/assemble-compute-kernel.ts +3 -7
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var arrow_polygon_tessellation_exports = {};
|
|
19
|
+
__export(arrow_polygon_tessellation_exports, {
|
|
20
|
+
tesselateAsync: () => tesselateAsync,
|
|
21
|
+
tessellateArrowPolygons: () => tessellateArrowPolygons
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(arrow_polygon_tessellation_exports);
|
|
24
|
+
var import_geoarrow = require("@math.gl/geospatial/geoarrow");
|
|
25
|
+
var import_apache_arrow = require("apache-arrow");
|
|
26
|
+
var import_arrow_geoarrow_adapter = require("./arrow-geoarrow-adapter.cjs");
|
|
27
|
+
const OUTPUT_POSITION_COMPONENTS = 4;
|
|
28
|
+
const DEFAULT_POLYGON_COLOR = [0, 96, 255, 255];
|
|
29
|
+
function tessellateArrowPolygons(sourceVectors, options = {}) {
|
|
30
|
+
const nesting = getPolygonNesting(sourceVectors.polygons.type);
|
|
31
|
+
if (options.tessellated) {
|
|
32
|
+
if (nesting !== 1) {
|
|
33
|
+
throw new Error("tessellated ArrowPolygonRenderer input must be List<FixedSizeList<...>>");
|
|
34
|
+
}
|
|
35
|
+
return copyTessellatedArrowPolygonRows(sourceVectors, options);
|
|
36
|
+
}
|
|
37
|
+
if (nesting === 1) {
|
|
38
|
+
throw new Error("ArrowPolygonRenderer requires polygon or multipolygon nesting unless tessellated is true");
|
|
39
|
+
}
|
|
40
|
+
const encoding = nesting === "dense-union" ? "geoarrow.geometry" : nesting === 2 ? "geoarrow.polygon" : "geoarrow.multipolygon";
|
|
41
|
+
const column = (0, import_arrow_geoarrow_adapter.makeGeoArrowColumnFromArrowVector)(sourceVectors.polygons, { encoding });
|
|
42
|
+
const tessellation = (0, import_geoarrow.tessellateGeoArrowPolygons)(column, {
|
|
43
|
+
positionSize: OUTPUT_POSITION_COMPONENTS,
|
|
44
|
+
sourceRowOffset: options.rowIndexOffset ?? 0
|
|
45
|
+
});
|
|
46
|
+
const rowIndices = tessellation.sourceRowIndices;
|
|
47
|
+
return {
|
|
48
|
+
positions: tessellation.positions,
|
|
49
|
+
colors: expandPolygonColors(sourceVectors, rowIndices, nesting, options.color, options.rowIndexOffset ?? 0),
|
|
50
|
+
rowIndices,
|
|
51
|
+
indices: tessellation.indices,
|
|
52
|
+
sourceDimension: tessellation.sourceDimension,
|
|
53
|
+
vertexCount: tessellation.vertexCount,
|
|
54
|
+
triangleCount: tessellation.triangleCount,
|
|
55
|
+
rowCount: tessellation.rowCount,
|
|
56
|
+
polygonCount: tessellation.polygonCount
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async function tesselateAsync(sourceVectors, options = {}) {
|
|
60
|
+
await Promise.resolve();
|
|
61
|
+
return tessellateArrowPolygons(sourceVectors, options);
|
|
62
|
+
}
|
|
63
|
+
function copyTessellatedArrowPolygonRows(sourceVectors, options) {
|
|
64
|
+
const sourceDimension = getDimensionSize((0, import_arrow_geoarrow_adapter.inferGeoArrowDimensionFromArrowType)(sourceVectors.polygons.type));
|
|
65
|
+
const rowIndexOffset = options.rowIndexOffset ?? 0;
|
|
66
|
+
const positions = [];
|
|
67
|
+
const colors = [];
|
|
68
|
+
const rowIndices = [];
|
|
69
|
+
const indices = [];
|
|
70
|
+
const rowColors = isRowColorVector(sourceVectors.colors);
|
|
71
|
+
const fallbackColor = options.color ?? DEFAULT_POLYGON_COLOR;
|
|
72
|
+
let polygonCount = 0;
|
|
73
|
+
for (let rowIndex = 0; rowIndex < sourceVectors.polygons.length; rowIndex++) {
|
|
74
|
+
const coordinates = materializeArrowValue(sourceVectors.polygons.get(rowIndex));
|
|
75
|
+
if (coordinates === null)
|
|
76
|
+
continue;
|
|
77
|
+
const coordinateRows = coordinates;
|
|
78
|
+
if (coordinateRows.length % 3 !== 0) {
|
|
79
|
+
throw new Error("tessellated ArrowPolygonRenderer rows must contain a multiple of 3 vertices");
|
|
80
|
+
}
|
|
81
|
+
const colorValue = sourceVectors.colors ? materializeArrowValue(sourceVectors.colors.get(rowIndex)) : null;
|
|
82
|
+
const rowColor = rowColors ? normalizeColor(colorValue, fallbackColor) : fallbackColor;
|
|
83
|
+
const vertexColors = rowColors ? null : colorValue;
|
|
84
|
+
for (let coordinateIndex = 0; coordinateIndex < coordinateRows.length; coordinateIndex++) {
|
|
85
|
+
appendPosition(positions, coordinateRows[coordinateIndex]);
|
|
86
|
+
appendColor(colors, (vertexColors == null ? void 0 : vertexColors[coordinateIndex]) ?? rowColor);
|
|
87
|
+
rowIndices.push(rowIndexOffset + rowIndex);
|
|
88
|
+
indices.push(indices.length);
|
|
89
|
+
}
|
|
90
|
+
polygonCount++;
|
|
91
|
+
}
|
|
92
|
+
const vertexCount = positions.length / OUTPUT_POSITION_COMPONENTS;
|
|
93
|
+
const IndexArray = vertexCount <= 65535 ? Uint16Array : Uint32Array;
|
|
94
|
+
return {
|
|
95
|
+
positions: Float32Array.from(positions),
|
|
96
|
+
colors: Uint8Array.from(colors),
|
|
97
|
+
rowIndices: Uint32Array.from(rowIndices),
|
|
98
|
+
indices: IndexArray.from(indices),
|
|
99
|
+
sourceDimension,
|
|
100
|
+
vertexCount,
|
|
101
|
+
triangleCount: indices.length / 3,
|
|
102
|
+
rowCount: sourceVectors.polygons.length,
|
|
103
|
+
polygonCount
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function expandPolygonColors(sourceVectors, rowIndices, nesting, fallbackColor = DEFAULT_POLYGON_COLOR, sourceRowOffset = 0) {
|
|
107
|
+
var _a;
|
|
108
|
+
const colors = new Uint8Array(rowIndices.length * 4);
|
|
109
|
+
if (!sourceVectors.colors) {
|
|
110
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
111
|
+
colors.set(fallbackColor, index * 4);
|
|
112
|
+
}
|
|
113
|
+
return colors;
|
|
114
|
+
}
|
|
115
|
+
if (isRowColorVector(sourceVectors.colors)) {
|
|
116
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
117
|
+
const sourceRowIndex = rowIndices[index] - sourceRowOffset;
|
|
118
|
+
const color = normalizeColor(materializeArrowValue(sourceVectors.colors.get(sourceRowIndex)), fallbackColor);
|
|
119
|
+
colors.set(color, index * 4);
|
|
120
|
+
}
|
|
121
|
+
return colors;
|
|
122
|
+
}
|
|
123
|
+
if (nesting === "dense-union") {
|
|
124
|
+
throw new Error("Per-vertex colors are not supported for mixed GeoArrow DenseUnion polygons");
|
|
125
|
+
}
|
|
126
|
+
const rowColors = /* @__PURE__ */ new Map();
|
|
127
|
+
for (let sourceRowIndex = 0; sourceRowIndex < sourceVectors.polygons.length; sourceRowIndex++) {
|
|
128
|
+
const coordinates = materializeArrowValue(sourceVectors.polygons.get(sourceRowIndex));
|
|
129
|
+
const colorValues = materializeArrowValue(sourceVectors.colors.get(sourceRowIndex));
|
|
130
|
+
rowColors.set(sourceRowIndex, flattenPolygonVertexColors(coordinates, colorValues, nesting, fallbackColor));
|
|
131
|
+
}
|
|
132
|
+
const rowColorOffsets = /* @__PURE__ */ new Map();
|
|
133
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
134
|
+
const sourceRowIndex = rowIndices[index] - sourceRowOffset;
|
|
135
|
+
const rowColorOffset = rowColorOffsets.get(sourceRowIndex) ?? 0;
|
|
136
|
+
const color = (_a = rowColors.get(sourceRowIndex)) == null ? void 0 : _a[rowColorOffset];
|
|
137
|
+
if (!color) {
|
|
138
|
+
throw new Error(`Arrow polygon vertex colors do not match geometry row ${sourceRowIndex}`);
|
|
139
|
+
}
|
|
140
|
+
colors.set(color, index * 4);
|
|
141
|
+
rowColorOffsets.set(sourceRowIndex, rowColorOffset + 1);
|
|
142
|
+
}
|
|
143
|
+
return colors;
|
|
144
|
+
}
|
|
145
|
+
function flattenPolygonVertexColors(coordinates, colors, nesting, fallbackColor) {
|
|
146
|
+
if (!Array.isArray(coordinates) || !Array.isArray(colors))
|
|
147
|
+
return [];
|
|
148
|
+
if (nesting === 3) {
|
|
149
|
+
const values2 = [];
|
|
150
|
+
for (let polygonIndex = 0; polygonIndex < coordinates.length; polygonIndex++) {
|
|
151
|
+
values2.push(...flattenPolygonVertexColors(coordinates[polygonIndex], colors[polygonIndex], 2, fallbackColor));
|
|
152
|
+
}
|
|
153
|
+
return values2;
|
|
154
|
+
}
|
|
155
|
+
const values = [];
|
|
156
|
+
for (let ringIndex = 0; ringIndex < coordinates.length; ringIndex++) {
|
|
157
|
+
const ring = coordinates[ringIndex];
|
|
158
|
+
const ringColors = colors[ringIndex] ?? [];
|
|
159
|
+
const coordinateCount = hasClosingCoordinate(ring) ? ring.length - 1 : ring.length;
|
|
160
|
+
if (coordinateCount < 3)
|
|
161
|
+
continue;
|
|
162
|
+
for (let coordinateIndex = 0; coordinateIndex < coordinateCount; coordinateIndex++) {
|
|
163
|
+
values.push(normalizeColor(ringColors[coordinateIndex], fallbackColor));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return values;
|
|
167
|
+
}
|
|
168
|
+
function hasClosingCoordinate(ring) {
|
|
169
|
+
if (ring.length < 2)
|
|
170
|
+
return false;
|
|
171
|
+
const first = ring[0];
|
|
172
|
+
const last = ring[ring.length - 1];
|
|
173
|
+
return first.length === last.length && first.every((value, index) => value === last[index]);
|
|
174
|
+
}
|
|
175
|
+
function isRowColorVector(colors) {
|
|
176
|
+
return Boolean(colors && import_apache_arrow.DataType.isFixedSizeList(colors.type) && colors.type.listSize === 4 && import_apache_arrow.DataType.isInt(colors.type.children[0].type));
|
|
177
|
+
}
|
|
178
|
+
function normalizeColor(value, fallbackColor) {
|
|
179
|
+
if (!Array.isArray(value) || value.length < 4)
|
|
180
|
+
return fallbackColor;
|
|
181
|
+
return [Number(value[0]), Number(value[1]), Number(value[2]), Number(value[3])];
|
|
182
|
+
}
|
|
183
|
+
function appendPosition(positions, coordinate) {
|
|
184
|
+
for (let component = 0; component < OUTPUT_POSITION_COMPONENTS; component++) {
|
|
185
|
+
positions.push(coordinate[component] ?? 0);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function appendColor(colors, color) {
|
|
189
|
+
colors.push(color[0], color[1], color[2], color[3]);
|
|
190
|
+
}
|
|
191
|
+
function getPolygonNesting(type) {
|
|
192
|
+
if (import_apache_arrow.DataType.isDenseUnion(type))
|
|
193
|
+
return "dense-union";
|
|
194
|
+
let nesting = 0;
|
|
195
|
+
let currentType = type;
|
|
196
|
+
while (import_apache_arrow.DataType.isList(currentType)) {
|
|
197
|
+
nesting++;
|
|
198
|
+
currentType = currentType.children[0].type;
|
|
199
|
+
}
|
|
200
|
+
if (nesting < 1 || nesting > 3) {
|
|
201
|
+
throw new Error(`Unsupported Arrow polygon type ${type.toString()}`);
|
|
202
|
+
}
|
|
203
|
+
return nesting;
|
|
204
|
+
}
|
|
205
|
+
function getDimensionSize(dimension) {
|
|
206
|
+
return dimension === "xy" ? 2 : dimension === "xyzm" ? 4 : 3;
|
|
207
|
+
}
|
|
208
|
+
function materializeArrowValue(value) {
|
|
209
|
+
if (value === null || value === void 0)
|
|
210
|
+
return null;
|
|
211
|
+
if (ArrayBuffer.isView(value)) {
|
|
212
|
+
return Array.from(value);
|
|
213
|
+
}
|
|
214
|
+
if (Array.isArray(value))
|
|
215
|
+
return value.map(materializeArrowValue);
|
|
216
|
+
if (isArrowVectorLike(value)) {
|
|
217
|
+
const values = [];
|
|
218
|
+
for (let index = 0; index < value.length; index++) {
|
|
219
|
+
values.push(materializeArrowValue(value.get(index)));
|
|
220
|
+
}
|
|
221
|
+
return values;
|
|
222
|
+
}
|
|
223
|
+
return value;
|
|
224
|
+
}
|
|
225
|
+
function isArrowVectorLike(value) {
|
|
226
|
+
return Boolean(value && typeof value === "object" && "length" in value && "get" in value && typeof value.get === "function");
|
|
227
|
+
}
|
|
228
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
229
|
+
0 && (module.exports = {
|
|
230
|
+
tesselateAsync,
|
|
231
|
+
tessellateArrowPolygons
|
|
232
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DenseUnion, FixedSizeList, Float32, Float64, List, Struct, Uint8, Vector } from 'apache-arrow';
|
|
2
|
+
import { type ArrowColorType } from '@luma.gl/gpgpu/arrow';
|
|
3
|
+
export type ArrowPolygonCoordinateType = FixedSizeList<Float32> | FixedSizeList<Float64>;
|
|
4
|
+
export type ArrowSeparatedPolygonCoordinateType = Struct;
|
|
5
|
+
export type ArrowPolygonInputCoordinateType = ArrowPolygonCoordinateType | ArrowSeparatedPolygonCoordinateType;
|
|
6
|
+
export type ArrowTessellatedPolygonType = List<ArrowPolygonInputCoordinateType>;
|
|
7
|
+
export type ArrowPolygonType = List<List<ArrowPolygonInputCoordinateType>>;
|
|
8
|
+
export type ArrowMultiPolygonType = List<List<List<ArrowPolygonInputCoordinateType>>>;
|
|
9
|
+
export type ArrowGeoArrowGeometryType = DenseUnion;
|
|
10
|
+
export type ArrowPolygonInputType = ArrowTessellatedPolygonType | ArrowPolygonType | ArrowMultiPolygonType | ArrowGeoArrowGeometryType;
|
|
11
|
+
export type ArrowPolygonRowColorType = FixedSizeList<Uint8>;
|
|
12
|
+
export type ArrowTessellatedPolygonVertexColorType = List<ArrowPolygonRowColorType>;
|
|
13
|
+
export type ArrowPolygonVertexColorType = List<List<ArrowPolygonRowColorType>>;
|
|
14
|
+
export type ArrowMultiPolygonVertexColorType = List<List<List<ArrowPolygonRowColorType>>>;
|
|
15
|
+
export type ArrowPolygonColorType = ArrowColorType | ArrowTessellatedPolygonVertexColorType | ArrowPolygonVertexColorType | ArrowMultiPolygonVertexColorType;
|
|
16
|
+
export type ArrowPolygonSourceVectors = {
|
|
17
|
+
/** Polygon, multipolygon, GeoArrow DenseUnion, or pre-tessellated triangle rows. */
|
|
18
|
+
polygons: Vector<ArrowPolygonInputType>;
|
|
19
|
+
/** Optional row or per-vertex packed RGBA8 fill colors. */
|
|
20
|
+
colors?: Vector<ArrowPolygonColorType>;
|
|
21
|
+
};
|
|
22
|
+
export type ArrowPolygonTessellationOptions = {
|
|
23
|
+
/** Treat `List<FixedSizeList<...>>` rows as already tessellated triangle vertices. */
|
|
24
|
+
tessellated?: boolean;
|
|
25
|
+
/** Constant fallback color used when no row/vertex color vector is supplied. */
|
|
26
|
+
color?: [number, number, number, number];
|
|
27
|
+
/** First source row id to write into the generated rowIndices attribute. */
|
|
28
|
+
rowIndexOffset?: number;
|
|
29
|
+
};
|
|
30
|
+
export type ArrowPolygonTessellationResult = {
|
|
31
|
+
/** Packed Float32 vec4 positions. XY are used for tessellation and rendering. */
|
|
32
|
+
positions: Float32Array;
|
|
33
|
+
/** Packed RGBA8 colors, one color per output position. */
|
|
34
|
+
colors: Uint8Array;
|
|
35
|
+
/** Source Arrow row index, one id per output position. */
|
|
36
|
+
rowIndices: Uint32Array;
|
|
37
|
+
/** Triangle index buffer. */
|
|
38
|
+
indices: Uint16Array | Uint32Array;
|
|
39
|
+
/** Original coordinate dimension before positions were padded to vec4. */
|
|
40
|
+
sourceDimension: 2 | 3 | 4;
|
|
41
|
+
/** Number of generated output vertices. */
|
|
42
|
+
vertexCount: number;
|
|
43
|
+
/** Number of generated triangles. */
|
|
44
|
+
triangleCount: number;
|
|
45
|
+
/** Number of input Arrow rows. */
|
|
46
|
+
rowCount: number;
|
|
47
|
+
/** Number of primitive polygons passed to earcut or accepted as tessellated rows. */
|
|
48
|
+
polygonCount: number;
|
|
49
|
+
};
|
|
50
|
+
/** Adapts Arrow polygon buffers and delegates geometry tessellation to math.gl. */
|
|
51
|
+
export declare function tessellateArrowPolygons(sourceVectors: ArrowPolygonSourceVectors, options?: ArrowPolygonTessellationOptions): ArrowPolygonTessellationResult;
|
|
52
|
+
/** Async compatibility entrypoint. Worker scheduling is now an explicit application concern. */
|
|
53
|
+
export declare function tesselateAsync(sourceVectors: ArrowPolygonSourceVectors, options?: ArrowPolygonTessellationOptions): Promise<ArrowPolygonTessellationResult>;
|
|
54
|
+
//# sourceMappingURL=arrow-polygon-tessellation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-polygon-tessellation.d.ts","sourceRoot":"","sources":["../../../src/arrow/geoarrow/arrow-polygon-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FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { tessellateGeoArrowPolygons } from '@math.gl/geospatial/geoarrow';
|
|
5
|
+
import { DataType } from 'apache-arrow';
|
|
6
|
+
import { inferGeoArrowDimensionFromArrowType, makeGeoArrowColumnFromArrowVector } from "./arrow-geoarrow-adapter.js";
|
|
7
|
+
const OUTPUT_POSITION_COMPONENTS = 4;
|
|
8
|
+
const DEFAULT_POLYGON_COLOR = [0, 96, 255, 255];
|
|
9
|
+
/** Adapts Arrow polygon buffers and delegates geometry tessellation to math.gl. */
|
|
10
|
+
export function tessellateArrowPolygons(sourceVectors, options = {}) {
|
|
11
|
+
const nesting = getPolygonNesting(sourceVectors.polygons.type);
|
|
12
|
+
if (options.tessellated) {
|
|
13
|
+
if (nesting !== 1) {
|
|
14
|
+
throw new Error('tessellated ArrowPolygonRenderer input must be List<FixedSizeList<...>>');
|
|
15
|
+
}
|
|
16
|
+
return copyTessellatedArrowPolygonRows(sourceVectors, options);
|
|
17
|
+
}
|
|
18
|
+
if (nesting === 1) {
|
|
19
|
+
throw new Error('ArrowPolygonRenderer requires polygon or multipolygon nesting unless tessellated is true');
|
|
20
|
+
}
|
|
21
|
+
const encoding = nesting === 'dense-union'
|
|
22
|
+
? 'geoarrow.geometry'
|
|
23
|
+
: nesting === 2
|
|
24
|
+
? 'geoarrow.polygon'
|
|
25
|
+
: 'geoarrow.multipolygon';
|
|
26
|
+
const column = makeGeoArrowColumnFromArrowVector(sourceVectors.polygons, { encoding });
|
|
27
|
+
const tessellation = tessellateGeoArrowPolygons(column, {
|
|
28
|
+
positionSize: OUTPUT_POSITION_COMPONENTS,
|
|
29
|
+
sourceRowOffset: options.rowIndexOffset ?? 0
|
|
30
|
+
});
|
|
31
|
+
const rowIndices = tessellation.sourceRowIndices;
|
|
32
|
+
return {
|
|
33
|
+
positions: tessellation.positions,
|
|
34
|
+
colors: expandPolygonColors(sourceVectors, rowIndices, nesting, options.color, options.rowIndexOffset ?? 0),
|
|
35
|
+
rowIndices,
|
|
36
|
+
indices: tessellation.indices,
|
|
37
|
+
sourceDimension: tessellation.sourceDimension,
|
|
38
|
+
vertexCount: tessellation.vertexCount,
|
|
39
|
+
triangleCount: tessellation.triangleCount,
|
|
40
|
+
rowCount: tessellation.rowCount,
|
|
41
|
+
polygonCount: tessellation.polygonCount
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Async compatibility entrypoint. Worker scheduling is now an explicit application concern. */
|
|
45
|
+
export async function tesselateAsync(sourceVectors, options = {}) {
|
|
46
|
+
await Promise.resolve();
|
|
47
|
+
return tessellateArrowPolygons(sourceVectors, options);
|
|
48
|
+
}
|
|
49
|
+
function copyTessellatedArrowPolygonRows(sourceVectors, options) {
|
|
50
|
+
const sourceDimension = getDimensionSize(inferGeoArrowDimensionFromArrowType(sourceVectors.polygons.type));
|
|
51
|
+
const rowIndexOffset = options.rowIndexOffset ?? 0;
|
|
52
|
+
const positions = [];
|
|
53
|
+
const colors = [];
|
|
54
|
+
const rowIndices = [];
|
|
55
|
+
const indices = [];
|
|
56
|
+
const rowColors = isRowColorVector(sourceVectors.colors);
|
|
57
|
+
const fallbackColor = options.color ?? DEFAULT_POLYGON_COLOR;
|
|
58
|
+
let polygonCount = 0;
|
|
59
|
+
for (let rowIndex = 0; rowIndex < sourceVectors.polygons.length; rowIndex++) {
|
|
60
|
+
const coordinates = materializeArrowValue(sourceVectors.polygons.get(rowIndex));
|
|
61
|
+
if (coordinates === null)
|
|
62
|
+
continue;
|
|
63
|
+
const coordinateRows = coordinates;
|
|
64
|
+
if (coordinateRows.length % 3 !== 0) {
|
|
65
|
+
throw new Error('tessellated ArrowPolygonRenderer rows must contain a multiple of 3 vertices');
|
|
66
|
+
}
|
|
67
|
+
const colorValue = sourceVectors.colors
|
|
68
|
+
? materializeArrowValue(sourceVectors.colors.get(rowIndex))
|
|
69
|
+
: null;
|
|
70
|
+
const rowColor = rowColors ? normalizeColor(colorValue, fallbackColor) : fallbackColor;
|
|
71
|
+
const vertexColors = rowColors ? null : colorValue;
|
|
72
|
+
for (let coordinateIndex = 0; coordinateIndex < coordinateRows.length; coordinateIndex++) {
|
|
73
|
+
appendPosition(positions, coordinateRows[coordinateIndex]);
|
|
74
|
+
appendColor(colors, vertexColors?.[coordinateIndex] ?? rowColor);
|
|
75
|
+
rowIndices.push(rowIndexOffset + rowIndex);
|
|
76
|
+
indices.push(indices.length);
|
|
77
|
+
}
|
|
78
|
+
polygonCount++;
|
|
79
|
+
}
|
|
80
|
+
const vertexCount = positions.length / OUTPUT_POSITION_COMPONENTS;
|
|
81
|
+
const IndexArray = vertexCount <= 65535 ? Uint16Array : Uint32Array;
|
|
82
|
+
return {
|
|
83
|
+
positions: Float32Array.from(positions),
|
|
84
|
+
colors: Uint8Array.from(colors),
|
|
85
|
+
rowIndices: Uint32Array.from(rowIndices),
|
|
86
|
+
indices: IndexArray.from(indices),
|
|
87
|
+
sourceDimension,
|
|
88
|
+
vertexCount,
|
|
89
|
+
triangleCount: indices.length / 3,
|
|
90
|
+
rowCount: sourceVectors.polygons.length,
|
|
91
|
+
polygonCount
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function expandPolygonColors(sourceVectors, rowIndices, nesting, fallbackColor = DEFAULT_POLYGON_COLOR, sourceRowOffset = 0) {
|
|
95
|
+
const colors = new Uint8Array(rowIndices.length * 4);
|
|
96
|
+
if (!sourceVectors.colors) {
|
|
97
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
98
|
+
colors.set(fallbackColor, index * 4);
|
|
99
|
+
}
|
|
100
|
+
return colors;
|
|
101
|
+
}
|
|
102
|
+
if (isRowColorVector(sourceVectors.colors)) {
|
|
103
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
104
|
+
const sourceRowIndex = rowIndices[index] - sourceRowOffset;
|
|
105
|
+
const color = normalizeColor(materializeArrowValue(sourceVectors.colors.get(sourceRowIndex)), fallbackColor);
|
|
106
|
+
colors.set(color, index * 4);
|
|
107
|
+
}
|
|
108
|
+
return colors;
|
|
109
|
+
}
|
|
110
|
+
if (nesting === 'dense-union') {
|
|
111
|
+
throw new Error('Per-vertex colors are not supported for mixed GeoArrow DenseUnion polygons');
|
|
112
|
+
}
|
|
113
|
+
const rowColors = new Map();
|
|
114
|
+
for (let sourceRowIndex = 0; sourceRowIndex < sourceVectors.polygons.length; sourceRowIndex++) {
|
|
115
|
+
const coordinates = materializeArrowValue(sourceVectors.polygons.get(sourceRowIndex));
|
|
116
|
+
const colorValues = materializeArrowValue(sourceVectors.colors.get(sourceRowIndex));
|
|
117
|
+
rowColors.set(sourceRowIndex, flattenPolygonVertexColors(coordinates, colorValues, nesting, fallbackColor));
|
|
118
|
+
}
|
|
119
|
+
const rowColorOffsets = new Map();
|
|
120
|
+
for (let index = 0; index < rowIndices.length; index++) {
|
|
121
|
+
const sourceRowIndex = rowIndices[index] - sourceRowOffset;
|
|
122
|
+
const rowColorOffset = rowColorOffsets.get(sourceRowIndex) ?? 0;
|
|
123
|
+
const color = rowColors.get(sourceRowIndex)?.[rowColorOffset];
|
|
124
|
+
if (!color) {
|
|
125
|
+
throw new Error(`Arrow polygon vertex colors do not match geometry row ${sourceRowIndex}`);
|
|
126
|
+
}
|
|
127
|
+
colors.set(color, index * 4);
|
|
128
|
+
rowColorOffsets.set(sourceRowIndex, rowColorOffset + 1);
|
|
129
|
+
}
|
|
130
|
+
return colors;
|
|
131
|
+
}
|
|
132
|
+
function flattenPolygonVertexColors(coordinates, colors, nesting, fallbackColor) {
|
|
133
|
+
if (!Array.isArray(coordinates) || !Array.isArray(colors))
|
|
134
|
+
return [];
|
|
135
|
+
if (nesting === 3) {
|
|
136
|
+
const values = [];
|
|
137
|
+
for (let polygonIndex = 0; polygonIndex < coordinates.length; polygonIndex++) {
|
|
138
|
+
values.push(...flattenPolygonVertexColors(coordinates[polygonIndex], colors[polygonIndex], 2, fallbackColor));
|
|
139
|
+
}
|
|
140
|
+
return values;
|
|
141
|
+
}
|
|
142
|
+
const values = [];
|
|
143
|
+
for (let ringIndex = 0; ringIndex < coordinates.length; ringIndex++) {
|
|
144
|
+
const ring = coordinates[ringIndex];
|
|
145
|
+
const ringColors = (colors[ringIndex] ?? []);
|
|
146
|
+
const coordinateCount = hasClosingCoordinate(ring) ? ring.length - 1 : ring.length;
|
|
147
|
+
if (coordinateCount < 3)
|
|
148
|
+
continue;
|
|
149
|
+
for (let coordinateIndex = 0; coordinateIndex < coordinateCount; coordinateIndex++) {
|
|
150
|
+
values.push(normalizeColor(ringColors[coordinateIndex], fallbackColor));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return values;
|
|
154
|
+
}
|
|
155
|
+
function hasClosingCoordinate(ring) {
|
|
156
|
+
if (ring.length < 2)
|
|
157
|
+
return false;
|
|
158
|
+
const first = ring[0];
|
|
159
|
+
const last = ring[ring.length - 1];
|
|
160
|
+
return first.length === last.length && first.every((value, index) => value === last[index]);
|
|
161
|
+
}
|
|
162
|
+
function isRowColorVector(colors) {
|
|
163
|
+
return Boolean(colors &&
|
|
164
|
+
DataType.isFixedSizeList(colors.type) &&
|
|
165
|
+
colors.type.listSize === 4 &&
|
|
166
|
+
DataType.isInt(colors.type.children[0].type));
|
|
167
|
+
}
|
|
168
|
+
function normalizeColor(value, fallbackColor) {
|
|
169
|
+
if (!Array.isArray(value) || value.length < 4)
|
|
170
|
+
return fallbackColor;
|
|
171
|
+
return [Number(value[0]), Number(value[1]), Number(value[2]), Number(value[3])];
|
|
172
|
+
}
|
|
173
|
+
function appendPosition(positions, coordinate) {
|
|
174
|
+
for (let component = 0; component < OUTPUT_POSITION_COMPONENTS; component++) {
|
|
175
|
+
positions.push(coordinate[component] ?? 0);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function appendColor(colors, color) {
|
|
179
|
+
colors.push(color[0], color[1], color[2], color[3]);
|
|
180
|
+
}
|
|
181
|
+
function getPolygonNesting(type) {
|
|
182
|
+
if (DataType.isDenseUnion(type))
|
|
183
|
+
return 'dense-union';
|
|
184
|
+
let nesting = 0;
|
|
185
|
+
let currentType = type;
|
|
186
|
+
while (DataType.isList(currentType)) {
|
|
187
|
+
nesting++;
|
|
188
|
+
currentType = currentType.children[0].type;
|
|
189
|
+
}
|
|
190
|
+
if (nesting < 1 || nesting > 3) {
|
|
191
|
+
throw new Error(`Unsupported Arrow polygon type ${type.toString()}`);
|
|
192
|
+
}
|
|
193
|
+
return nesting;
|
|
194
|
+
}
|
|
195
|
+
function getDimensionSize(dimension) {
|
|
196
|
+
return dimension === 'xy' ? 2 : dimension === 'xyzm' ? 4 : 3;
|
|
197
|
+
}
|
|
198
|
+
function materializeArrowValue(value) {
|
|
199
|
+
if (value === null || value === undefined)
|
|
200
|
+
return null;
|
|
201
|
+
if (ArrayBuffer.isView(value)) {
|
|
202
|
+
return Array.from(value);
|
|
203
|
+
}
|
|
204
|
+
if (Array.isArray(value))
|
|
205
|
+
return value.map(materializeArrowValue);
|
|
206
|
+
if (isArrowVectorLike(value)) {
|
|
207
|
+
const values = [];
|
|
208
|
+
for (let index = 0; index < value.length; index++) {
|
|
209
|
+
values.push(materializeArrowValue(value.get(index)));
|
|
210
|
+
}
|
|
211
|
+
return values;
|
|
212
|
+
}
|
|
213
|
+
return value;
|
|
214
|
+
}
|
|
215
|
+
function isArrowVectorLike(value) {
|
|
216
|
+
return Boolean(value &&
|
|
217
|
+
typeof value === 'object' &&
|
|
218
|
+
'length' in value &&
|
|
219
|
+
'get' in value &&
|
|
220
|
+
typeof value.get === 'function');
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=arrow-polygon-tessellation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow-polygon-tessellation.js","sourceRoot":"","sources":["../../../src/arrow/geoarrow/arrow-polygon-tessellation.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AACxE,OAA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