我有一个简单的kmeans示例,我正试图在GoogleColab中使用它,但现在GoogleDrive无法正确加载到我的Geotiff中。我使用gdal的方式是否有问题?谢谢
### mount google drive
from google.colab import drive
from sklearn.cluster import KMeans
import os
from osgeo import gdal
import numpy as np
drive.mount('/content/gdrive')
!ls
output: Drive already mounted at /content/gdrive; to attempt to forcibly remount, call drive.mount("/content/gdrive", force_remount=True). gdrive sample_data
### load image
naip_fn = './gdrive/MOD13A1.006__500m_16_days_EVI_doy2021065_aid0001.tif'
driverTiff = gdal.GetDriverByName('GTiff')
image = gdal.Open(naip_fn,gdal.GA_ReadOnly)
print(image)
output: None
原来这只是谷歌硬盘路径的问题。从Google Drive加载数据时,需要我的硬盘部分,即
相关问题 更多 >
编程相关推荐