utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:marblecutter 作者: mojodna 项目源码 文件源码
def apply_latitude_adjustments(pixels):
    data, (bounds, crs), _ = pixels
    (_, height, width) = data.shape

    ys = np.interp(np.arange(height), [0, height - 1], [bounds[3], bounds[1]])
    xs = np.empty_like(ys)
    xs.fill(bounds[0])

    longitudes, latitudes = warp.transform(crs, WGS84_CRS, xs, ys)

    factors = 1 / np.cos(np.radians(latitudes))

    # convert to 2d array, rotate 270º, scale data
    return PixelCollection(data * np.rot90(np.atleast_2d(factors), 3),
                           pixels.bounds)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号