from rasterio. _base import gdal_version, DLL load failed: 找不到指定的模块”

问题1:python 3.9下,导入rasterio和gdal出现错误。from rasterio. _base import gdal_version, DLL load failed: 找不到指定的模块”

 解决办法:直接在pycharm中安装gdal==3.4.3,rasterio==1.3.8, rioxarray==0.15.0, xarray==2023.8.0.

问题2:in rasterio.crs.CRS.from_user_input rasterio.errors.CRSError: CRS is invalid

resampled_data = data2.rio.reproject("epsg:4326", resolution=[0.1, 0.1])

问题3:reproject
    raise MissingCRS(
rioxarray.exceptions.MissingCRS: CRS not found. Please set the CRS with 'rio.write_crs()'. Data variable

def set_crs(data):
    data.rio.write_crs("EPSG:4326", inplace=True) #要点,要加inplace=True
set_crs(data2)

你可能感兴趣的:(python)