Talk:64-bit Identifiers

From OpenStreetMap Wiki
Jump to: navigation, search

about Osmosis: I have no problems in cuttings files using polygons. Please be more specific about "filters", osmosis-version, ... wambacher 16:00 Feb, 6 2013

Did you try with big node ids? See this message: osmosis will fail when it encounters id too big for int32. --Zverik (talk) 18:55, 6 February 2013 (UTC)
I did - like wambacher - try with Frederiks 64-bit test data set. Polygon filtering (--bp) went just fine, no problems there. Is that code you're pointing to still being used? Or does the size of an int (which the piece of code casts to) depend on the Java VM? --Oli-Wan (talk)
In Java the size of int (32bit) and long (64bit) is fixed. To have 64bit a long must be used. If the source uses int then it's broken. See JVM specification [1] --Stephankn (talk) 21:21, 6 February 2013 (UTC)
Thanks Stephankn, as a C++ user I normally expect integers to have varying widths on every platform...
I just searched the code for uses of the LongAsInt code pointed to by Zverik. In and it operates only on changeset IDs, which will not cause trouble in the near future. The code in and, however, seems problematic as it contains various int's and also uses the LongAsInt code. Are those IdTracker implementations actually being used, perhaps only if certain operations are being carried out? As said above, polygon filtering worked fine for me.
Having had another glimpse at the code, it appears to me that DynamicIdTracker is always used whenever an IdTracker is needed. If that impression is true, then yes, the two other IdTrackers are broken (or will be soon), but osmosis will still continue working as it does not use those trackers. --Oli-Wan (talk)
DynamicIdTracker is just a wrapper class for BitSetIdTracker and ListIdTracker. But it puzzles me if osmosis works on the test data. LongAsInt is a possible problem, and as long as it exists and is being used, we can't be sure osmosis will work fine with big ids, even if it passes some tests. --Zverik (talk) 05:13, 7 February 2013 (UTC)
I think the puzzle has now been solved by Brett. If I understand correctly, osmosis 0.41 is mostly 231-proof, the only exceptions being the options --used-node and --used-way. I suggest to rewrite the remark on the wiki page correspondingly, e.g.
Osmosis: Recent versions (in particular, the current version 0.41) will work in most cases, with the following exception: the options --used-node or --used-way will, in general, break, unless the additional option idTracker=Dynamic is supplied. Alternatively, use the GitHub code as of October 26, 2012, or later (or version 0.42, when released), which is expected to be completely 231-proof (and uses the dynamic IdTracker by default).
--Oli-Wan (talk) 11:05, 7 February 2013 (UTC)