Expand description
Arrow-based tile payload format.
A tile’s payload is one or more layers. Each layer is a single Arrow
RecordBatch serialised as an Arrow IPC stream. Geometry is encoded
using the GeoArrow interleaved-coordinate convention so the payload can be
consumed directly by GeoArrow-aware renderers (e.g. @geoarrow/deck.gl).
§Per-layer schema
| column | type | notes |
|---|---|---|
id | UInt64 | feature id |
start_time | Int64 | Unix ms, absolute |
end_time | Int64 | Unix ms, absolute |
geometry | GeoArrow point / linestring / polygon | interleaved f64 lon/lat |
vertex_time | List<UInt16> deltas or List<Int64> (nullable) | per-vertex Unix ms (optional; see [build_vertex_time_array]) |
vertex_value | List<Float32> (nullable) | per-vertex scalar, e.g. SST (optional) |
triangles | List<UInt16> or List<UInt32> | pre-baked earcut indices, feature-local (optional; polygon only) |
<property> | Float64 or Dictionary<UInt16,Utf8> | one column per property |
All layers in one tile are concatenated with a tiny frame so a tile can carry, say, a linestring layer and a point layer side by side:
[u16 layer_count | ALIGNED_FRAME_FLAG]
repeated: [u16 name_len][name utf8][u32 ipc_len][pad to 8][ipc stream bytes]The leading u16’s top bit (ALIGNED_FRAME_FLAG) marks the aligned
frame: zero padding after each ipc_len places every Arrow IPC stream at
an 8-byte boundary relative to the payload start, so readers can hand the
stream to an Arrow implementation zero-copy (Arrow buffers are 8-byte
aligned within a stream; the stream itself must start aligned for that
to survive). The pad length is not stored — readers derive it as
(8 - pos % 8) % 8 from the position after ipc_len. Frames without the
flag (every archive written before the flag existed) carry no padding and
decode exactly as before.
Structs§
- Attr
Quant - Per-numeric-property quantization affine:
value = o + q * s, whereois the column minimum (the dequantization offset) andsthe requested ground precision (the step). Reconstruction is lossy to ≤s/2; the reader applies the identical math (tile.ts). - Columnar
Layer - One decoded/encodable tile layer.
- Decoded
Layer - A decoded tile layer: its name and the raw Arrow
RecordBatch. - Encoder
Config - Resolved, explicit encoder settings — the values the tile encoder reads at encode time (coordinate + attribute quantization, vector grouping, the point-elevation fold, vertex-time precision).
- Quant
Affine - Per-layer coordinate-quantization affine. Coordinates ship as
i32grid indices; the decoder reconstructslon = x0 + qx*sx,lat = y0 + qy*sy.sx/sy(degrees per quantum) are sized from a target ground precision in meters at the layer’s mid-latitude, so the worst-case error is ≤ half a quantum (~meters/2). This trades GeoArrow self-describing Float64 for size (coords are the dominant, near-incompressible column) and is opt-in. - Vector
Group - A build-time directive to fuse several scalar numeric properties into one
GPU-ready interleaved
PropertyColumn::Vector. The component order is the vector’s component order (e.g.["qx","qy","qz","qw"]→instanceQuaternions). Applied at encode time (like the quantization maps), so the producer keeps emitting plain scalar columns and the renderer still binds the result zero-copy. Seeset_vector_groups.
Enums§
- Geometry
Column - Geometry for one layer, grouped by kind. Every feature in a layer shares one kind — the tiler emits a separate layer per geometry type.
- Property
Column - A property column. Values are per-feature and may be missing.
- Vector
Elem - Leaf element type of a
PropertyColumn::Vector— the GPU upload type the renderer binds the decoded child buffer as.
Constants§
- ALIGNED_
FRAME_ FLAG - Top bit of the layer frame’s leading u16: marks an aligned frame whose
IPC streams are padded to 8-byte boundaries (see the module docs). The
remaining 15 bits carry the layer count, so a tile may have at most
0x7ffflayers. Old frames never set this bit (layer counts are tiny). - DEFAULT_
VERTEX_ TIME_ MAX_ STEP_ MS - Default ceiling (ms) on the u16-delta
vertex_timequantization step. - STT_
QUANT_ ATTR_ META_ KEY - Field-metadata key flagging a numeric property column that ships as
fixed-point integer indices (smallest of
UInt16/Int32) instead ofFloat64. Its value is theAttrQuantJSON (value = o + q*s). Sibling ofSTT_QUANT_META_KEYfor geometry; lives on the property field, so a reader reconstructs Float64 the same way it does coordinates. - STT_
QUANT_ META_ KEY - Schema-metadata key (on the
geometryfield) that flags a tile whose coordinates are fixed-pointi32grid indices rather than GeoArrow Float64 lon/lat. Its value is theQuantAffineJSON; absent ⇒ standard Float64. - TRIANGLES_
METADATA_ KEY - Schema-metadata key set on layers that carry pre-baked triangle indices.
Functions§
- decode_
layer - Decode a single-layer Arrow IPC stream into a
RecordBatch. - decode_
tile - Decode a full tile payload (the layer frame) into its layers.
- encode_
layer - Encode a single layer to an Arrow IPC stream.
- encode_
layer_ quantized encode_layerwith optional fixed-point coordinate quantization.- encode_
layer_ with encode_layerwith a fully-explicitEncoderConfig— no process-wide globals are read. This is the concurrency- and multi-config-safe entry point (e.g. a dynamic server fronting several datasets with different settings).- encode_
tile - Encode a full tile payload (one or more layers) with the layer frame.
- encode_
tile_ quantized encode_tilewith optional fixed-point coordinate quantization applied to every layer (seeencode_layer_quantized).quantize_m = Noneis byte-identical toencode_tile; the other encoder settings come from the process-wide globals.- encode_
tile_ with encode_tilewith a fully-explicitEncoderConfig— no process-wide globals are read. The concurrency- and multi-config-safe entry point a dynamic per-request tile server uses so each dataset/request encodes with its own settings without touching shared state.- point_
elevation_ column - The current point-elevation column name (empty ⇒ disabled).
- quantize_
attrs - The current numeric-property quantization map (a clone).
- quantize_
attrs_ auto - Whether automatic numeric-property quantization is enabled.
- quantize_
coords_ m - The build-global quantization precision in meters, or
Nonewhen off. - set_
point_ elevation_ column - Set the build-global point-elevation column name (see above). Empty disables.
- set_
quantize_ attrs - Replace the build-global numeric-property quantization map.
- set_
quantize_ attrs_ auto - Enable/disable automatic range-adaptive quantization of every otherwise-raw
Float64numeric property (see [QUANTIZE_ATTRS_AUTO]). Explicit precisions inset_quantize_attrsalways win. - set_
quantize_ coords_ m - Set the build-global coordinate quantization precision in meters for every
subsequent default
encode_tilecall.<= 0(the default) turns it off — coordinates stay Float64 GeoArrow. Seeencode_layer_quantizedfor the size/precision trade-off. - set_
vector_ groups - Replace the build-global vector-group list.
- set_
vertex_ time_ max_ step_ ms - Override the u16-delta
vertex_timestep ceiling for every subsequentencode_layercall. Values below 1 ms clamp to 1 (every layer with a span beyond u16 milliseconds then takes the exactList<Int64>path). - tessellate_
polygon - Tessellate one polygon feature (a list of rings) using earcut. Returns the flat triangle index list — each triple of indices is one triangle, indices are LOCAL (relative to the start of the feature’s coordinate run, where the exterior ring sits first followed by every hole).
- vector_
groups - The current vector-group list (a clone).
- vertex_
time_ max_ step_ ms - The currently configured u16-delta
vertex_timestep ceiling (ms).
Type Aliases§
- Coord
- A single coordinate pair (lon, lat) in WGS84 degrees.