UMEP-dev / UMEP-processing

7 stars 9 forks source link

URock Error: Trying to call NONE SQL-Function #32

Closed dawgermany closed 12 months ago

dawgermany commented 12 months ago

Hi, Whilst trying to run URock with data prepared with the Component "URock Prepare" I am running into the following issue:

QGIS version: 3.30.3-'s-Hertogenbosch
QGIS code revision: 2411cec112
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)
Algorithm started at: 2023-07-05T17:21:23
Algorithm 'Urban Wind Field: URock v2023a' starting…
Input parameters:
{ 'ATTENUATION_FIELD' : '', 'BUILDINGS' : '/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.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' : None, 'VEGETATION_CROWN_BASE_HEIGHT' : '', 'VEGETATION_CROWN_TOP_HEIGHT' : '', 'VERTICAL_RESOLUTION' : 2, 'WIND_HEIGHT' : '1.5' }

Writing settings for this model run to specified output folder (Filename: RunInfoURock_YYYY_DOY_HHMM.txt)
Initiating algorithm
Creates an H2GIS Instance and load data
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 "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 534, in execute
is_rs = self._prep.execute()
org.h2.jdbc.org.h2.jdbc.JdbcSQLSyntaxErrorException: org.h2.jdbc.JdbcSQLSyntaxErrorException: Funktion "NONE" nicht gefunden
Function "NONE" not found; SQL statement:

CALL None('/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.gpkg','TEMPO');
CREATE TABLE build_pre_srid_20230705172123
AS SELECT *
FROM TEMPO;
[90022-200]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/processor/urock_processing_algorithm.py", line 433, in processAlgorithm
MainCalculation.main(javaEnvironmentPath = javaEnvVar,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/MainCalculation.py", line 133, in main
loadData.loadData(fromCad = False,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/loadData.py", line 120, in loadData
loadFile(cursor = cursor,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/loadData.py", line 318, in loadFile
cursor.execute("""
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 536, in execute
_handle_sql_exception()
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 165, in _handle_sql_exception_jpype
reraise(exc_type, exc_info[1], exc_info[2])
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 57, in reraise
raise value.with_traceback(tb)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 534, in execute
is_rs = self._prep.execute()
jaydebeapi.DatabaseError: org.h2.jdbc.JdbcSQLSyntaxErrorException: Funktion "NONE" nicht gefunden
Function "NONE" not found; SQL statement:

CALL None('/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.gpkg','TEMPO');
CREATE TABLE build_pre_srid_20230705172123
AS SELECT *
FROM TEMPO;
[90022-200]

Execution failed after 0.07 seconds

I have tried using the "QGIS-Store" version of the plugin as well as cloning and installing the repo as .zip I have tried searching for the table "Tempo" in the referenced gpkg but i could not find it; i have tried manually creating a table named "TEMPO" in the gpkg but it did not help. Openjdk is on the latest version JayDeBeAPI is on the latest version jpype is on the latest version Official Oracle Java is used (/usr/libexec/java_home points to /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home)

this happens if i use just building polygons, if i just use vegetation polygons and if i use both it just throws the error for the building gpkg

j3r3m1 commented 12 months ago

Hi @dawgermany thank you for submitting. This problem has already been adressed here (https://github.com/UMEP-dev/UMEP/issues/533). The solution is to use shapefile or geojson instead of geopackage files as input.

dawgermany commented 12 months ago

Im sorry; i didnt find this when i tried to research this; thank you very much for the blazing fast answer