Skip to main content

Document and table format

JSON

The JSON module handles arbitrary documents, row arrays, newline-delimited records, GeoJSON, and JSON output. Choose the result shape that matches the application instead of writing a new parser path for each variant.

Flexible input, explicit output

Use the document shape you already have.

JSON may be a nested document, a stream of records, or a table-like array. loaders.gl keeps those cases separate while letting applications select object rows, arrays, columns, Arrow, or geometry tables where appropriate.

Documents

Load arbitrary nested JSON without imposing a table schema.

Records

Stream NDJSON or row arrays incrementally.

Geospatial

Decode GeoJSON into shared geometry data shapes.

Output

Write JSON values or compatible table representations.

Detailed guide

JSON format and API details

The reference below compares JSON loaders, streaming variants, GeoJSON behavior, output shapes, and writers.

Loaders and Writers​

CharacteristicValue
File FormatJSON
Data FormatJSON objects, arrays, and Tables
File TypeText
File Extension.json
MIME Typesapplication/json

Streaming Variants​

FormatExtensionMIME Media TypeSupport
JSON.jsonapplication/json✅ JSONLoader
NewLine Delimited JSON.ndjsonapplication/x-ndjson✅ NDJSONLoader
JSON Lines.jsonlapplication/x-ldjson✅ NDJSONLoader
JSON Text Sequencesapplication/json-seq⚠️ NDJSONLoader. Partial records must not span multiple lines.
GeoJSON.geojsonapplication/geo+json✅ GeoJSONLoader
Newline Delimited GeoJSON.ndgeojson✅ NDGeoJSONLoader
GeoJSON Lines.geojsonl✅ NDGeoJSONLoader
GeoJSON Text Sequencesapplication/geo+json-seq⚠️ NDGeoJSONLoader. Each Feature must fit on one line.