HEG安装及hdf文件转tif文件批处理

HEG(HDF-EOS to GeoTIFF (HEG) Converter)安装及hdf文件转tif文件批处理

HEG下载地址:

https://ladsweb.modaps.eosdis.nasa.gov/

https://ladsweb.modaps.eosdis.nasa.gov/tools-and-services/

http://hdfeos.org/software/heg.php

 

下载Java

https://www.oracle.com/cn/java/

 

程序安装

 

1.安装Java(JDK1.8或JRE8或更新的Windows版本)。

2.解压hegWINv2.15.Build9.8.zip到当前目录。

3.双击上的install.bat,并按照MS - DOS窗口上的指令输入。

(1) 第一步:提示是否安装HEG,输入y,回车

(2) 第二步:提示输入HEG安装路径,以d:/heg为例,输入后回车

(3) 提示输入java的bin目录所在的路径,以c:/java/bin为例,输入后回车

(4) 提示输入用户名,不能跳过,必须输入(自定英文),否则安装完成后,会导致打开hdf文件失败。

注意事项:

1. Java安装路径尽可能不要有特殊字符如() - _

2. Java 和HEG 安装时,安装路径名称中不能有空格。

3. HEG安装时,安装路径中的'\'用'/'替换。

4. 安装路径为英文路径无空格无特殊字符,同时路径要尽可能的浅短。eg. D:/heg

 

原英文安装说明如下:

Installation on Windows 7, 8, and 10    Download  hegWINv2.15.zip file.

0.  Place the zip file hegWINv2.15.zip in a directory that does NOT HAVE ANY SPACES in the directory pathname. HEG will be installed under this path tree.

1.  Install java (jdk1.8 or jre8 or newer windows version).

2.  Unzip hegWINv2.15.zip to the current directory.

3.  Double click on install.bat and follow the instruction in MS-DOS window that appears.

4.  A file HEGTool.bat will be created by the installation in HEG\HEG_Win\bin directory.

5.  Go to this bin directory, where HEGTool.bat file is, and right click on HEGTool.bat. Click on the Create Shortcut. You can change the icon for this shortcut as in step 6.

6.  Right click on the HEGTool.bat Shortcut. Click on the Properties and then click on the Change Icon. Now click on Browse and select the file "heg.ico" in the HEG_Win\bin directory

7.  To run HEG Double click on the created shortcut(s) or the HEGTool.bat in the HEG_Win\bin directory.

 

Note: Sometimes after clicking on install.bat a MS-DOS window appears for a very short time and then disappears. If that is the case, then some error has caused it. To see what the error was and to correct the problem, first open MS-DOS Command Prompt window yourself. In that window change the directory to the one that HEG install.bat is. Type install.bat and push Enter. You may now see what the error is and take appropriate action to correct the problem.

Also if you succeed in installing HEG and creating HEGTool.bat you may get error during opening HEGTool.bat. If after clicking on HEGTool.bat the MS-DOS window appears for a very short time and then disappears, then you are having some kind of error in HEGTool.bat. To see what the error is and to correct it do the following:

1. Open MS-DOS Command Prompt window yourself. In that window change the directory to the one that HEG's bin directory is.

2. Type HEGTool.bat and press Return. You will get an error. Correct the problem (Which more likely is a path problem) and continue.

 

.hdf文件转.tif文件批处理

详情可参考说明文件:

EED2-TP-030_Rev01_HEG_UsersGuide_2.15.pdf  中的

节8. Batch Processing

 

 

 

  • 4
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 13
    评论
在Python中,你可以使用`pandas`库来导入tif文件并循环输出到Excel文件。下面是一个示例代码: ```python import pandas as pd import arcpy from arcpy import env env.workspace = arcpy.GetParameterAsText(0) output_folder = arcpy.GetParameterAsText(1) files = arcpy.ListRasters("*", "tif") data = \[\] for file in files: pos = file.index('.') outfile = file\[0:pos\] year = file\[6:10\] outPolygons = output_folder + "/" + year + "/" + outfile # 将栅格图像换为shp数据 arcpy.RasterToPolygon_conversion(file, outPolygons, "SIMPLIFY", "VALUE") # 读取shp数据并添加到data列表中 cursor = arcpy.da.SearchCursor(outPolygons, \["name", "Areakm2"\]) for row in cursor: data.append(\[row\[0\], row\[1\]\]) # 将data列表换为DataFrame df = pd.DataFrame(data, columns=\["name", "Areakm2"\]) # 将DataFrame输出到Excel文件 df.to_excel("output.xlsx", index=False) ``` 这段代码首先设置工作空间和输出文件夹,然后使用`arcpy.ListRasters`函数获取所有的tif文件。接下来,循环遍历每个tif文件,将其换为shp数据,并使用`arcpy.da.SearchCursor`读取shp数据的属性。将属性数据添加到一个列表中。最后,将列表换为DataFrame,并使用`to_excel`方法将DataFrame输出到Excel文件中。 请注意,你需要安装`pandas`和`arcpy`库来运行这段代码,并根据你的实际情况修改工作空间和输出文件夹的路径。 #### 引用[.reference_title] - *1* *3* [关于arcpy中批处理栅格及矢量文件的总结](https://blog.csdn.net/weixin_42055454/article/details/93216385)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [MODIS数据下载,HEG批量拼接处理,arcmap批量掩膜提取,python栅格计算](https://blog.csdn.net/QAQ_39/article/details/121332802)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值