loaders.gl icon indicating copy to clipboard operation
loaders.gl copied to clipboard

WIP: Add parsed byte length to Shapefile parseInBatches

Open kylebarron opened this issue 4 years ago • 4 comments

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?

kylebarron avatar Jan 15 '21 19:01 kylebarron

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

kylebarron avatar Jan 15 '21 20:01 kylebarron

Adding a simple typescript type for the batch structure {data: any[]; progress:{ ... }} would probably prevent a ton of silly mistakes.

ibgreen avatar Jan 15 '21 20:01 ibgreen

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?

kylebarron avatar Jan 15 '21 20:01 kylebarron

No. d.ts FTW, I am afraid.

ibgreen avatar Jan 15 '21 20:01 ibgreen

Close due to inactivity

ibgreen avatar Apr 02 '24 20:04 ibgreen