Open deanm0000 opened 4 months ago
In theory we could bind to earcutr here, but it won't be that useful for deck.gl-layers. The output of earcut is a different length of data than the number of rows, so it doesn't really fit into an Arrow table or Parquet file. And on the frontend earcut is already done on 8 worker threads, so it's not a big slowdown
I'm getting, what seems to be, significant time spent earcutting. Here's a profile...
I'm not sure what you mean about a different number of rows. I'm thinking that each row is its own polygon that gets earcut independently of other rows and so the new List that makes up the polygon will be a different length but I don't know why it'd be a different number of rows.
earcut should be on a separate worker by default https://github.com/geoarrow/deck.gl-layers/blob/25fdeafe2d9c591570bab975ebea43ae82e97a8d/src/solid-polygon-layer.ts#L69-L75.
I noticed that the deck.gl layers does earcut on the client but it'd be nice to create geometry source data that has already been earcutted for better performance. https://github.com/frewsxcv/earcutr