I just noticed that when running your SQL: create table testgeom(id serial, the_geom geometry) as select null, 'POINT(5 10)';
the table DOES get created (it doesn't show up until I log out and back in to the console). But there is no geometry in it. <https://lh3.googleusercontent.com/-Vr1vlhjZ7LM/VssQBk1ba_I/AAAAAAAAAAk/A201gOPKIxY/s1600/no%2Bgeom.png> It seems as though H2 can create a field using the GEOMETRY type, but it cannot recognize the actual JTS geometry in the field (in my case). Thanks. On Sunday, February 21, 2016 at 10:40:53 PM UTC-7, [email protected] wrote: > > I've been trying to use the newer spatial functions in H2 by exploiting > the JTS library. In my application, I'm utilizing H2 in embedded mode > within an Eclipse project. While in Eclipse, I have access to spatial > functionality without problems. When I try to view the database in the H2 > web page, I have issues. My program is adding GEOMETRY objects to a table > just fine, and I can pull them out of H2 just fine while in Eclipse. > > I think what is happening is that H2 cannot find the JTS library on the > classpath. I'm getting the following exception when I try to open up an H2 > database in the browser with GEOMETRY types in it: > > org.h2.jdbc.JdbcSQLException: General error: > "java.lang.NoClassDefFoundError: com/vividsolutions/jts/io/ParseException" > [50000-191] > > If I try to open a database without GEOMETRY types, the H2 web page runs > without problems and I can see the tables. > > I've followed the instructions for dropping jts-1.13.jar in the bin > directory. Since I'm on Windows, I also added jts-1.13.jar to the classpath > in the h2.bat file. Here's what the batch file looks like: > > @java -cp "h2-1.4.191.jar;jts-1.13.jar;%H2DRIVERS%;%CLASSPATH%" > org.h2.tools.Console %* > @if errorlevel 1 pause > > I've also tried running an older version of H2 (h2-1.3.176.jar), but I > always get the same results. > > Any ideas? > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
