loaders.gl support
| Type | API |
|---|---|
| Loader | GeoJSONLoader |
| Writer | GeoJSONWriter |
The geometry boundary
Choose the type. Supply coordinates. Let the feature layer add context.
Geometry is the spatial part of a GeoJSON feature. Keeping it separate is useful for geometry-only APIs, validation, conversion, and renderer-facing data paths.
Type
Point, LineString, Polygon, or Multi* geometry
Coordinates
Nested arrays matching the geometry type
Context
Properties and IDs belong to the feature layer
Alternatives
WKB for compact binary, WKT for text geometry
GeoJSON geometries can sometimes be useful independently of GeoJSON.
Detailed guide
Geometry structure details
The reference below covers coordinate nesting, geometry examples, and the tradeoffs against WKB, WKT, and GML geometry.
Examples
{
"type": "Point",
"coordinates": [102.0, 0.5]
},
{
"type": "LineString",
"coordinates": [
[102.0, 0.0],
[103.0, 1.0],
[104.0, 0.0],
[105.0, 1.0]
]
},
{
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
]
]
}
Alternatives
| Format | Notes |
|---|---|
| WKB | Binary, more compact |
| WKT | Text based, slightly more compact, a bit harder to parse (not JSON) |
| GML Geometry | XML based, even more verbose, more complex to parse |