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

H2GIS workspace #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ebocher
Copy link

@ebocher ebocher commented Jan 14, 2023

Since H2GIS is in GeoTools (geotools/geotools#4043) we can expose H2GIS in GeoScript.

@jericks
Copy link
Member

jericks commented Jan 16, 2023

This looks great! Thanks for the PR! Eventually, we should add a H2GIS section to https://jericks.github.io/geoscript-groovy-cookbook/

@jericks
Copy link
Member

jericks commented Jan 16, 2023

Any idea why the build can't find org.geotools.jdbc:gt-jdbc-h2gis:jar:29-SNAPSHOT?

Error: Failed to execute goal on project geoscript-groovy: Could not resolve dependencies for project org.geoscript:geoscript-groovy:jar:1.21.0-SNAPSHOT: Could not find artifact org.geotools.jdbc:gt-jdbc-h2gis:jar:29-SNAPSHOT in osgeo-snapshots (https://repo.osgeo.org/repository/snapshot/) -> [Help 1]

@ebocher
Copy link
Author

ebocher commented Jan 17, 2023

I used a local compiled version. I don't known why the H2GIS extension is not published on https://repo.osgeo.org/repository/snapshot/
I will send a message to the list

- add new methods on H2GIS module
- add new unit tests
@ebocher ebocher marked this pull request as ready for review January 20, 2023 11:34
@ebocher
Copy link
Author

ebocher commented Jan 20, 2023

Hi @jericks
The H2GIS workspace has been updated and it rocks now !
New methods are available on the H2GIS workspace to load, save, link file or table in a database.
Added also some unit tests
There is still a bug when I try to draw a linked shapefile. It seems related to the StreamingRenderer but the layer is correctly rendered. The test is currently disabled (drawLinkedShapeFile()).
Feel free to test and comments this PR
Erwan

@jericks
Copy link
Member

jericks commented Jan 21, 2023

There are a couple of failing tests:

2023-01-20T18:40:49.1237190Z [ERROR] Errors:
2023-01-20T18:40:49.1239427Z [ERROR] DBTilesTest.h2:78 » JdbcSQLSyntaxError Syntax error in SQL statement "CREATE TABLE IF NOT EXISTS metadata (name text, []value text);"; expected "identifier"; SQL statement:
2023-01-20T18:40:49.1240553Z CREATE TABLE IF NOT EXISTS metadata (name text, value text); [42001-214]
2023-01-20T18:40:49.1243425Z [ERROR] DBTilesTest.h2DataSource:91 » JdbcSQLSyntaxError Syntax error in SQL statement "CREATE TABLE IF NOT EXISTS metadata (name text, [
]value text);"; expected "identifier"; SQL statement:
2023-01-20T18:40:49.1244135Z CREATE TABLE IF NOT EXISTS metadata (name text, value text); [42001-214]
2023-01-20T18:40:49.1244977Z [ERROR] DBTilesTest.h2Metadata:101 » JdbcSQLSyntaxError Syntax error in SQL statement "CREATE TABLE IF NOT EXISTS metadata (name text, [*]value text);"; expected "identifier"; SQL statement:
2023-01-20T18:40:49.1245904Z CREATE TABLE IF NOT EXISTS metadata (name text, value text); [42001-214]
2023-01-20T18:40:49.1246438Z [ERROR] FormatTest.getFormat:29 » NullPointer Cannot invoke method dispose() on null object
2023-01-20T18:40:49.1246944Z [ERROR] GraticuleTest.createLinesToH2:174 » IO Schema 'lines' does not exist.
2023-01-20T18:40:49.1247387Z [ERROR] LayerTest.cursorPaging:845 » IO Schema 'facilities' does not exist.
2023-01-20T18:40:49.1248211Z [ERROR] LayerTest.cursorSorting:730 » IO Schema 'facilities' does not exist.
2023-01-20T18:40:49.1248674Z [ERROR] NetCDFTest.getNames:24 » NullPointer Cannot invoke method dispose() on null object
2023-01-20T18:40:49.1249130Z [ERROR] NetCDFTest.read:16 » NullPointer Cannot invoke method dispose() on null object
2023-01-20T18:40:49.1249597Z [ERROR] WriterTest.testWriterWithH2:62->testWriter:33 » IO Schema 'points' does not exist.
2023-01-20T18:40:49.1250195Z [ERROR] DatabaseStyleRepositoryTest.h2:29->runDatabaseTest:49 » MissingProperty No such property: characterStream for class: java.lang.String
2023-01-20T18:40:49.1250684Z [ERROR] H2Test.add:58 » IO Schema 'counties' does not exist.
2023-01-20T18:40:49.1251051Z [ERROR] H2Test.create:45 » IO Schema 'widgets' does not exist.
2023-01-20T18:40:49.1251427Z [ERROR] H2Test.createView:91 » IO Schema 'states' does not exist.
2023-01-20T18:40:49.1251810Z [ERROR] H2Test.createView2:67 » IO Schema 'states' does not exist.
2023-01-20T18:40:49.1253857Z [ERROR] H2Test.getSql:148 » IO Schema 'widgets' does not exist.
2023-01-20T18:40:49.1254278Z [ERROR] H2Test.getWorkspaceFromMap:193 » IO Schema 'points' does not exist.
2023-01-20T18:40:49.1254721Z [ERROR] H2Test.getWorkspaceFromString:180 » IO Schema 'points' does not exist.
2023-01-20T18:40:49.1255120Z [ERROR] H2Test.indexes:118 » IO Schema 'widgets' does not exist.
2023-01-20T18:40:49.1255490Z [ERROR] H2Test.remove:22 » IO Schema 'widgets' does not exist.
2023-01-20T18:40:49.1255708Z [INFO]
2023-01-20T18:40:49.1255936Z [ERROR] Tests run: 1507, Failures: 0, Errors: 20, Skipped: 2

@ebocher
Copy link
Author

ebocher commented Jan 23, 2023

Hi @jericks

There is several conflicts due to the fact that some modules of GT use a very old version of H2 database : 1.1.119. H2GIS uses the 2.1.214.
As geoscript is not modularized, I don't see a solution to solve this issue.
H2GIS should be put in a specific container isolated from GT modules that use another version of h2.
Best regards

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

Successfully merging this pull request may close these issues.

2 participants