Function validateUploadChanges
Validate an ordered change sequence for OSM API-style upload.
bool validateUploadChanges(
ref const(OwnedChangeSequence) changes,
CapabilityProfile capabilities,
out UploadValidationIssue issue
) @safe;
Rules enforced independently of target-server capability values:
- create/modify objects are complete; - element ID zero is rejected; - create IDs are negative and unique per element namespace; - modify/delete target positive established IDs; - every entry carries a positive changeset ID; - modify/delete carry a positive authoritative version; - Node coordinates are in world bounds and losslessly representable at 1e-7 degree (100 nanodegrees); - tag UTF-8/key/value length and duplicate-key rules; - Way LocationsOnWays payload is rejected because osmChange XML cannot represent it; - zero references are rejected; - every negative/local reference resolves to a preceding create entry of the same element type, so forward references and placeholder cycles fail.
Optional CapabilityProfile limits are applied when nonzero. The changeset element limit applies to this sequence/request only; callers assembling a changeset across multiple requests must account for already uploaded objects separately.
The function does not reorder or repair input. It uses a temporary hash index proportional to the number of create placeholders so negative references can be checked in one forward pass. This validation boundary is not a parser hot path; callers that later need allocation reuse can use a dedicated validation workspace without changing the semantic contract.