visgl / loaders.gl

Loaders for big data visualization. Website:
https://loaders.gl
Other
678 stars 187 forks source link

Batched geojson loader freezes #3028

Open sebakerckhof opened 1 month ago

sebakerckhof commented 1 month ago

I'm trying to use the batched geojson loader, but it never finishes reading the file.

import { _GeoJSONLoader as GeoJSONLoader } from '@loaders.gl/json';
import { loadInBatches } from '@loaders.gl/core';
  const batches = await loadInBatches(
    'geojson-500k.json',
    GeoJSONLoader,
    { json: { jsonpaths: ['$.features'] } }
  );
for await (const batch of batches) {
console.log('reading', batch.data.length, 'features');
}
console.log('done')

We never reach done and it reads only about 80K out of the 500K features. The last feature it reads before halting is: { type: 'Feature' }, so without geometry, although all features in the geojson file have a geometry

File is too big to attach, but can be downloaded from: https://happyrainbowfactory.com/geojson-500k.zip