def encode_tile_key(self, project_info, resolution, x_index, y_index, z_index, t_index=0):
"""A method to create a tile key.
The tile key is the key used for each individual tile file.
Args:
project_info(list): A list of strings containing the project/data model information for where data belongs
resolution(int): The level of the resolution hierarchy. Typically 0
x_index(int): The x tile index
y_index(int): The y tile index
z_index(int): The z tile index
t_index(int): The time index
Returns:
(str): The object key to use for uploading to the tile bucket
"""
proj_str = six.u("&".join([str(x) for x in project_info]))
base_key = six.u("{}&{}&{}&{}&{}&{}".format(proj_str, resolution, x_index, y_index, z_index, t_index))
hashm = hashlib.md5()
hashm.update(base_key.encode())
return six.u("{}&{}".format(hashm.hexdigest(), base_key))
评论列表
文章目录