python 类方法中变量如何使用 20
fromosgeoimportgdalimportnumpyasnpclassraster(object):#file_path='D:\\fdem.tif'def__i...
from osgeo import gdal
import numpy as np
class raster(object):
#file_path='D:\\fdem.tif'
def __init__(self,fl):
self.file_path=fl
def reads(self):
data=gdal.Open(file_path)
w=data.RasterXSize
print w
r=raster('D:\\fdem.tif')
r.reads()
为什么这里调用read()出错啊? 展开
import numpy as np
class raster(object):
#file_path='D:\\fdem.tif'
def __init__(self,fl):
self.file_path=fl
def reads(self):
data=gdal.Open(file_path)
w=data.RasterXSize
print w
r=raster('D:\\fdem.tif')
r.reads()
为什么这里调用read()出错啊? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询