osmflat-rs
osmflat-rs copied to clipboard
Handle negative OSM IDs
Many OSM tools, such as JSOM, assign negative IDs to OSM entities, this denotes that the given entity has not yet been united with the main OSM dataset.
The OSM PBF supports negative IDs, but IdTableBuilder only supports u64.
Here is example data that crashes osmflatc. 4nodes.zip
I assume they are still sorted in the normal way (increasing, negative before positive)? In that case we could just convert Ids to be signed and everything should mostly work as-is.
JOSM does it consecutively, but it starts in strange locations in the negative space.
Another dataset to look at is OSM Daylight. All of the data that is extraneous to the core OSM has negative IDs.
https://daylightmap.org
Looks like the PBF format actually specifies an ID as signed 64 bit int. I guess I made a wrong assumption when porting the format about the ids. I would propose just to change the type of IDs and allow them to be negative. WDYT?