Esri / raster-tiles-compactcache

Compact Cache V2 is used by ArcGIS to store raster tiles. The bundle file structure is very simple and optimized for quick access, resulting in improved performance over alternative formats.
Apache License 2.0
60 stars 27 forks source link

confused with line 166 in vundler.py #10

Closed alongsang closed 1 year ago

alongsang commented 1 year ago

curr_index[(row % BSZ ) BSZ + col % BSZ] = curr_offset + (tsize << 40) what does the (tsize << 40) mean? i think it should be like this: curr_index[(row % BSZ ) BSZ + col % BSZ] = curr_offset

lucianpls commented 1 year ago

The code is correct. tsize << 40 is the left bitwise shift of the tsize value by 40 positions, equivalent with tsize * (2 ** 40). It moves the tile size into the bits 40 to 63, as described in Tile Index Record paragraph.

alongsang commented 1 year ago

Thanks for the update on the issue.