Skip to main content

GeoArrow geometry utility

triangulateWKBGeometryColumn

triangulateWKBGeometryColumn converts Polygon and MultiPolygon WKB values into Arrow columns for triangle indexes and source XY vertices, keeping one output row aligned with each input geometry.

The geometry path

Decode geometry. Tessellate rings. Return aligned columns.

The helper keeps the geometry column in Arrow form while making its polygon topology easy for renderers and GPU pipelines to consume.

Input

Arrow Binary vector containing GeoArrow WKB

Geometry

Polygon and MultiPolygon values

Output

Triangle indexes plus XY vertices

Nulls

Null input rows remain null output rows

triangulateWKBGeometryColumn tessellates a GeoArrow WKB geometry column and returns two Apache Arrow columns: triangle vertex indexes and the source XY vertices.

The helper accepts Polygon and MultiPolygon WKB values. Each output row matches the corresponding input geometry row. Null input rows produce null output rows.

Detailed guide

Geometry and output details

The reference below covers input vectors, output column types, row alignment, null behavior, and worker usage.

Usage​

import {triangulateWKBGeometryColumn} from '@loaders.gl/tables/arrow';

const {vertexIndices, vertices} = triangulateWKBGeometryColumn(geometryColumn);

API​

triangulateWKBGeometryColumn(geometryColumn);

geometryColumn is an Apache Arrow JS Vector<Binary> containing GeoArrow WKB geometry values.

Returns an object with:

FieldTypeDescription
vertexIndicesVector<List<Int32>>Triangle indexes into the matching vertices row
verticesVector<List<FixedSizeList[2]<Float64>>>XY source vertices, preserving WKB vertex order

Worker API​

triangulateWKBColumnOnWorker runs the same operation on the triangulation worker. It accepts a structured-cloneable Arrow Data payload and returns serialized Arrow data for the two output columns.