geoscript-groovy icon indicating copy to clipboard operation
geoscript-groovy copied to clipboard

H2GIS workspace

Open ebocher opened this issue 2 years ago • 6 comments

Since H2GIS is in GeoTools (https://github.com/geotools/geotools/pull/4043) we can expose H2GIS in GeoScript.

ebocher avatar Jan 14 '23 08:01 ebocher

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

jericks avatar Jan 16 '23 22:01 jericks

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]

jericks avatar Jan 16 '23 22:01 jericks

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

ebocher avatar Jan 17 '23 07:01 ebocher

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

ebocher avatar Jan 20 '23 11:01 ebocher

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

jericks avatar Jan 21 '23 02:01 jericks

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

ebocher avatar Jan 23 '23 09:01 ebocher