def compute_scale_for_cesium(coordmin, coordmax):
'''
Cesium quantized positions need to be in uint16
This function computes the best scale to apply to coordinates
to fit the range [0, 65535]
'''
max_int = np.iinfo(np.uint16).max
delta = abs(coordmax - coordmin)
scale = 10 ** -(math.floor(math.log1p(max_int / delta) / math.log1p(10)))
return scale
评论列表
文章目录