当我尝试为属性 CA 栅格化 shapefile(冰图)时,它不起作用。它给了我一个大小为 1 KB 的 geotiff 文件。当我在 QGIS 上打开它时,什么也没有显示,因为它是空的。
import geopandas as gpd
from geocube.api.core import make_geocube
ds = gpd.read_file('cis_SGRDAEA_20110201_pl_a.shp')
ds['CA'] = ds['CA'].astype(float)
grid = make_geocube(vector_data=ds, measurements=['CA'], resolution=(5000,-5000))
grid.CA.rio.to_raster('test.tif')