Skip to main content

GeoJSON geometry

GeoJSON Geometry

GeoJSON geometry objects describe coordinates and their type without carrying feature properties. They are useful on their own when a pipeline needs geometry before it assembles complete features.

loaders.gl support​

TypeAPI
LoaderGeoJSONLoader
WriterGeoJSONWriter

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​

FormatNotes
WKBBinary, more compact
WKTText based, slightly more compact, a bit harder to parse (not JSON)
GML GeometryXML based, even more verbose, more complex to parse