@@ -21,9 +21,11 @@ import {
21
21
assignAccessor ,
22
22
extractAccessorsFromProps ,
23
23
getGeometryVector ,
24
+ getInterleavedPolygon ,
24
25
getMultiPolygonResolvedOffsets ,
25
26
getPolygonResolvedOffsets ,
26
27
invertOffsets ,
28
+ isGeomSeparate ,
27
29
} from "../utils/utils" ;
28
30
import {
29
31
GeoArrowExtraPickingProps ,
@@ -249,7 +251,12 @@ export class GeoArrowSolidPolygonLayer<
249
251
recordBatchIdx < geometryColumn . data . length ;
250
252
recordBatchIdx ++
251
253
) {
252
- const polygonData = geometryColumn . data [ recordBatchIdx ] ;
254
+ let polygonData = geometryColumn . data [ recordBatchIdx ] ;
255
+ // TODO: Note here that [when applicable] we do this conversion twice -
256
+ // one for triangulation (earcut) here and the other for rendering later.
257
+ if ( isGeomSeparate ( polygonData ) ) {
258
+ polygonData = getInterleavedPolygon ( polygonData ) ;
259
+ }
253
260
const [ preparedPolygonData , arrayBuffers ] = ga . worker . preparePostMessage (
254
261
polygonData ,
255
262
true ,
@@ -278,7 +285,12 @@ export class GeoArrowSolidPolygonLayer<
278
285
recordBatchIdx < geometryColumn . data . length ;
279
286
recordBatchIdx ++
280
287
) {
281
- const polygonData = geometryColumn . data [ recordBatchIdx ] ;
288
+ let polygonData = geometryColumn . data [ recordBatchIdx ] ;
289
+ // TODO: Note here that [when applicable] we do this conversion twice -
290
+ // one for triangulation (earcut) here and the other for rendering later.
291
+ if ( isGeomSeparate ( polygonData ) ) {
292
+ polygonData = getInterleavedPolygon ( polygonData ) ;
293
+ }
282
294
result [ recordBatchIdx ] = ga . algorithm . earcut ( polygonData ) ;
283
295
}
284
296
@@ -303,7 +315,12 @@ export class GeoArrowSolidPolygonLayer<
303
315
recordBatchIdx ++
304
316
) {
305
317
const multiPolygonData = geometryColumn . data [ recordBatchIdx ] ;
306
- const polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
318
+ let polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
319
+ // TODO: Note here that [when applicable] we do this conversion twice -
320
+ // one for triangulation (earcut) here and the other for rendering later.
321
+ if ( isGeomSeparate ( polygonData ) ) {
322
+ polygonData = getInterleavedPolygon ( polygonData ) ;
323
+ }
307
324
const [ preparedPolygonData , arrayBuffers ] = ga . worker . preparePostMessage (
308
325
polygonData ,
309
326
true ,
@@ -333,7 +350,12 @@ export class GeoArrowSolidPolygonLayer<
333
350
recordBatchIdx ++
334
351
) {
335
352
const multiPolygonData = geometryColumn . data [ recordBatchIdx ] ;
336
- const polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
353
+ let polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
354
+ // TODO: Note here that [when applicable] we do this conversion twice -
355
+ // one for triangulation (earcut) here and the other for rendering later.
356
+ if ( isGeomSeparate ( polygonData ) ) {
357
+ polygonData = getInterleavedPolygon ( polygonData ) ;
358
+ }
337
359
result [ recordBatchIdx ] = ga . algorithm . earcut ( polygonData ) ;
338
360
}
339
361
@@ -417,7 +439,10 @@ export class GeoArrowSolidPolygonLayer<
417
439
recordBatchIdx < table . batches . length ;
418
440
recordBatchIdx ++
419
441
) {
420
- const polygonData = geometryColumn . data [ recordBatchIdx ] ;
442
+ let polygonData = geometryColumn . data [ recordBatchIdx ] ;
443
+ if ( isGeomSeparate ( polygonData ) ) {
444
+ polygonData = getInterleavedPolygon ( polygonData ) ;
445
+ }
421
446
const ringData = ga . child . getPolygonChild ( polygonData ) ;
422
447
const pointData = ga . child . getLineStringChild ( ringData ) ;
423
448
const coordData = ga . child . getPointChild ( pointData ) ;
@@ -499,7 +524,10 @@ export class GeoArrowSolidPolygonLayer<
499
524
recordBatchIdx ++
500
525
) {
501
526
const multiPolygonData = geometryColumn . data [ recordBatchIdx ] ;
502
- const polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
527
+ let polygonData = ga . child . getMultiPolygonChild ( multiPolygonData ) ;
528
+ if ( isGeomSeparate ( polygonData ) ) {
529
+ polygonData = getInterleavedPolygon ( polygonData ) ;
530
+ }
503
531
const ringData = ga . child . getPolygonChild ( polygonData ) ;
504
532
const pointData = ga . child . getLineStringChild ( ringData ) ;
505
533
const coordData = ga . child . getPointChild ( pointData ) ;
0 commit comments