-
Notifications
You must be signed in to change notification settings - Fork 63
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
Question about H2GIS 2.0.0 (Function "st_contains" not found) #1308
Comments
H2 has a SCHEMA_SEARCH_PATH setting. It can be used to specify a schema with these functions to allow their usage in your current schema too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi...
I am trying to include h2gis in my project but I am not able to search with spatial functions from Java code using JPA criteria query.
The project is based in:
I was able to setup the database and install the extension by executing the required SQL statements (I use liquibase)
Also I had no issues for the creation of the required column (Also with liquibase)
In Java I am using JPA for storing the geometry column without any issues (By using org.locationtech.jts.geom.Geometry and Hibernate)
With these settings I am able to persist the information and read it back without any issues...
But the problems comes when I try to search with criteria query... I am using JTSSpatialPredicates for searching which performs the translation to SQL code, basically it receives a GeoJson area which is then translated to a Geometry JTS object to build the crieteria Predicate and then Hibernate-Spatial translates it to SQL Code...
From what I can see in the generated query, it seems it is building the query correctly
ST_Contains(?, cast(assetdatae5_."data_value" as GEOMETRY))=?))
But it throws a JDBC Exception as if the st_contains function is not recognized by the driver...
If I execute SQL code in the H2 Web Console it works correctly...
(SELECT * FROM "schema-name".asset_data where st_contains(data_geometry, 'POINT (-4.7464109 41.6252934)'))
From what I understood, h2gis 2.0.0 version should register the functions automatically in the driver, or I am wrong?
Is it necessary to perform any additional setting or include any other dependency?
I tried including h2gis-functions (which it seems is not available in 2.0.0 version) but I got same results..
Thanks for the Help.
Best regards
The text was updated successfully, but these errors were encountered: