Module osm.model.compare
Exact semantic comparison for durable OSM/PBF values.
These functions compare the M4 owned meaning rather than protobuf representation. They are allocation-free and preserve order-sensitive OSM structures such as tags, Way references and Relation members.
comparePbfSemantics additionally reports the first deterministic semantic
difference so round-trip failures identify the useful field instead of
collapsing to a boolean mismatch.
Date
2026-11-03
Functions
| Name | Description |
|---|---|
comparePbfSemantics(a, b, difference)
|
Compare complete known PBF semantics and report the first mismatch. |
sameChangeSemantics(a, b)
|
Compare ordered format-independent OSM change semantics exactly. |
sameOsmSemantics(a, b)
|
Compare all owned OSM element semantics exactly. |
samePbfHeaderSemantics(a, b)
|
Compare known PBF HeaderBlock semantics exactly, including feature order. |
samePbfRawSource(a, b)
|
Compare captured raw sources byte-for-byte. |
samePbfSemantics(a, b)
|
Compare the known semantic content of two PBF documents. |
Structs
| Name | Description |
|---|---|
PbfSemanticDifference
|
Location of the first semantic mismatch. |
Enums
| Name | Description |
|---|---|
PbfSemanticField
|
Field/category identifying the first semantic difference. |