Could not find or result: ..result input

 

注意:这里看关键错误信息:result input ,这个错误是由于前端参数和后台bean封装的属性类型不一致导致的

解决方案:

查看前端传递的数据的属性和服务端用于接收封装该属性的类的定义是否一致,是否唯一!包括你传入数据的类型。。。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import numpy as np from osgeo import gdal from xml.dom import minidom import sys import os os.environ['PROJ_LIB'] = r"D:\test\proj.db" gdal.UseExceptions() # 引入异常处理 gdal.AllRegister() # 注册所有的驱动 def atmospheric_correction(image_path, output_path, solar_elevation, aerosol_optical_depth): # 读取遥感影像 dataset = gdal.Open(image_path, gdal.GA_ReadOnly) if dataset is None: print('Could not open %s' % image_path) return band = dataset.GetRasterBand(1) image = band.ReadAsArray().astype(np.float32) # 进行大气校正 corrected_image = (image - aerosol_optical_depth) / np.sin(np.radians(solar_elevation)) # 创建输出校正结果的影像 driver = gdal.GetDriverByName('GTiff') if driver is None: print('Could not find GTiff driver') return output_dataset = driver.Create(output_path, dataset.RasterXSize, dataset.RasterYSize, 1, gdal.GDT_Float32) if output_dataset is None: print('Could not create output dataset %s' % output_path) return output_dataset.SetProjection(dataset.GetProjection()) output_dataset.SetGeoTransform(dataset.GetGeoTransform()) # 写入校正结果 output_band = output_dataset.GetRasterBand(1) output_band.WriteArray(corrected_image) # 关闭数据集 output_band = None output_dataset = None band = None dataset = None print('Atmospheric correction completed.') if __name__ == '__main__': if len(sys.argv) == 1: workspace = r"D:\test\FLAASH_ALL_ALL_V1.0.xml" else: workspace = sys.argv[1] # 解析xml文件接口 Product = minidom.parse(workspace).documentElement # 解析xml文件(句柄或文件路径) a1 = Product.getElementsByTagName('ParaValue') # 获取输入路径的节点名 ParaValue = [] for i in a1: ParaValue.append(i.childNodes[0].data) # 获取存储路径的节点名 image_path = ParaValue[0] output_path = ParaValue[1] # image_path = r"D:\Project1\data\input\11.tif" # output_path = r"D:\test\result\2.tif" solar_elevation = 30 # 太阳高度角(单位:度) aerosol_optical_depth = 0.2 # 气溶胶光学厚度 atmospheric_correction(image_path, output_path, solar_elevation, aerosol_optical_depth) 根据这段代码写一个技术路线流程
最新发布
06-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值