Skip to main content

toWKB

Converts a geometry object to its Well-Known Binary (WKB) representation.

Parameters

NameTypeDefaultDescription
geometryGeometryThe geometry object to be converted to WKB
options?objectOptional WKB output configuration
options.dim?2 | 3 | 44Output dimensionality of the writer.
options.flavor?'extended' | 'iso''extended'Output flavor of the writer.
options.byteOrder?'le' | 'be''le'Output byte order of the writer. Little/Big Endian.
options.srid?booleanfalseWhether SRID values should be output in WKB. Many WKB readers do not support SRID values, use with caution.

Returns

Uint8Array

A Uint8Array containing the WKB representation of the geometry

See also

Examples