Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ccatter opened this issue Jul 22, 2024 · 2 comments

Comments

@ccatter
Copy link

ccatter commented Jul 22, 2024

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
Copy link
Author

ccatter commented Jul 25, 2024

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

@j3r3m1
Copy link

j3r3m1 commented Dec 17, 2024

Sorry this ones has been totally lost in the to-debug pile...
If still relevant, for the second issue you met, which version of UMEP are you using ? Because I cannot reproduce your error (the data are loaded) and it seems this error may happen with UMEP version < 2.0.21 (before this version .gpkg was not supported).

However, your building data should clearly be simplified (please create building footprint from OSM data or drawing them, not polygonizing your raster.

Concerning the first issue, if you are ready to solve it we can discuss, it should be handled easily with your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants