Function decodeDenseNodes
Decode validated DenseNodes coordinates, metadata, and tags into a static sink.
bool decodeDenseNodes(Sink)(
const ref PrimitiveBlockLayout block,
const ref PrimitiveGroupLayout group,
StringTableView table,
ref Sink sink,
out DenseNodeDecodeSummary summary,
out PbfStatus status
) nothrow @nogc @safe;
group must have been produced by decodePrimitiveGroupLayout, and
table must be the StringTable view built from the same PrimitiveBlock.
Before the first sink call, coordinate conversion plus the complete DenseInfo
and dense-tag streams are preflighted, so malformed metadata/tag structure,
invalid string IDs, or arithmetic overflow cannot be discovered only after a
node prefix was already emitted.
The sink must provide a compatible put overload and itself satisfy the
@safe nothrow @nogc contract required by this function instantiation.
Performance-sensitive sinks that consume the mutable tag input range should
accept scope ref DenseNodeView so the callback-scoped borrowed view is not
copied. The view is intentionally non-const because advancing
DenseTagRange mutates its cursor state; an existing by-value
put(DenseNodeView) remains source-compatible.
As an optional zero-overhead hook, a sink may additionally provide
putDenseNodeScalars(long id, long latNano, long lonNano). That overload is
selected only after complete preflight when the DenseNodes sequence contains
neither tags nor DenseInfo; otherwise normal put(DenseNodeView) delivery is
used. The hook therefore changes neither validation nor observable OSM data.
Parameters
| Name | Description |
|---|---|
| block | Validated PrimitiveBlock layout providing granularity and offsets. |
| group | Validated PrimitiveGroup layout containing DenseNodes data. |
| table | Indexed StringTable belonging to block. |
| sink | Consumer receiving nodes in merged protobuf column order. |
| summary | Receives completed decode counts on success; its contents are not
contractually defined after a false return. |
| status | Receives success or a checked arithmetic/defensive wire failure. |
Returns
true on complete decode; false otherwise.