Tests SpatialDBBox with H2 Database
04/10/2006
Requierements
Downloads :
http://docs.codehaus.org/display/GEOS/SpatialDBBox
OS
Tested on winXP
Create database and add links to spatial functions
Run Ms-dos prompt (cmd)
Turn on h2.jar folder here h2_bindings
Set java -cp h2.jar;spatialdb.jar;jts-1.7.jar;StaticGeometry.java org.h2.tools.Server
Now load hgis.sql and execute it.
Set SELECT * FROM INFORMATION_SCHEMA.FUNCTION_ALIASES. H2 must list all functions.
Queries test
Set : call GeometryType(GeomFromWKT('POINT(0 0)'));
Set : call totext(intersection(GeomFromWKT('LINESTRING(0.1 0.1, 1 1)'),
GeomFromWKT('LINESTRING(0 0, 0.5 0.5)')));
"SRID=23030;POINT(5.55128205128205 9.52564102564103)"
any idea's is welcome
Data storage
Perhaps in OTHER feature because OBJECT feature doesn't exist.
Answer
http://h2database.com/ipowerb/index.php?showtopic=243&st=0&#entry1183
Thanks a lot for testing it! The problem is that H2 currently only supports 'known' data types as parameters and return values of functions. Known means Integer, int, String, long, byte[], and so on. If you return another object, this exception occurs. What I could do is serialize the return value and deserialize it when calling the function (this is not the most efficient solution, but should work). That also means the return value / parameter must be serializable. Is it? |