@loaders.gl/json module parses JSON. It can parse arbitrary JSON data but is optimized for:
- loading tabular data stored in JSON arrays.
- loading tabular geospatial data stored in GeoJSON.
- loading tabular data from various streaming JSON and GeoJSON formats, such as new-line delimited JSON.
The JSON loaders also support batched parsing which can be useful when loading very large tabular JSON files to avoid blocking for tens of seconds.
npm install @loaders.gl/core @loaders.gl/json
Loaders and Writers
JSON Format Notes
The classic JSON format was designed for simplicity and is supported by standard libraries in many programming languages.
Several JSON Streaming Formats (Wikipedia) have emerged, that typically
place one JSON object on each line of a file. These are convenient to use when streaming data and are
supported by via the
At the moment, auto-detection between streaming and classic JSON based on file contents is not implemented, so two separate loaders are provided. The two loaders look for different file extensions or MIME types as specified in the table below, allowing correct distinctions to be made in usage.
|Format||Extension||MIME Media Type||Support|
|NewLine Delimited JSON|
|JSON Text Sequences|
|Newline Delimited GeoJSON|
|GeoJSON Text Sequences|