loaders.gl
repository·master·Indexed 21 days ago
https://github.com/visgl/loaders.glA framework-independent collection of loaders for geospatial, 3D, and big data visualization use cases, part of the vis.gl ecosystem. The library includes tools for handling 3D Tiles and I3S formats, a Model3DTiler for converting LAS/LAZ files to Cesium 3D Tiles (PNTS), and integration with Apache Arrow JavaScript for efficient columnar data storage and serialization.
What's inside loaders.gl
- @loaders.gl/gis is a specialized module within the loaders.gl ecosystem that provides helper classes specifically designed for the GIS (Geographic Information System) category of loaders. It serves as a utility layer to support geospatial data parsing and handling within the broader framework-independent loaders.gl collection.
Introduction to loaders.gl
masterloaders.gl is a collection of open source loaders and writers for various file formats, primarily focused on supporting visualization and analytics of big data. It provides composable modules with consistent APIs for tabular, geospatial, and 3D file formats.
Key features include:
- Framework Agnostic: Parses files into plain data structures (objects + typed arrays) usable with any JS framework.
- Streaming Support: Supports incremental parsing for
import {load} from '@loaders.gl/core'; import {CSVLoader} from '@loaders.gl/csv'; const data = await load('data.csv', CSVLoader); for (const row of data) { console.log(JSON.stringify(row)); // => '{header1: value1, header2: value2}' }Overview of Parquet format support
masterloaders.gl provides support for both Apache Parquet and GeoParquet formats. These are binary formats used to store data as Tables or Geometry Tables.
Key characteristics:
- File Extension:
.parquet - MIME Type:
application/octet-stream - Streaming: Supported
- Worker Thread: Not supported
- Loader APIs:
load,parse,parseInBatches - Source APIs:
createDataSource,getMetadata,getSchema,read,close - Writer APIs:
encode,encodeSync
- File Extension:
Overview of @loaders.gl/xml
masterThe@loaders.gl/xmlmodule is an experimental module designed to handle the eXtensible Markup Language (XML) format. It is built on a fork ofsax-ts(a TypeScript fork ofsax-js) to provide XML parsing capabilities within the loaders.gl ecosystem.Overview of @loaders.gl/math
masterThe
@loaders.gl/mathlibrary provides classes and utilities designed for working with 3D geometries (vertex arrays) stored in typed arrays. It follows WebGL/OpenGL layout rules to facilitate efficient processing of vertex data.Note: This library is currently being developed to support 3D tiles and is planned to be moved to the
math.glrepository once it stabilizes.Overview of @loaders.gl/zip capabilities
masterThe
@loaders.gl/zipmodule provides utilities for handling compressed archives. It supports:- ZIP format decompression and compression.
- TAR format decompression and compression.
Note that
ZipLoaderis a wrapper around the JSZip module, meaning it inherits JSZip's capabilities, though it may not expose all of JSZip's advanced options directly.Overview of @loaders.gl/terrain capabilities
masterThe
@loaders.gl/terrainmodule is designed to reconstruct mesh surfaces from two primary source formats:- Height map images: Formats like Mapzen Terrain Tiles that encode elevation data into R,G,B pixel values.
- Quantized mesh: The [quantized-mesh][quantized_mesh] format.
Reconstructed data is typically output as a
Meshor aMesh Arrow table.Overview of available loader categories
masterloaders.gl organizes loaders into categories that return parsed data in standardized forms. This allows applications to handle multiple similar file formats easily.
- Table Loaders: Streaming tabular loaders for CSV, JSON, Parquet, Arrow, etc.
- Geospatial Loaders: Formats like GeoJSON, KML, WKT/WKB, Mapbox Vector Tiles.
- Image Loaders: Standard images and utilities like parsed/binary image APIs.
- Texture Loaders: Compressed textures, Basis textures, and manifest-driven texture loaders.
- Pointcloud and Mesh Loaders: Draco, LAS, PCD, PLY, OBJ, and Terrain.
- Scenegraph Loaders: glTF and OpenUSD.
- Tiled Data Loaders: 3D Tiles, I3S, and potree.
Overview of @loaders.gl/parquet
masterThe
@loaders.gl/parquetmodule is an experimental loader and writer for the Apache Parquet format. It provides multiple ways to interact with Parquet data depending on your performance and data structure needs:- WASM-backed plain-row APIs: Use
ParquetLoaderandParquetWriterfor high-performance operations. - Selective Arrow reads: Use
ParquetSourceLoaderfor reusable, selective Arrow reads that utilize cached schema and footer metadata. - ParquetJS APIs: Use
ParquetJSLoaderandParquetJSWriterfor experimental plain-row and plain-table APIs based onparquetjs.
Data Formats Support:
ParquetLoadercan output Arrow tables by setting the optionparquet.shape: 'arrow-table'.ParquetWriteraccepts loaders.gl Arrow tables as input.
- WASM-backed plain-row APIs: Use
Overview of @loaders.gl/loader-utils
masterThe@loaders.gl/loader-utilsmodule provides shared utility functions used across theloaders.glecosystem. It is primarily designed to help developers normalize and manipulate streamed binary data before passing it to specific loaders. These utilities are framework-independent and support various binary input types includingArrayBuffer,ArrayBufferView, andArrayBufferLike(such asSharedArrayBuffer).Introduction to Apache Arrow JS in loaders.gl
masterThe Apache Arrow JS library provides a JavaScript API designed for working with binary columnar data in the Apache Arrow format. It is used within
loaders.glto handle high-performance data loading. The API provides core classes for:- Batched loading and writing: Efficiently handling large datasets in chunks.
- Column and row access: Navigating data structures.
- Schema management: Defining and interacting with data types and structures.
Overview of @loaders.gl/graphs
masterThe
@loaders.gl/graphsmodule provides parsers for various graph data formats. It is designed to handle graph-based serialization formats and convert them into usable data structures within the loaders.gl ecosystem.Currently, the module supports:
- DOT: A graph description language used for visualizing structural information.
- GraphML: An XML-based format for expressing graph structures.
Future updates will include additional graph serialization formats as they are added to the module.