loaders.gl
loaders.gl copied to clipboard
WIP: Add parsed byte length to Shapefile parseInBatches
The Shapefile Loader's parseInBatches function currently emits batches that don't include metadata about progress. It looks like a bytesUsed key is necessary on each batch. The main impediment to this is the zipBatchIterator, since that currently requires that the input iterators emit plain arrays, instead of objects that include an array in a key.
I figured I'd post this draft PR for feedback. Maybe there's an easier way forward than rewriting zipBatchIterator... better to intercept the batches from the SHPLoader, extract the progress metadata, and then pass normal arrays to zipBatchIterator?
Do we have good tests for zip-batch-iterators and they were not broken?
I don't believe we currently have any tests specifically for zipBatchIterators: https://github.com/visgl/loaders.gl/search?q=zipBatchIterators, but this is WIP and probably isn't working in its current state
Adding a simple typescript type for the batch structure {data: any[]; progress:{ ... }} would probably prevent a ton of silly mistakes.
Adding a simple typescript type for the batch structure
Yes that would make sense. Does loaders.gl have support yet for optionally writing the code in .ts files instead of the neighboring stubs?
No. d.ts FTW, I am afraid.
Close due to inactivity