UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
59 stars 15 forks source link

Urban Wind Field: URock v2023a FileNotFoundError: [WinError 2] The system cannot find the file specified #635

Open ccatter opened 1 month ago

ccatter commented 1 month ago

I used the given example files of Göteborg test dataset to run URock but got the following error

-- QGIS version: 3.34.7-Prizren QGIS code revision: 6f7d735c Qt version: 5.15.13 Python version: 3.12.3 GDAL version: 3.9.0 GEOS version: 3.12.1-CAPI-1.18.1 PROJ version: Rel. 9.4.0, March 1st, 2024 PDAL version: 2.6.3 (git-version: b5523a) Algorithm started at: 2024-07-22T16:28:29 Algorithm 'Urban Wind Field: URock v2023a' starting… Input parameters: { 'ATTENUATION_FIELD' : '', 'BUILDINGS' : 'C:/Users/uu703/OneDrive - UCL/data/Goteborg_SWEREF99_1200/building.gpkg', 'HEIGHT_FIELD_BUILD' : 'ROOF_HEIGHT', 'HORIZONTAL_RESOLUTION' : 2, 'INPUT_PROFILE_FILE' : '', 'INPUT_PROFILE_TYPE' : 0, 'INPUT_WIND_DIRECTION' : 45, 'INPUT_WIND_HEIGHT' : 10, 'INPUT_WIND_SPEED' : 2, 'LOAD_OUTPUT' : True, 'OUTPUT_FILENAME' : 'urock_output', 'RASTER_OUTPUT' : None, 'SAVE_NETCDF' : True, 'SAVE_RASTER' : True, 'SAVE_VECTOR' : True, 'UROCK_OUTPUT' : 'TEMPORARY_OUTPUT', 'VEGETATION' : 'C:/Users/uu703/OneDrive - UCL/data/Goteborg_SWEREF99_1200/vegetation.gpkg', 'VEGETATION_CROWN_BASE_HEIGHT' : '', 'VEGETATION_CROWN_TOP_HEIGHT' : 'VEG_HEIGHT', 'VERTICAL_RESOLUTION' : 2, 'WIND_HEIGHT' : '1.5' }

Traceback (most recent call last): File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 349, in getJavaHome java_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\JavaSoft\Java Runtime Environment") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 353, in getJavaHome java_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\JavaSoft\Java Development Kit") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 324, in processAlgorithm javaDirDefault = getJavaDir(plugin_directory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 234, in getJavaDir javaPath = getJavaHome(os_type) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 356, in getJavaHome exit() File "", line 26, in call SystemExit: None

ccatter commented 1 month ago

I switched to another computer with the following environment and it works: QGIS version: 3.36.0-Maidenhead QGIS code revision: 09951dc0 Qt version: 5.15.3 Python version: 3.9.18 GDAL version: 3.8.4 GEOS version: 3.12.1-CAPI-1.18.1 PROJ version: Rel. 9.3.1, December 1st, 2023 PDAL version: 2.6.0 (git-version: 3fced5)

Algorithm 'Urban Wind Field: URock v2023a' starting…

However, I still cannot run the algorithm in my research area with the coordinate system ESPG:31370 files.zip The error message is as following:

============= Traceback (most recent call last): File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute org.h2.jdbc.org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Check constraint violation: "(MULTIPOLYGON, 31370) <> (MULTIPOLYGON Z, 31370)"; SQL statement: INSERT INTO TEMPO VALUES(ST_GeomFromWKB(?, 31370),?,?,?,?,?,?,?) [23513-200]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute java.sql.java.sql.SQLException: java.sql.SQLException: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Check constraint violation: "(MULTIPOLYGON, 31370) <> (MULTIPOLYGON Z, 31370)"; SQL statement: INSERT INTO TEMPO VALUES(ST_GeomFromWKB(?, 31370),?,?,?,?,?,?,?) [23513-200]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\yehuang\AppData\Roaming\Python\Python39\site-packages\jaydebeapi__init__.py", line 534, in execute is_rs = self._prep.execute() org.h2.jdbc.org.h2.jdbc.JdbcSQLException: org.h2.jdbc.JdbcSQLException: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Check constraint violation: "(MULTIPOLYGON, 31370) <> (MULTIPOLYGON Z, 31370)"; SQL statement: INSERT INTO TEMPO VALUES(ST_GeomFromWKB(?, 31370),?,?,?,?,?,?,?) [23513-200]; SQL statement:

DROP TABLE IF EXISTS TEMPO, build_pre_srid_20240725162132; [0-200]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/yehuang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 447, in processAlgorithm MainCalculation.main(javaEnvironmentPath = javaEnvVar, File "C:\Users/yehuang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\MainCalculation.py", line 135, in main loadData.loadData(fromCad = False, File "C:\Users/yehuang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\loadData.py", line 120, in loadData loadFile(cursor = cursor, File "C:\Users/yehuang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\loadData.py", line 318, in loadFile cursor.execute(""" File "C:\Users\yehuang\AppData\Roaming\Python\Python39\site-packages\jaydebeapi__init.py", line 536, in execute _handle_sql_exception() File "C:\Users\yehuang\AppData\Roaming\Python\Python39\site-packages\jaydebeapi__init__.py", line 165, in _handle_sql_exception_jpype reraise(exc_type, exc_info[1], exc_info[2]) File "C:\Users\yehuang\AppData\Roaming\Python\Python39\site-packages\jaydebeapi__init__.py", line 57, in reraise raise value.with_traceback(tb) File "C:\Users\yehuang\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\init__.py", line 534, in execute is_rs = self._prep.execute() jaydebeapi.DatabaseError: org.h2.jdbc.JdbcSQLException: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Check constraint violation: "(MULTIPOLYGON, 31370) <> (MULTIPOLYGON Z, 31370)"; SQL statement: INSERT INTO TEMPO VALUES(ST_GeomFromWKB(?, 31370),?,?,?,?,?,?,?) [23513-200]; SQL statement:

DROP TABLE IF EXISTS TEMPO, build_pre_srid_20240725162132; [0-200]

Execution failed after 1.40 seconds