hec-hms和gdal配置

rsaldnfx  于 2021-07-09  发布在  Java
关注(0)|答案(1)|浏览(424)

我试图让hec的hms软件运行作为一个工作的样本项目,遵循官方的指示https://www.hec.usace.army.mil/confluence/hmsdocs/hmsguides/running-hec-hms-with-jython
运行命令时:

hec-hms.cmd -script C:/Projects/castro/scripts/compute_current.py

我得到这个错误

C:\Program Files\HEC\HEC-HMS\4.8>jre\bin\java -Dsun.java2d.d3d=false -DMapPanel.NoVolatileImage=true -Dpython.import.site=false -Xms32M -Dpython.path=.\hms.jar;.\lib\* "-Djava.library.path=.\bin;.\bin\gdal;.\bin\hdf" -classpath .\hms.jar;.\lib\* hms.Hms  -script c:\Users\windar\Documents\castro_48.py
Native library load failed.
java.lang.UnsatisfiedLinkError: C:\Program Files\HEC\HEC-HMS\4.8\bin\gdal\gdalalljni.dll: Can't find dependent libraries
Apr 21, 2021 12:56:13 PM hms.m <init>
SEVERE: 'void org.gdal.gdal.gdalJNI.SetConfigOption(java.lang.String, java.lang.String)'
java.lang.UnsatisfiedLinkError: 'void org.gdal.gdal.gdalJNI.SetConfigOption(java.lang.String, java.lang.String)'
        at org.gdal.gdal.gdalJNI.SetConfigOption(Native Method)
        at org.gdal.gdal.gdal.SetConfigOption(gdal.java:184)
        at hms.m.<init>(Unknown Source)
        at hms.m.<clinit>(Unknown Source)
        at hms.Hms.<clinit>(Unknown Source)

我添加了这些env变量,但它仍然存在:

GDAL_DRIVER_PATH=C:/Programs/HEC-HMS-4.8/bin/gdal/gdalplugins
GDAL_DATA=C:/Programs/HEC-HMS-4.8/gdal/bin/gdal-data
PROJ_LIB=C:/Programs/HEC-HMS-4.8/gdal/bin/projlib
06odsfpq

06odsfpq1#

通过测试和比较不同的版本,我发现hec hms 4.8附带gdal缺少一些dll文件。简单的解决方案是降级到4.7.1并确保项目兼容。

相关问题