def _init_index(self): self._initialized = True if os.path.exists(self.filename): return ensure_directory(self.filename) buf = BytesIO() buf.write(struct.pack(BUNDLE_V2_HEADER_STRUCT_FORMAT, *BUNDLE_V2_HEADER)) # Empty index (ArcGIS stores an offset of 4 and size of 0 for missing tiles) buf.write(struct.pack('<%dQ' % BUNDLE_V2_TILES, *(4, ) * BUNDLE_V2_TILES)) write_atomic(self.filename, buf.getvalue())
def _init_index(self): self._initialized = True if os.path.exists(self.filename): return ensure_directory(self.filename) buf = BytesIO() buf.write( struct.pack(BUNDLE_V2_HEADER_STRUCT_FORMAT, *BUNDLE_V2_HEADER)) # Empty index (ArcGIS stores an offset of 4 and size of 0 for missing tiles) buf.write( struct.pack('<%dQ' % BUNDLE_V2_TILES, *(4, ) * BUNDLE_V2_TILES)) write_atomic(self.filename, buf.getvalue())
def _init_index(self): self._initialized = True if os.path.exists(self.filename): return ensure_directory(self.filename) buf = BytesIO() buf.write(BUNDLEX_HEADER) for i in range(BUNDLEX_GRID_WIDTH * BUNDLEX_GRID_HEIGHT): buf.write(struct.pack('<Q', (i*4)+BUNDLE_HEADER_SIZE)[:5]) buf.write(BUNDLEX_FOOTER) write_atomic(self.filename, buf.getvalue())