osmflat-rs icon indicating copy to clipboard operation
osmflat-rs copied to clipboard

Handle negative OSM IDs

Open hallahan opened this issue 3 years ago • 3 comments

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

hallahan avatar Nov 04 '22 17:11 hallahan

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.

VeaaC avatar Nov 05 '22 10:11 VeaaC

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

hallahan avatar Nov 05 '22 14:11 hallahan

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?

boxdot avatar Nov 08 '22 08:11 boxdot