Skip to main content

WKT and WKB module

Keep geometry and coordinate systems interoperable.

@loaders.gl/geospatial/wkt handles OGC Well-Known Text, Well-Known Binary, and WKT coordinate reference systems. It provides loaders and writers for the syntax boundaries that appear across GIS formats.

The geometry syntax path

Parse text or bytes. Preserve the geometry meaning.

Choose WKT for readable interchange, WKB for compact binary geometry, or WKT-CRS for spatial reference definitions. The same module also provides the corresponding writers.

WKT

Readable geometry text

WKB

Compact binary geometry

WKT-CRS

Coordinate reference system syntax

Output

Geometry or CRS objects for GIS pipelines

Detailed guide

Format and API details

The reference below covers supported syntaxes, loaders, writers, CRS handling, and the upstream implementations used by the module.

See Coordinate Reference Systems for WKT syntax handling, shared CRS types, and cross-format CRS support.

Formats​

The @loaders.gl/geospatial/wkt module handles the following formats:

FormatDescription
Well Known Text (WKT)ASCII format for geometry features
Well Known Binary (WKB)Binary format for geometry features
Well Known Text Coordinate Reference System (WKT-CRS)Text format for spatial reference systems

Loaders and Writers​

Loader / WriterDescription
WKBLoaderParses Well-Known Binary geometry.
WKBWriterWrites geometry as Well-Known Binary.
WKTLoaderParses Well-Known Text geometry.
WKTWriterWrites geometry as Well-Known Text.
WKTCRSLoaderParses Well-Known Text coordinate reference systems.
WKTCRSWriterWrites coordinate reference systems as WKT-CRS.

Attribution​

The WKTLoader is based on a fork of the Mapbox wellknown module under the ISC license (MIT/BSD 2-clause equivalent). The WKBLoader and WKBWriter are forked from https://github.com/cschwarz/wkx under MIT license, Copyright (c) 2013 Christian Schwarz. The WKTCRSLoader and WKTCRSWriter are thin adapters over the dependency-free syntax codecs in @math.gl/geospatial/crs.

Sources and credits​

See the package source and license inventory and the project-wide Attributions and Credits.