Geopandas 像 Scikit 图像中那样旋转?

问题描述 投票:0回答:1

我想知道是否有一种方法可以转换 geopandas 数据框,类似于 Scikit-image 对 Swirl 所做的事情?

python pandas geopandas scikit-image swirl
1个回答
0
投票

使用 的可能解决方案:

def swirl_poly(poly, **kwargs):
    img = rasterio.features.rasterize([poly], out_shape=(70, 50))
    return swirl( # the out_shape to be adjusted ?
        img,
        rotation=0,
        strength=10,
        radius=60,
        **kwargs,
    ).astype("float32")

绘图(参见完整代码):

© www.soinside.com 2019 - 2024. All rights reserved.