Skip to content

Conversation

@zihaooo
Copy link

@zihaooo zihaooo commented Oct 29, 2025

Description

When using osmium sort, object IDs are sorted according to the following rule:

Compare two object IDs. Order is as follows: 0 first, then negative IDs, then positive IDs — both ordered by their absolute values.
(See object_comparisons.hpp#L83-L110)

However, in osmium merge, the order validation currently relies on a plain numerical comparison of IDs.
As a result, osmium merge may fail when merging files produced by osmium sort if negative IDs are present.

Proposed fix

This pull request addresses the mismatch by reusing the id_order comparator defined in
object_comparisons.hpp.
Specifically, it replaces the simple numeric comparison in osmium merge with id_order, ensuring consistency with osmium sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant